Skip to content

Commit

Permalink
add global image settings for all images in the EG chart
Browse files Browse the repository at this point in the history
Signed-off-by: huabing zhao <zhaohuabing@gmail.com>
  • Loading branch information
zhaohuabing committed May 13, 2024
1 parent c30d09f commit 85cc004
Show file tree
Hide file tree
Showing 7 changed files with 48 additions and 5 deletions.
15 changes: 15 additions & 0 deletions charts/gateway-helm/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,18 @@ Create the name of the service account to use
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}

{{- define "envoy-gateway-config" -}}
provider:
type: Kubernetes
kubernetes:
rateLimitDeployment:
container:
{{- if .Values.images.ratelimit.repository }}
image: {{ .Values.images.ratelimit.repository }}:{{ .Values.images.ratelimit.tag | default "master" }}
{{- end }}
shutdownManager:
{{- if .Values.images.shutdownManager.repository }}
image: {{ .Values.images.shutdownManager.repository }}:{{ .Values.images.shutdownManager.tag | default "latest" }}
{{- end }}
{{- end }}
2 changes: 1 addition & 1 deletion charts/gateway-helm/templates/certgen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ spec:
fieldPath: metadata.namespace
- name: KUBERNETES_CLUSTER_DOMAIN
value: {{ .Values.kubernetesClusterDomain }}
image: {{ .Values.deployment.envoyGateway.image.repository }}:{{ .Values.deployment.envoyGateway.image.tag | default .Chart.AppVersion }}
image: {{ .Values.images.envoyGateway.repository | default .Values.deployment.envoyGateway.image.repository }}:{{ .Values.images.envoyGateway.tag | default .Values.deployment.envoyGateway.image.tag | default .Chart.AppVersion }}
imagePullPolicy: {{ .Values.deployment.envoyGateway.imagePullPolicy }}
name: envoy-gateway-certgen
{{- with .Values.certgen.job.resources }}
Expand Down
5 changes: 4 additions & 1 deletion charts/gateway-helm/templates/envoy-gateway-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,7 @@ data:
envoy-gateway.yaml: |
apiVersion: gateway.envoyproxy.io/v1alpha1
kind: EnvoyGateway
{{- toYaml .Values.config.envoyGateway | nindent 4 }}
{{ $baseEnvoyGatewayConfig := include "envoy-gateway-config" . | fromYaml }}
{{ $userEnvoyGatewayConfig := .Values.config.envoyGateway }}
{{ $mergedEnvoyGatewayConfig := merge $userEnvoyGatewayConfig $baseEnvoyGatewayConfig }}
{{- toYaml $mergedEnvoyGatewayConfig | nindent 4 }}
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ spec:
fieldPath: metadata.namespace
- name: KUBERNETES_CLUSTER_DOMAIN
value: {{ .Values.kubernetesClusterDomain }}
image: {{ .Values.deployment.envoyGateway.image.repository }}:{{ .Values.deployment.envoyGateway.image.tag | default .Chart.AppVersion }}
image: {{ .Values.images.envoyGateway.repository | default .Values.deployment.envoyGateway.image.repository }}:{{ .Values.images.envoyGateway.tag | default .Chart.AppVersion }}
imagePullPolicy: {{ .Values.deployment.envoyGateway.imagePullPolicy }}
livenessProbe:
httpGet:
Expand Down
13 changes: 13 additions & 0 deletions charts/gateway-helm/values.tmpl.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
# The global image settings for all images in this chart.
# These values will take precedence over the values in the other sections.
images:
envoyGateway:
repository: ${ImageRepository}
tag: '${ImageTag}'
shutdownManager:
repository: ${ImageRepository}
tag: '${ImageTag}'
ratelimit:
repository: docker.io/envoyproxy/ratelimit
tag: 'master'

deployment:
envoyGateway:
image:
Expand Down
6 changes: 6 additions & 0 deletions site/content/en/latest/install/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,11 @@ The Helm chart for Envoy Gateway
| deployment.ports[2].port | int | `19001` | |
| deployment.ports[2].targetPort | int | `19001` | |
| deployment.replicas | int | `1` | |
| images.envoyGateway.repository | string | `"docker.io/envoyproxy/gateway"` | |
| images.envoyGateway.tag | string | `"latest"` | |
| images.ratelimit.repository | string | `"docker.io/envoyproxy/ratelimit"` | |
| images.ratelimit.tag | string | `"master"` | |
| images.shutdownManager.repository | string | `"docker.io/envoyproxy/gateway"` | |
| images.shutdownManager.tag | string | `"latest"` | |
| kubernetesClusterDomain | string | `"cluster.local"` | |

10 changes: 8 additions & 2 deletions test/helm/default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,19 @@ data:
envoy-gateway.yaml: |
apiVersion: gateway.envoyproxy.io/v1alpha1
kind: EnvoyGateway

Check failure on line 31 in test/helm/default.yaml

View workflow job for this annotation

GitHub Actions / lint

31:1 [trailing-spaces] trailing spaces

Check failure on line 31 in test/helm/default.yaml

View workflow job for this annotation

GitHub Actions / lint

31:1 [trailing-spaces] trailing spaces

Check failure on line 32 in test/helm/default.yaml

View workflow job for this annotation

GitHub Actions / lint

32:1 [trailing-spaces] trailing spaces

Check failure on line 32 in test/helm/default.yaml

View workflow job for this annotation

GitHub Actions / lint

32:1 [trailing-spaces] trailing spaces

Check failure on line 33 in test/helm/default.yaml

View workflow job for this annotation

GitHub Actions / lint

33:1 [trailing-spaces] trailing spaces

Check failure on line 33 in test/helm/default.yaml

View workflow job for this annotation

GitHub Actions / lint

33:1 [trailing-spaces] trailing spaces
gateway:
controllerName: gateway.envoyproxy.io/gatewayclass-controller
logging:
level:
default: info
provider:
kubernetes:
rateLimitDeployment:
container:
image: docker.io/envoyproxy/ratelimit:master
shutdownManager:
image: docker.io/envoyproxy/gateway-dev:latest
type: Kubernetes
Expand Down Expand Up @@ -371,7 +377,7 @@ spec:
fieldPath: metadata.namespace
- name: KUBERNETES_CLUSTER_DOMAIN
value: cluster.local
image: docker.io/envoyproxy/gateway-dev:latest
image: docker.io/envoyproxy/gateway-dev:c30d09f2
imagePullPolicy: IfNotPresent
livenessProbe:
httpGet:
Expand Down Expand Up @@ -519,7 +525,7 @@ spec:
fieldPath: metadata.namespace
- name: KUBERNETES_CLUSTER_DOMAIN
value: cluster.local
image: docker.io/envoyproxy/gateway-dev:latest
image: docker.io/envoyproxy/gateway-dev:c30d09f2
imagePullPolicy: IfNotPresent
name: envoy-gateway-certgen
restartPolicy: Never
Expand Down

0 comments on commit 85cc004

Please sign in to comment.