ability to specify prefix for catalog sync
This commit is contained in:
parent
0931239bee
commit
560c461c9b
3 changed files with 32 additions and 0 deletions
|
@ -50,5 +50,8 @@ spec:
|
|||
-to-k8s=false \
|
||||
{{- end }}
|
||||
-consul-domain={{ .Values.global.domain }} \
|
||||
{{- if .Values.syncCatalog.k8sPrefix }}
|
||||
-k8s-service-prefix="{{ .Values.syncCatalog.k8sPrefix}}" \
|
||||
{{- end }}
|
||||
-k8s-write-namespace=${NAMESPACE}
|
||||
{{- end }}
|
||||
|
|
|
@ -99,3 +99,27 @@ load _helpers
|
|||
yq '.spec.template.spec.containers[0].command | any(contains("-to-consul"))' | tee /dev/stderr)
|
||||
[ "${actual}" = "false" ]
|
||||
}
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
# k8sPrefix
|
||||
|
||||
@test "syncCatalog/Deployment: no k8sPrefix by default" {
|
||||
cd `chart_dir`
|
||||
local actual=$(helm template \
|
||||
-x templates/sync-catalog-deployment.yaml \
|
||||
--set 'syncCatalog.enabled=true' \
|
||||
. | tee /dev/stderr |
|
||||
yq '.spec.template.spec.containers[0].command | any(contains("-k8s-service-prefix"))' | tee /dev/stderr)
|
||||
[ "${actual}" = "false" ]
|
||||
}
|
||||
|
||||
@test "syncCatalog/Deployment: can specify k8sPrefix" {
|
||||
cd `chart_dir`
|
||||
local actual=$(helm template \
|
||||
-x templates/sync-catalog-deployment.yaml \
|
||||
--set 'syncCatalog.enabled=true' \
|
||||
--set 'syncCatalog.k8sPrefix=foo-' \
|
||||
. | tee /dev/stderr |
|
||||
yq '.spec.template.spec.containers[0].command | any(contains("-k8s-service-prefix=\"foo-\""))' | tee /dev/stderr)
|
||||
[ "${actual}" = "true" ]
|
||||
}
|
||||
|
|
|
@ -143,6 +143,11 @@ syncCatalog:
|
|||
toConsul: true
|
||||
toK8S: true
|
||||
|
||||
# k8sPrefix is the service prefix to prepend to services before registering
|
||||
# with Kubernetes. For example "consul-" will register all services
|
||||
# prepended with "consul-".
|
||||
k8sPrefix: null
|
||||
|
||||
# ConnectInject will enable the automatic Connect sidecar injector.
|
||||
connectInject:
|
||||
enabled: false # "-" disable this by default for now until the image is public
|
||||
|
|
Loading…
Reference in a new issue