Skip to content

Commit

Permalink
update config map
Browse files Browse the repository at this point in the history
  • Loading branch information
akshaysngupta committed Nov 1, 2024
1 parent 400e248 commit fa3d1e2
Show file tree
Hide file tree
Showing 10 changed files with 349 additions and 2 deletions.
6 changes: 5 additions & 1 deletion helm/ingress-azure/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -106,4 +106,8 @@ data:

{{- if .Values.kubernetes.ingressClassResource.controllerValue}}
INGRESS_CLASS_RESOURCE_CONTROLLER: "{{ .Values.kubernetes.ingressClassResource.controllerValue }}"
{{- end}}
{{- end}}

{{- if .Values.addon }}
ADDON_MODE: {{ .Values.addon | quote }}
{{- end }}
3 changes: 2 additions & 1 deletion helm/ingress-azure/tests/chart_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// Licensed under the MIT License. See License.txt in the project root for license information.
// --------------------------------------------------------------------------------------------

//go:build unittest
// +build unittest

package tests
Expand Down Expand Up @@ -39,7 +40,7 @@ func TestChart(t *testing.T) {

for _, snapshot := range snapshots {
snapshotName, _ := filepath.Rel(valuesDir, snapshot)
name := strings.TrimRight(snapshotName, ".json")
name := strings.TrimSuffix(snapshotName, ".json")

t.Run(name, func(t *testing.T) {
snapshotDir := fmt.Sprintf("snapshots/%s", name)
Expand Down
103 changes: 103 additions & 0 deletions helm/ingress-azure/tests/fixtures/sample-config-addon.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
{
"verbosityLevel": 3,
"appgw": {
"subscriptionId": "0000-0000-0000-0000-00000000",
"resourceGroup": "resgp",
"name": "gateway",
"usePrivateIP": false,
"shared": false
},
"armAuth": {
"type": "aadPodIdentity",
"identityResourceID": "/a/b/c",
"identityClientID": "0000-0000-0000-0000-00000000"
},
"rbac": {
"enabled": false
},
"kubernetes": {
"multiClusterMode": false,
"watchNamespace": "a,b,c",
"securityContext": {
"runAsUser": 3000,
"runAsGroup": 3000
},
"containerSecurityContext": {
"readOnlyRootFilesystem": "true"
},
"resources": {
"limits": {
"cpu": "200m",
"memory": "100Mi"
},
"requests": {
"cpu": "100m",
"memory": "100Mi"
}
},
"nodeSelector": {
"beta.kubernetes.io/os": "linux"
},
"podAnnotations": {
"custom-annotation": "custom-value"
},
"tolerations": [
{
"key": "CriticalAppsOnly",
"operator": "Exists"
}
],
"affinity": {
"nodeAffinity": {
"preferredDuringSchedulingIgnoredDuringExecution": [
{
"weight": 100,
"preference": {
"matchExpressions": [
{
"key": "kubernetes.cloud.com/mode",
"operator": "In",
"values": [
"system"
]
}
]
}
}
],
"requiredDuringSchedulingIgnoredDuringExecution": {
"nodeSelectorTerms": [
{
"labelSelector": null,
"matchExpressions": [
{
"key": "kubernetes.cloud.com/cluster",
"operator": "Exists"
}
]
}
]
}
}
},
"volumes": {
"extraVolumes": [
{
"name": "contoso",
"hostPath": {
"path": "/etc/contoso/",
"type": "Directory"
}
}
],
"extraVolumeMounts": [
{
"name": "contoso",
"mountPath": "/etc/contoso/",
"readOnly": true
}
]
}
},
"addon": true
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
# Source: ingress-azure/templates/aadpodidbinding.yaml
# Please see https://github.com/Azure/aad-pod-identity for more inromation
apiVersion: "aadpodidentity.k8s.io/v1"
kind: AzureIdentityBinding
metadata:
name: release-name-azidbinding-ingress-azure
spec:
azureIdentity: release-name-azid-ingress-azure
selector: release-name-ingress-azure
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
# Source: ingress-azure/templates/aadpodidentity.yaml
# Please see https://github.com/Azure/aad-pod-identity for more information
apiVersion: "aadpodidentity.k8s.io/v1"
kind: AzureIdentity
metadata:
name: release-name-azid-ingress-azure
spec:
type: 0
resourceID: /a/b/c
clientID: 0000-0000-0000-0000-00000000
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
---
# Source: ingress-azure/templates/cleanup-job.yaml
apiVersion: batch/v1
kind: Job
metadata:
name: release-name-ingress-azure-cleanup
labels:
app: ingress-azure-cleanup
chart: ingress-azure-1.6.0
heritage: Helm
release: release-name
annotations:
"helm.sh/hook": pre-delete
"helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded
spec:
template:
spec:
serviceAccountName: release-name-sa-ingress-azure
restartPolicy: OnFailure
containers:
- name: cleanup
image: "mcr.microsoft.com/oss/kubernetes/kubectl:v1.30.5"
imagePullPolicy: IfNotPresent
env:
- name: AGIC_POD_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
command:
- "kubectl"
- "delete"
- "--ignore-not-found"
- "--wait"
- "-n"
- "$(AGIC_POD_NAMESPACE)"
- "overlayextensionconfigs.acn.azure.com"
- "-l"
- "app.kubernetes.io/managed-by=ingress-azure-addon"
securityContext:
capabilities:
drop:
- ALL
nodeSelector:
beta.kubernetes.io/os: linux
affinity:
nodeAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- preference:
matchExpressions:
- key: kubernetes.cloud.com/mode
operator: In
values:
- system
weight: 100
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- labelSelector: null
matchExpressions:
- key: kubernetes.cloud.com/cluster
operator: Exists
tolerations:
- key: CriticalAppsOnly
operator: Exists
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
# Source: ingress-azure/templates/configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
name: release-name-cm-ingress-azure
labels:
app: ingress-azure
chart: ingress-azure-1.6.0
heritage: Helm
release: release-name
data:
APPGW_VERBOSITY_LEVEL: "3"
MULTI_CLUSTER_MODE: "false"
HTTP_SERVICE_PORT: "8123"
APPGW_SUBSCRIPTION_ID: "0000-0000-0000-0000-00000000"
APPGW_RESOURCE_GROUP: "resgp"
APPGW_NAME: "gateway"
APPGW_SUBNET_NAME: "gateway-subnet"
KUBERNETES_WATCHNAMESPACE: "a,b,c"
AZURE_CLIENT_ID: "0000-0000-0000-0000-00000000"
USE_MANAGED_IDENTITY_FOR_POD: "true"
INGRESS_CLASS_RESOURCE_ENABLED: "true"
INGRESS_CLASS_RESOURCE_NAME: "azure-application-gateway"
INGRESS_CLASS_RESOURCE_CONTROLLER: "azure/application-gateway"
ADDON_MODE: "true"
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
---
# Source: ingress-azure/templates/deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: release-name-ingress-azure
labels:
app: ingress-azure
chart: ingress-azure-1.6.0
heritage: Helm
release: release-name
spec:
replicas: 1 # TODO: Make configurable when leader election is supported.
selector:
matchLabels:
app: ingress-azure
release: release-name
template:
metadata:
labels:
app: ingress-azure
release: release-name
aadpodidbinding: release-name-ingress-azure
annotations:
prometheus.io/scrape: "true"
prometheus.io/port: "8123"
custom-annotation: custom-value
spec:
serviceAccountName: release-name-sa-ingress-azure
securityContext:
runAsGroup: 3000
runAsUser: 3000
containers:
- name: ingress-azure
image: mcr.microsoft.com/azure-application-gateway/kubernetes-ingress:1.6.0
imagePullPolicy: Always
readinessProbe:
httpGet:
path: /health/ready
port: 8123
initialDelaySeconds: 5
periodSeconds: 10
livenessProbe:
httpGet:
path: /health/alive
port: 8123
initialDelaySeconds: 15
periodSeconds: 20
resources:
limits:
cpu: 200m
memory: 100Mi
requests:
cpu: 100m
memory: 100Mi
securityContext:
readOnlyRootFilesystem: "true"
env:
- name: AZURE_CLOUD_PROVIDER_LOCATION
value: /etc/appgw/azure.json
- name: AGIC_POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: AGIC_POD_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
envFrom:
- configMapRef:
name: release-name-cm-ingress-azure
volumeMounts:
- name: azure
mountPath: /etc/appgw/
readOnly: true
- mountPath: /etc/contoso/
name: contoso
readOnly: true
volumes:
- name: azure
hostPath:
path: /etc/kubernetes/
type: Directory
- hostPath:
path: /etc/contoso/
type: Directory
name: contoso
nodeSelector:
beta.kubernetes.io/os: linux
affinity:
nodeAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- preference:
matchExpressions:
- key: kubernetes.cloud.com/mode
operator: In
values:
- system
weight: 100
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- labelSelector: null
matchExpressions:
- key: kubernetes.cloud.com/cluster
operator: Exists
tolerations:
- key: CriticalAppsOnly
operator: Exists
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
# Source: ingress-azure/templates/ingressclass.yaml
apiVersion: networking.k8s.io/v1
kind: IngressClass
metadata:
labels:
app.kubernetes.io/component: controller
name: azure-application-gateway
spec:
controller: azure/application-gateway
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
# Source: ingress-azure/templates/serviceaccount.yaml
apiVersion: v1
kind: ServiceAccount
metadata:
labels:
app: ingress-azure
chart: ingress-azure-1.6.0
heritage: Helm
release: release-name
name: release-name-sa-ingress-azure

0 comments on commit fa3d1e2

Please sign in to comment.