diff --git a/traefikee/templates/proxy/deployment.yaml b/traefikee/templates/proxy/deployment.yaml index 6d5f67f..9e89296 100644 --- a/traefikee/templates/proxy/deployment.yaml +++ b/traefikee/templates/proxy/deployment.yaml @@ -86,6 +86,26 @@ spec: capabilities: drop: - NET_RAW + {{- if $proxy.enablePluginWait | default false }} + - name: wait-for-registry + image: {{ template "traefikee-helm-chart.initContainer-image-name" $ }} + command: ['sh', '-c', "until timeout 2 nc {{ printf "%s-plugin-registry-svc.%s" $.Values.cluster $.Release.Namespace }}.svc.cluster.local 443 &> /dev/null; do echo waiting for plugin-registry; sleep 2; done"] + resources: + requests: + cpu: 10m + memory: 10Mi + limits: + cpu: 20m + memory: 32Mi + securityContext: + readOnlyRootFilesystem: true + runAsUser: 65532 + seccompProfile: + type: RuntimeDefault + capabilities: + drop: + - NET_RAW + {{- end }} {{- if not $.Values.disableChown }} - name: chown image: {{ template "traefikee-helm-chart.initContainer-image-name" $ }} diff --git a/traefikee/tests/proxy_test.yaml b/traefikee/tests/proxy_test.yaml index 0ab9a61..5152e9f 100644 --- a/traefikee/tests/proxy_test.yaml +++ b/traefikee/tests/proxy_test.yaml @@ -326,3 +326,11 @@ tests: content: containerPort: 4443 name: https + - it: should be possible to make proxy wait for the plugin registry + set: + proxy: + enablePluginWait: true + asserts: + - equal: + path: spec.template.spec.initContainers[1].command + value: ['sh', '-c', "until timeout 2 nc default-plugin-registry-svc.NAMESPACE.svc.cluster.local 443 &> /dev/null; do echo waiting for plugin-registry; sleep 2; done"] \ No newline at end of file diff --git a/traefikee/values.yaml b/traefikee/values.yaml index 12154b9..4d75cd3 100644 --- a/traefikee/values.yaml +++ b/traefikee/values.yaml @@ -219,7 +219,6 @@ proxy: loadBalancerIP: loadBalancerSourceRanges: - # To disable affinity at all set this value to null affinity: nodeAffinity: @@ -268,6 +267,10 @@ proxy: # value: 1 # periodSeconds: 60 +## Enable init container to wait for plugin registry to be ready + enablePluginWait: false + + ## Those probes need for ping to be enabled in static config readinessProbe: httpGet: