Skip to content

Instantly share code, notes, and snippets.

@noelbundick
Last active August 6, 2018 15:26
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save noelbundick/b3627b10832444fc1d6439815b9b4fb2 to your computer and use it in GitHub Desktop.
Save noelbundick/b3627b10832444fc1d6439815b9b4fb2 to your computer and use it in GitHub Desktop.
aks http application routing addon

Installation

Select at cluster creation in the Azure Portal or run the following to add to your existing AKS cluster

az resource update --ids '/subscriptions/<subid>/resourcegroups/<resource_group>/providers/Microsoft.ContainerService/managedClusters/<aks_cluster_name>' --set properties.addonProfiles.httpApplicationRouting='{"enabled":true}' 
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
annotations:
deployment.kubernetes.io/revision: "1"
kubectl.kubernetes.io/last-applied-configuration: |
{"apiVersion":"extensions/v1beta1","kind":"Deployment","metadata":{"annotations":{},"labels":{"addonmanager.kubernetes.io/mode":"Reconcile","app":"addon-http-application-routing-external-dns","kubernetes.io/cluster-service":"true"},"name":"addon-http-application-routing-external-dns","namespace":"kube-system"},"spec":{"strategy":{"type":"Recreate"},"template":{"metadata":{"labels":{"app":"addon-http-application-routing-external-dns"}},"spec":{"containers":[{"args":["--source=service","--source=ingress","--provider=azure","--azure-resource-group=MC_devopspreview82d8_devops-preview_eastus","--domain-filter=d8af9473-84bd-4b9d-9a01-c912bdc437f7.eastus.aksapp.io","--annotation-filter=kubernetes.io/ingress.class=addon-http-application-routing"],"image":"zalan.azureedge.net/teapot/external-dns:v0.4.8","imagePullPolicy":"Always","name":"addon-http-application-routing-external-dns","volumeMounts":[{"mountPath":"/etc/kubernetes/azure.json","name":"azure-config-file","readOnly":true}]}],"serviceAccountName":"addon-http-application-routing-external-dns","volumes":[{"hostPath":{"path":"/etc/kubernetes/azure.json"},"name":"azure-config-file"}]}}}}
creationTimestamp: null
generation: 1
labels:
addonmanager.kubernetes.io/mode: Reconcile
app: addon-http-application-routing-external-dns
kubernetes.io/cluster-service: "true"
name: addon-http-application-routing-external-dns
selfLink: /apis/extensions/v1beta1/namespaces/kube-system/deployments/addon-http-application-routing-external-dns
spec:
replicas: 1
selector:
matchLabels:
app: addon-http-application-routing-external-dns
strategy:
type: Recreate
template:
metadata:
creationTimestamp: null
labels:
app: addon-http-application-routing-external-dns
spec:
containers:
- args:
- --source=service
- --source=ingress
- --provider=azure
- --azure-resource-group=MC_devopspreview82d8_devops-preview_eastus
- --domain-filter=d8af9473-84bd-4b9d-9a01-c912bdc437f7.eastus.aksapp.io
- --annotation-filter=kubernetes.io/ingress.class=addon-http-application-routing
image: zalan.azureedge.net/teapot/external-dns:v0.4.8
imagePullPolicy: Always
name: addon-http-application-routing-external-dns
resources: {}
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
volumeMounts:
- mountPath: /etc/kubernetes/azure.json
name: azure-config-file
readOnly: true
dnsPolicy: ClusterFirst
restartPolicy: Always
schedulerName: default-scheduler
securityContext: {}
serviceAccount: addon-http-application-routing-external-dns
serviceAccountName: addon-http-application-routing-external-dns
terminationGracePeriodSeconds: 30
volumes:
- hostPath:
path: /etc/kubernetes/azure.json
type: ""
name: azure-config-file
status: {}
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
annotations:
deployment.kubernetes.io/revision: "1"
kubectl.kubernetes.io/last-applied-configuration: |
{"apiVersion":"extensions/v1beta1","kind":"Deployment","metadata":{"annotations":{},"labels":{"addonmanager.kubernetes.io/mode":"Reconcile","app":"addon-http-application-routing-ingress-nginx","kubernetes.io/cluster-service":"true"},"name":"addon-http-application-routing-nginx-ingress-controller","namespace":"kube-system"},"spec":{"replicas":1,"selector":{"matchLabels":{"app":"addon-http-application-routing-nginx-ingress"}},"template":{"metadata":{"labels":{"app":"addon-http-application-routing-nginx-ingress"}},"spec":{"containers":[{"args":["/nginx-ingress-controller","--ingress-class=addon-http-application-routing","--default-backend-service=$(POD_NAMESPACE)/addon-http-application-routing-default-http-backend","--configmap=$(POD_NAMESPACE)/addon-http-application-routing-nginx-configuration","--tcp-services-configmap=$(POD_NAMESPACE)/addon-http-application-routing-tcp-services","--udp-services-configmap=$(POD_NAMESPACE)/addon-http-application-routing-udp-services","--annotations-prefix=nginx.ingress.kubernetes.io","--publish-service=$(POD_NAMESPACE)/addon-http-application-routing-nginx-ingress"],"env":[{"name":"POD_NAME","valueFrom":{"fieldRef":{"fieldPath":"metadata.name"}}},{"name":"POD_NAMESPACE","valueFrom":{"fieldRef":{"fieldPath":"metadata.namespace"}}}],"image":"quayio.azureedge.net/kubernetes-ingress-controller/nginx-ingress-controller:0.13.0","imagePullPolicy":"Always","livenessProbe":{"failureThreshold":3,"httpGet":{"path":"/healthz","port":10254,"scheme":"HTTP"},"initialDelaySeconds":10,"periodSeconds":10,"successThreshold":1,"timeoutSeconds":1},"name":"addon-http-application-routing-nginx-ingress-controller","ports":[{"containerPort":80,"name":"http"},{"containerPort":443,"name":"https"}],"readinessProbe":{"failureThreshold":3,"httpGet":{"path":"/healthz","port":10254,"scheme":"HTTP"},"periodSeconds":10,"successThreshold":1,"timeoutSeconds":1}}],"serviceAccountName":"addon-http-application-routing-nginx-ingress-serviceaccount"}}}}
creationTimestamp: null
generation: 1
labels:
addonmanager.kubernetes.io/mode: Reconcile
app: addon-http-application-routing-ingress-nginx
kubernetes.io/cluster-service: "true"
name: addon-http-application-routing-nginx-ingress-controller
selfLink: /apis/extensions/v1beta1/namespaces/kube-system/deployments/addon-http-application-routing-nginx-ingress-controller
spec:
replicas: 1
selector:
matchLabels:
app: addon-http-application-routing-nginx-ingress
strategy:
rollingUpdate:
maxSurge: 1
maxUnavailable: 1
type: RollingUpdate
template:
metadata:
creationTimestamp: null
labels:
app: addon-http-application-routing-nginx-ingress
spec:
containers:
- args:
- /nginx-ingress-controller
- --ingress-class=addon-http-application-routing
- --default-backend-service=$(POD_NAMESPACE)/addon-http-application-routing-default-http-backend
- --configmap=$(POD_NAMESPACE)/addon-http-application-routing-nginx-configuration
- --tcp-services-configmap=$(POD_NAMESPACE)/addon-http-application-routing-tcp-services
- --udp-services-configmap=$(POD_NAMESPACE)/addon-http-application-routing-udp-services
- --annotations-prefix=nginx.ingress.kubernetes.io
- --publish-service=$(POD_NAMESPACE)/addon-http-application-routing-nginx-ingress
env:
- name: POD_NAME
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: metadata.name
- name: POD_NAMESPACE
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: metadata.namespace
image: quayio.azureedge.net/kubernetes-ingress-controller/nginx-ingress-controller:0.13.0
imagePullPolicy: Always
livenessProbe:
failureThreshold: 3
httpGet:
path: /healthz
port: 10254
scheme: HTTP
initialDelaySeconds: 10
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 1
name: addon-http-application-routing-nginx-ingress-controller
ports:
- containerPort: 80
name: http
protocol: TCP
- containerPort: 443
name: https
protocol: TCP
readinessProbe:
failureThreshold: 3
httpGet:
path: /healthz
port: 10254
scheme: HTTP
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 1
resources: {}
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
dnsPolicy: ClusterFirst
restartPolicy: Always
schedulerName: default-scheduler
securityContext: {}
serviceAccount: addon-http-application-routing-nginx-ingress-serviceaccount
serviceAccountName: addon-http-application-routing-nginx-ingress-serviceaccount
terminationGracePeriodSeconds: 30
status: {}
apiVersion: v1
kind: Service
metadata:
annotations:
kubectl.kubernetes.io/last-applied-configuration: |
{"apiVersion":"v1","kind":"Service","metadata":{"annotations":{},"labels":{"addonmanager.kubernetes.io/mode":"Reconcile","app":"addon-http-application-routing-default-http-backend","kubernetes.io/cluster-service":"true"},"name":"addon-http-application-routing-default-http-backend","namespace":"kube-system"},"spec":{"ports":[{"port":80,"targetPort":8080}],"selector":{"app":"addon-http-application-routing-default-http-backend"}}}
creationTimestamp: null
labels:
addonmanager.kubernetes.io/mode: Reconcile
app: addon-http-application-routing-default-http-backend
kubernetes.io/cluster-service: "true"
name: addon-http-application-routing-default-http-backend
selfLink: /api/v1/namespaces/kube-system/services/addon-http-application-routing-default-http-backend
spec:
ports:
- port: 80
protocol: TCP
targetPort: 8080
selector:
app: addon-http-application-routing-default-http-backend
sessionAffinity: None
type: ClusterIP
status:
loadBalancer: {}
MIT License
Copyright (c) 2018 Noel Bundick
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment