Skip to content

Commit 8700fa1

Browse files
committed
clean up job
1 parent 817818a commit 8700fa1

File tree

11 files changed

+351
-50
lines changed

11 files changed

+351
-50
lines changed
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
apiVersion: batch/v1
2+
kind: Job
3+
metadata:
4+
name: {{ template "application-gateway-kubernetes-ingress.fullname" . }}-cleanup
5+
labels:
6+
app: {{ template "application-gateway-kubernetes-ingress.name" . }}-cleanup
7+
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
8+
heritage: {{ .Release.Service }}
9+
release: {{ .Release.Name }}
10+
annotations:
11+
"helm.sh/hook": pre-delete
12+
"helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded
13+
spec:
14+
template:
15+
spec:
16+
serviceAccountName: {{ template "application-gateway-kubernetes-ingress.serviceaccountname" . }}
17+
restartPolicy: OnFailure
18+
containers:
19+
- name: cleanup
20+
image: "mcr.microsoft.com/oss/kubernetes/kubectl:v1.30.5"
21+
imagePullPolicy: IfNotPresent
22+
env:
23+
- name: AGIC_POD_NAMESPACE
24+
valueFrom:
25+
fieldRef:
26+
fieldPath: metadata.namespace
27+
command:
28+
- "kubectl"
29+
- "delete"
30+
- "--ignore-not-found"
31+
- "--wait"
32+
- "-n"
33+
- "$(AGIC_POD_NAMESPACE)"
34+
- "overlayextensionconfigs.acn.azure.com/agic-overlay-extension-config"
35+
securityContext:
36+
capabilities:
37+
drop:
38+
- ALL
39+
{{- if .Values.kubernetes.nodeSelector }}
40+
{{- with .Values.kubernetes.nodeSelector }}
41+
nodeSelector:
42+
{{ toYaml . | indent 8 }}
43+
{{- end}}
44+
{{- else}}
45+
{{- with .Values.nodeSelector }}
46+
nodeSelector:
47+
{{ toYaml . | indent 8 }}
48+
{{- end}}
49+
{{- end}}
50+
51+
{{- with .Values.kubernetes.affinity }}
52+
affinity:
53+
{{ toYaml . | indent 8 }}
54+
{{- end }}
55+
{{- with .Values.kubernetes.tolerations }}
56+
tolerations:
57+
{{ toYaml . | indent 8 }}
58+
{{- end }}
59+
{{- if .Values.image.pullSecrets }}
60+
imagePullSecrets:
61+
- name: {{ .Values.image.pullSecrets }}
62+
{{- end }}

helm/ingress-azure/templates/clusterrole.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,4 +65,22 @@ rules:
6565
verbs:
6666
- create
6767
- patch
68+
- apiGroups:
69+
- "acn.azure.com"
70+
resources:
71+
- "overlayextensionconfigs"
72+
verbs:
73+
- "list"
74+
- "get"
75+
- "watch"
76+
- "create"
77+
- "update"
78+
- "delete"
79+
- "patch"
80+
- apiGroups:
81+
- "acn.azure.com"
82+
resources:
83+
- "nodenetworkconfigs"
84+
verbs:
85+
- "list"
6886
{{- end -}}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
---
2+
# Source: ingress-azure/templates/cleanup-job.yaml
3+
apiVersion: batch/v1
4+
kind: Job
5+
metadata:
6+
name: release-name-ingress-azure-cleanup
7+
labels:
8+
app: ingress-azure-cleanup
9+
chart: ingress-azure-1.6.0
10+
heritage: Helm
11+
release: release-name
12+
annotations:
13+
"helm.sh/hook": pre-delete
14+
"helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded
15+
spec:
16+
template:
17+
spec:
18+
serviceAccountName: release-name-sa-ingress-azure
19+
restartPolicy: OnFailure
20+
containers:
21+
- name: cleanup
22+
image: "mcr.microsoft.com/oss/kubernetes/kubectl:v1.30.5"
23+
imagePullPolicy: IfNotPresent
24+
env:
25+
- name: AGIC_POD_NAMESPACE
26+
valueFrom:
27+
fieldRef:
28+
fieldPath: metadata.namespace
29+
command:
30+
- "kubectl"
31+
- "delete"
32+
- "--ignore-not-found"
33+
- "--wait"
34+
- "-n"
35+
- "$(AGIC_POD_NAMESPACE)"
36+
- "overlayextensionconfigs.acn.azure.com/agic-overlay-extension-config"
37+
securityContext:
38+
capabilities:
39+
drop:
40+
- ALL
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
---
2+
# Source: ingress-azure/templates/cleanup-job.yaml
3+
apiVersion: batch/v1
4+
kind: Job
5+
metadata:
6+
name: release-name-ingress-azure-cleanup
7+
labels:
8+
app: ingress-azure-cleanup
9+
chart: ingress-azure-1.6.0
10+
heritage: Helm
11+
release: release-name
12+
annotations:
13+
"helm.sh/hook": pre-delete
14+
"helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded
15+
spec:
16+
template:
17+
spec:
18+
serviceAccountName: release-name-sa-ingress-azure
19+
restartPolicy: OnFailure
20+
containers:
21+
- name: cleanup
22+
image: "mcr.microsoft.com/oss/kubernetes/kubectl:v1.30.5"
23+
imagePullPolicy: IfNotPresent
24+
env:
25+
- name: AGIC_POD_NAMESPACE
26+
valueFrom:
27+
fieldRef:
28+
fieldPath: metadata.namespace
29+
command:
30+
- "kubectl"
31+
- "delete"
32+
- "--ignore-not-found"
33+
- "--wait"
34+
- "-n"
35+
- "$(AGIC_POD_NAMESPACE)"
36+
- "overlayextensionconfigs.acn.azure.com/agic-overlay-extension-config"
37+
securityContext:
38+
capabilities:
39+
drop:
40+
- ALL

helm/ingress-azure/tests/snapshots/sample-config-existing-secret/ingress-azure/templates/configmap.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ metadata:
1212
data:
1313
APPGW_VERBOSITY_LEVEL: "3"
1414
MULTI_CLUSTER_MODE: "false"
15-
HTTP_SERVICE_PORT: "8123"
15+
HTTP_SERVICE_PORT: "8123"
1616
APPGW_SUBSCRIPTION_ID: "0000-0000-0000-0000-00000000"
17-
APPGW_RESOURCE_GROUP: "resgp"
18-
APPGW_NAME: "gateway"
17+
APPGW_RESOURCE_GROUP: "resgp"
18+
APPGW_NAME: "gateway"
1919
APPGW_SUBNET_NAME: "gateway-subnet"
2020
INGRESS_CLASS_RESOURCE_ENABLED: "true"
2121
INGRESS_CLASS_RESOURCE_NAME: "azure-application-gateway"
22-
INGRESS_CLASS_RESOURCE_CONTROLLER: "azure/application-gateway"
22+
INGRESS_CLASS_RESOURCE_CONTROLLER: "azure/application-gateway"

helm/ingress-azure/tests/snapshots/sample-config-existing-secret/ingress-azure/templates/deployment.yaml

Lines changed: 44 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -28,49 +28,49 @@ spec:
2828
securityContext:
2929
runAsUser: 0
3030
containers:
31-
- name: ingress-azure
32-
image: mcr.microsoft.com/azure-application-gateway/kubernetes-ingress:1.6.0
33-
imagePullPolicy: Always
34-
readinessProbe:
35-
httpGet:
36-
path: /health/ready
37-
port: 8123
38-
initialDelaySeconds: 5
39-
periodSeconds: 10
40-
livenessProbe:
41-
httpGet:
42-
path: /health/alive
43-
port: 8123
44-
initialDelaySeconds: 15
45-
periodSeconds: 20
46-
env:
47-
- name: AZURE_CLOUD_PROVIDER_LOCATION
48-
value: /etc/appgw/azure.json
49-
- name: AGIC_POD_NAME
50-
valueFrom:
51-
fieldRef:
52-
fieldPath: metadata.name
53-
- name: AGIC_POD_NAMESPACE
54-
valueFrom:
55-
fieldRef:
56-
fieldPath: metadata.namespace
57-
- name: AZURE_AUTH_LOCATION
58-
value: /etc/Azure/Networking-AppGW/auth/armAuth.json
59-
envFrom:
60-
- configMapRef:
61-
name: release-name-cm-ingress-azure
62-
volumeMounts:
63-
- name: azure
64-
mountPath: /etc/appgw/
65-
readOnly: true
66-
- name: networking-appgw-k8s-azure-service-principal-mount
67-
mountPath: /etc/Azure/Networking-AppGW/auth
68-
readOnly: true
69-
volumes:
31+
- name: ingress-azure
32+
image: mcr.microsoft.com/azure-application-gateway/kubernetes-ingress:1.6.0
33+
imagePullPolicy: Always
34+
readinessProbe:
35+
httpGet:
36+
path: /health/ready
37+
port: 8123
38+
initialDelaySeconds: 5
39+
periodSeconds: 10
40+
livenessProbe:
41+
httpGet:
42+
path: /health/alive
43+
port: 8123
44+
initialDelaySeconds: 15
45+
periodSeconds: 20
46+
env:
47+
- name: AZURE_CLOUD_PROVIDER_LOCATION
48+
value: /etc/appgw/azure.json
49+
- name: AGIC_POD_NAME
50+
valueFrom:
51+
fieldRef:
52+
fieldPath: metadata.name
53+
- name: AGIC_POD_NAMESPACE
54+
valueFrom:
55+
fieldRef:
56+
fieldPath: metadata.namespace
57+
- name: AZURE_AUTH_LOCATION
58+
value: /etc/Azure/Networking-AppGW/auth/armAuth.json
59+
envFrom:
60+
- configMapRef:
61+
name: release-name-cm-ingress-azure
62+
volumeMounts:
7063
- name: azure
71-
hostPath:
72-
path: /etc/kubernetes/
73-
type: Directory
64+
mountPath: /etc/appgw/
65+
readOnly: true
7466
- name: networking-appgw-k8s-azure-service-principal-mount
75-
secret:
76-
secretName: my-existing-secret
67+
mountPath: /etc/Azure/Networking-AppGW/auth
68+
readOnly: true
69+
volumes:
70+
- name: azure
71+
hostPath:
72+
path: /etc/kubernetes/
73+
type: Directory
74+
- name: networking-appgw-k8s-azure-service-principal-mount
75+
secret:
76+
secretName: my-existing-secret

helm/ingress-azure/tests/snapshots/sample-config-existing-secret/ingress-azure/templates/ingressclass.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ metadata:
77
app.kubernetes.io/component: controller
88
name: azure-application-gateway
99
spec:
10-
controller: azure/application-gateway
10+
controller: azure/application-gateway

helm/ingress-azure/tests/snapshots/sample-config-existing-secret/ingress-azure/templates/serviceaccount.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ metadata:
88
chart: ingress-azure-1.6.0
99
heritage: Helm
1010
release: release-name
11-
name: release-name-sa-ingress-azure
11+
name: release-name-sa-ingress-azure
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
---
2+
# Source: ingress-azure/templates/cleanup-job.yaml
3+
apiVersion: batch/v1
4+
kind: Job
5+
metadata:
6+
name: release-name-ingress-azure-cleanup
7+
labels:
8+
app: ingress-azure-cleanup
9+
chart: ingress-azure-1.6.0
10+
heritage: Helm
11+
release: release-name
12+
annotations:
13+
"helm.sh/hook": pre-delete
14+
"helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded
15+
spec:
16+
template:
17+
spec:
18+
serviceAccountName: release-name-sa-ingress-azure
19+
restartPolicy: OnFailure
20+
containers:
21+
- name: cleanup
22+
image: "mcr.microsoft.com/oss/kubernetes/kubectl:v1.30.5"
23+
imagePullPolicy: IfNotPresent
24+
env:
25+
- name: AGIC_POD_NAMESPACE
26+
valueFrom:
27+
fieldRef:
28+
fieldPath: metadata.namespace
29+
command:
30+
- "kubectl"
31+
- "delete"
32+
- "--ignore-not-found"
33+
- "--wait"
34+
- "-n"
35+
- "$(AGIC_POD_NAMESPACE)"
36+
- "overlayextensionconfigs.acn.azure.com/agic-overlay-extension-config"
37+
securityContext:
38+
capabilities:
39+
drop:
40+
- ALL
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
---
2+
# Source: ingress-azure/templates/cleanup-job.yaml
3+
apiVersion: batch/v1
4+
kind: Job
5+
metadata:
6+
name: release-name-ingress-azure-cleanup
7+
labels:
8+
app: ingress-azure-cleanup
9+
chart: ingress-azure-1.6.0
10+
heritage: Helm
11+
release: release-name
12+
annotations:
13+
"helm.sh/hook": pre-delete
14+
"helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded
15+
spec:
16+
template:
17+
spec:
18+
serviceAccountName: release-name-sa-ingress-azure
19+
restartPolicy: OnFailure
20+
containers:
21+
- name: cleanup
22+
image: "mcr.microsoft.com/oss/kubernetes/kubectl:v1.30.5"
23+
imagePullPolicy: IfNotPresent
24+
env:
25+
- name: AGIC_POD_NAMESPACE
26+
valueFrom:
27+
fieldRef:
28+
fieldPath: metadata.namespace
29+
command:
30+
- "kubectl"
31+
- "delete"
32+
- "--ignore-not-found"
33+
- "--wait"
34+
- "-n"
35+
- "$(AGIC_POD_NAMESPACE)"
36+
- "overlayextensionconfigs.acn.azure.com/agic-overlay-extension-config"
37+
securityContext:
38+
capabilities:
39+
drop:
40+
- ALL

0 commit comments

Comments
 (0)