Skip to content

Commit

Permalink
feat: ✨ make proxy wait for plugin registry
Browse files Browse the repository at this point in the history
  • Loading branch information
NEwa-05 authored Dec 12, 2024
1 parent 9e93ca6 commit 8071c77
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 1 deletion.
20 changes: 20 additions & 0 deletions traefikee/templates/proxy/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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" $ }}
Expand Down
8 changes: 8 additions & 0 deletions traefikee/tests/proxy_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
5 changes: 4 additions & 1 deletion traefikee/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,6 @@ proxy:
loadBalancerIP:
loadBalancerSourceRanges:


# To disable affinity at all set this value to null
affinity:
nodeAffinity:
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 8071c77

Please sign in to comment.