Skip to content

Instantly share code, notes, and snippets.

@nphmuller
Created October 29, 2018 10:28
Show Gist options
  • Save nphmuller/e8eebd523dae6490265957bf5b58a571 to your computer and use it in GitHub Desktop.
Save nphmuller/e8eebd523dae6490265957bf5b58a571 to your computer and use it in GitHub Desktop.
nginx-ingress-external.yaml
kind: ConfigMap
apiVersion: v1
metadata:
name: nginx-configuration-external
namespace: infra
labels:
app: nginx-ingress
tier: external
---
kind: ConfigMap
apiVersion: v1
metadata:
name: tcp-services-external
namespace: infra
labels:
app: nginx-ingress
tier: external
---
kind: ConfigMap
apiVersion: v1
metadata:
name: udp-services-external
namespace: infra
labels:
app: nginx-ingress
tier: external
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-ingress-controller-external
namespace: infra
labels:
app: nginx-ingress
tier: external
spec:
replicas: 1
selector:
matchLabels:
app: nginx-ingress
tier: external
template:
metadata:
labels:
app: nginx-ingress
tier: external
annotations:
prometheus.io/port: '10254'
prometheus.io/scrape: 'true'
spec:
containers:
- name: nginx-ingress-controller-external
image: quay.io/kubernetes-ingress-controller/nginx-ingress-controller:0.19.0
args:
- /nginx-ingress-controller
- --default-backend-service=$(POD_NAMESPACE)/default-http-backend
- --configmap=$(POD_NAMESPACE)/nginx-configuration-external
- --tcp-services-configmap=$(POD_NAMESPACE)/tcp-services-external
- --udp-services-configmap=$(POD_NAMESPACE)/udp-services-external
- --publish-service=$(POD_NAMESPACE)/nginx-ingress-external
- --annotations-prefix=nginx.ingress.kubernetes.io
- --election-id=ingress-controller-leader-external
- --ingress-class=nginx-external
env:
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: POD_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
ports:
- name: http
containerPort: 80
- name: https
containerPort: 443
livenessProbe:
failureThreshold: 3
httpGet:
path: /healthz
port: 10254
scheme: HTTP
initialDelaySeconds: 10
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 1
readinessProbe:
failureThreshold: 3
httpGet:
path: /healthz
port: 10254
scheme: HTTP
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 1
securityContext:
runAsNonRoot: false
---
kind: Service
apiVersion: v1
metadata:
name: nginx-ingress-external
namespace: infra
labels:
app: nginx-ingress
tier: external
spec:
externalTrafficPolicy: Local
type: LoadBalancer
selector:
app: nginx-ingress
tier: external
ports:
- name: http
port: 80
targetPort: http
- name: https
port: 443
targetPort: https
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment