Skip to content

Commit 42b20a5

Browse files
committed
feat: add eg.fullname support for resources names (#8156)
Signed-off-by: Dmitrii Golubtsov <evarome10@gmail.com>
1 parent dc8e6fc commit 42b20a5

28 files changed

Lines changed: 67 additions & 62 deletions

charts/gateway-helm/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Please refer to Helm's [documentation](https://helm.sh/docs) to get started.
3333
Once Helm has been set up correctly, install the chart from dockerhub:
3434

3535
``` shell
36-
helm install eg oci://docker.io/envoyproxy/gateway-helm --version v0.0.0-latest -n envoy-gateway-system --create-namespace
36+
helm install envoy-gateway oci://docker.io/envoyproxy/gateway-helm --version v0.0.0-latest -n envoy-gateway-system --create-namespace
3737
```
3838
You can find all helm chart release in [Dockerhub](https://hub.docker.com/r/envoyproxy/gateway-helm/tags)
3939

@@ -52,7 +52,7 @@ make kube-deploy TAG=latest
5252
You can install the eg chart along without Gateway API CRDs and Envoy Gateway CRDs, make sure CRDs exist in Cluster first if you want to skip to install them, otherwise EG may fail to start:
5353

5454
``` shell
55-
helm install eg --create-namespace oci://docker.io/envoyproxy/gateway-helm --version v0.0.0-latest -n envoy-gateway-system --skip-crds
55+
helm install envoy-gateway --create-namespace oci://docker.io/envoyproxy/gateway-helm --version v0.0.0-latest -n envoy-gateway-system --skip-crds
5656
```
5757

5858
To uninstall the chart:

charts/gateway-helm/templates/_helpers.tpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Allow the release namespace to be overridden.
99
Expand the name of the chart.
1010
*/}}
1111
{{- define "eg.name" -}}
12-
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
12+
{{- default .Values.nameOverride "envoy-gateway" | trunc 63 | trimSuffix "-" }}
1313
{{- end }}
1414

1515
{{/*
@@ -21,7 +21,7 @@ If release name contains chart name it will be used as a full name.
2121
{{- if .Values.fullnameOverride }}
2222
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
2323
{{- else }}
24-
{{- $name := default .Chart.Name .Values.nameOverride }}
24+
{{- $name := default .Values.nameOverride "envoy-gateway" }}
2525
{{- if contains $name .Release.Name }}
2626
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
2727
{{- else }}

charts/gateway-helm/templates/certgen-rbac.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ rules:
9696
resources:
9797
- mutatingwebhookconfigurations
9898
resourceNames:
99-
- 'envoy-gateway-topology-injector.{{ include "eg.namespace" . }}'
99+
- '{{ include "eg.fullname" . }}-topology-injector.{{ include "eg.namespace" . }}'
100100
verbs:
101101
- update
102102
- patch

charts/gateway-helm/templates/certgen.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ spec:
5252
value: {{ .Values.kubernetesClusterDomain }}
5353
image: {{ include "eg.image" . }}
5454
imagePullPolicy: {{ include "eg.image.pullPolicy" . }}
55-
name: envoy-gateway-certgen
55+
name: {{ include "eg.fullname" . }}-certgen
5656
{{- with .Values.certgen.job.resources }}
5757
resources:
5858
{{- toYaml . | nindent 10 }}

charts/gateway-helm/templates/envoy-gateway-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
apiVersion: v1
22
kind: ConfigMap
33
metadata:
4-
name: envoy-gateway-config
4+
name: {{ include "eg.fullname" . }}-config
55
namespace: {{ include "eg.namespace" . }}
66
labels:
77
{{- include "eg.labels" . | nindent 4 }}

charts/gateway-helm/templates/envoy-gateway-deployment.yaml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
apiVersion: apps/v1
22
kind: Deployment
33
metadata:
4-
name: envoy-gateway
4+
name: {{ include "eg.fullname" . }}
55
namespace: {{ include "eg.namespace" . }}
66
{{- with .Values.deployment.annotations }}
77
annotations:
88
{{- toYaml . | nindent 4 }}
99
{{- end }}
1010
labels:
11-
control-plane: envoy-gateway
11+
control-plane: {{ include "eg.fullname" . }}
1212
{{- include "eg.labels" . | nindent 4 }}
1313
spec:
1414
{{- if not .Values.hpa.enabled }}
1515
replicas: {{ .Values.deployment.replicas }}
1616
{{- end }}
1717
selector:
1818
matchLabels:
19-
control-plane: envoy-gateway
19+
control-plane: {{ include "eg.fullname" . }}
2020
{{- include "eg.selectorLabels" . | nindent 6 }}
2121
template:
2222
metadata:
@@ -25,7 +25,7 @@ spec:
2525
{{- toYaml . | nindent 8 }}
2626
{{- end }}
2727
labels:
28-
control-plane: envoy-gateway
28+
control-plane: {{ include "eg.fullname" . }}
2929
{{- include "eg.selectorLabels" . | nindent 8 }}
3030
{{- with .Values.deployment.pod.labels }}
3131
{{- toYaml . | nindent 8 }}
@@ -67,7 +67,7 @@ spec:
6767
port: 8081
6868
initialDelaySeconds: 15
6969
periodSeconds: 20
70-
name: envoy-gateway
70+
name: {{ include "eg.fullname" . }}
7171
ports:
7272
{{- range .Values.deployment.ports }}
7373
- containerPort: {{ .port }}
@@ -98,13 +98,13 @@ spec:
9898
{{- with .Values.deployment.priorityClassName }}
9999
priorityClassName: {{ . | quote }}
100100
{{- end }}
101-
serviceAccountName: envoy-gateway
101+
serviceAccountName: {{ include "eg.fullname" . }}
102102
terminationGracePeriodSeconds: 10
103103
volumes:
104104
- configMap:
105105
defaultMode: 420
106-
name: envoy-gateway-config
106+
name: {{ include "eg.fullname" . }}-config
107107
name: envoy-gateway-config
108108
- name: certs
109109
secret:
110-
secretName: envoy-gateway
110+
secretName: {{ include "eg.fullname" . }}

charts/gateway-helm/templates/envoy-gateway-hpa.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
apiVersion: autoscaling/v2
33
kind: HorizontalPodAutoscaler
44
metadata:
5-
name: envoy-gateway
5+
name: {{ include "eg.fullname" . }}
66
namespace: {{ include "eg.namespace" $ }}
77
spec:
88
scaleTargetRef:
99
apiVersion: apps/v1
1010
kind: Deployment
11-
name: envoy-gateway
11+
name: {{ include "eg.fullname" . }}
1212
{{- if .Values.hpa.minReplicas }}
1313
minReplicas: {{ .Values.hpa.minReplicas }}
1414
{{- end }}

charts/gateway-helm/templates/envoy-gateway-poddisruptionbudget.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
apiVersion: policy/v1
33
kind: PodDisruptionBudget
44
metadata:
5-
name: envoy-gateway
5+
name: {{ include "eg.fullname" . }}
66
namespace: {{ include "eg.namespace" . }}
77
spec:
88
{{- if and .Values.podDisruptionBudget.minAvailable }}
@@ -13,6 +13,6 @@ spec:
1313
{{- end }}
1414
selector:
1515
matchLabels:
16-
control-plane: envoy-gateway
16+
control-plane: {{ include "eg.fullname" . }}
1717
{{- include "eg.selectorLabels" . | nindent 6 }}
1818
{{- end }}

charts/gateway-helm/templates/envoy-gateway-rbac.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ roleRef:
3232
name: {{ include "eg.fullname" $ }}-envoy-gateway-role
3333
subjects:
3434
- kind: ServiceAccount
35-
name: 'envoy-gateway'
35+
name: {{ include "eg.fullname" $ }}
3636
namespace: {{ include "eg.namespace" $ }}
3737
{{ end }}
3838
---
@@ -54,7 +54,7 @@ roleRef:
5454
name: {{ include "eg.fullname" . }}-envoy-gateway-role
5555
subjects:
5656
- kind: ServiceAccount
57-
name: 'envoy-gateway'
57+
name: '{{ include "eg.fullname" . }}'
5858
namespace: {{ include "eg.namespace" . }}
5959
{{ else }}
6060
---
@@ -77,6 +77,6 @@ roleRef:
7777
name: {{ include "eg.fullname" . }}-envoy-gateway-role
7878
subjects:
7979
- kind: ServiceAccount
80-
name: 'envoy-gateway'
80+
name: '{{ include "eg.fullname" . }}'
8181
namespace: {{ include "eg.namespace" . }}
8282
{{ end }}

charts/gateway-helm/templates/envoy-gateway-service.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
apiVersion: v1
22
kind: Service
33
metadata:
4-
name: envoy-gateway
4+
name: {{ include "eg.fullname" . }}
55
namespace: {{ include "eg.namespace" . }}
66
{{- with .Values.service.annotations }}
77
annotations:
88
{{- toYaml . | nindent 4 }}
99
{{- end }}
1010
labels:
11-
control-plane: envoy-gateway
11+
control-plane: {{ include "eg.fullname" . }}
1212
{{- include "eg.labels" . | nindent 4 }}
1313
spec:
1414
type: {{ .Values.service.type }}
1515
{{- if and (eq .Values.service.type "LoadBalancer") .Values.service.loadBalancerIP }}
1616
loadBalancerIP: {{ .Values.service.loadBalancerIP }}
1717
{{- end }}
1818
selector:
19-
control-plane: envoy-gateway
19+
control-plane: {{ include "eg.fullname" . }}
2020
{{- include "eg.selectorLabels" . | nindent 4 }}
2121
ports:
2222
{{- .Values.deployment.ports | toYaml | nindent 2 -}}

0 commit comments

Comments
 (0)