Skip to content

Commit

Permalink
feat(ingress-istio-controller): add leader election to allow for mult…
Browse files Browse the repository at this point in the history
…iple replicas.
  • Loading branch information
Justin Bertrand committed Nov 1, 2023
1 parent 2eb6bd5 commit 4ba697f
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 4 deletions.
4 changes: 2 additions & 2 deletions stable/ingress-istio-controller/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 1.2.3
version: 1.3.0

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
appVersion: v1.3.2
appVersion: v1.4.0

home: https://statcan.gc.ca
sources:
Expand Down
9 changes: 9 additions & 0 deletions stable/ingress-istio-controller/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,15 @@ spec:
{{- end }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
env:
- name: "LOCK_IDENTITY"
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: "LOCK_NAMESPACE"
valueFrom:
fieldRef:
fieldPath: metadata.namespace
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
Expand Down
24 changes: 24 additions & 0 deletions stable/ingress-istio-controller/templates/role.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: {{ include "ingress-istio-controller.fullname" . }}
labels:
{{- include "ingress-istio-controller.labels" . | nindent 4 }}
rules:
- apiGroups:
- coordination.k8s.io
resources:
- leases
verbs:
- create
- apiGroups:
- coordination.k8s.io
resourceNames:
- istio-ingress-controller # lock-name configuration
resources:
- leases
verbs:
- get
- update
- watch
- patch
14 changes: 14 additions & 0 deletions stable/ingress-istio-controller/templates/rolebinding.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: {{ include "ingress-istio-controller.fullname" . }}
labels:
{{- include "ingress-istio-controller.labels" . | nindent 4 }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: {{ include "ingress-istio-controller.fullname" . }}
subjects:
- kind: ServiceAccount
name: {{ include "ingress-istio-controller.fullname" . }}
namespace: {{ .Release.Namespace }}
4 changes: 2 additions & 2 deletions stable/ingress-istio-controller/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,13 @@ gateway:
privateKey: sds
serverCertificate: sds

replicaCount: 1
replicaCount: 2

image:
repository: statcan/ingress-istio-controller
pullPolicy: IfNotPresent
# Overrides the image tag whose default is the chart appVersion.
# tag: "v1.0.0"
# tag: "v1.4.0"

imagePullSecrets: {}

Expand Down

0 comments on commit 4ba697f

Please sign in to comment.