Skip to content

Instantly share code, notes, and snippets.

@gokulchandra
Last active May 16, 2018 18:24
Show Gist options
  • Save gokulchandra/78b7f0bf0b3a3c9d4434138cd6c6d769 to your computer and use it in GitHub Desktop.
Save gokulchandra/78b7f0bf0b3a3c9d4434138cd6c6d769 to your computer and use it in GitHub Desktop.
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: nginx-ingress-controller
spec:
replicas: 1
revisionHistoryLimit: 3
template:
metadata:
labels:
k8s-app: nginx-ingress-lb
spec:
containers:
- args:
- /nginx-ingress-controller
- "--default-backend-service=$(POD_NAMESPACE)/default-http-backend"
- "--default-ssl-certificate=$(POD_NAMESPACE)/tls-certificate"
env:
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: POD_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
image: "gcr.io/google_containers/nginx-ingress-controller:0.9.0-beta.5"
imagePullPolicy: Always
livenessProbe:
httpGet:
path: /healthz
port: 10254
scheme: HTTP
initialDelaySeconds: 10
timeoutSeconds: 5
name: nginx-ingress-controller
ports:
- containerPort: 80
name: http
protocol: TCP
- containerPort: 443
name: https
protocol: TCP
volumeMounts:
- mountPath: /etc/nginx-ssl/dhparam
name: tls-dhparam-vol
terminationGracePeriodSeconds: 60
volumes:
- name: tls-dhparam-vol
secret:
secretName: tls-dhparam
---
apiVersion: v1
kind: Service
metadata:
name: nginx-ingress
spec:
type: LoadBalancer
ports:
- name: http
port: 80
targetPort: http
- name: https
port: 443
targetPort: https
selector:
k8s-app: nginx-ingress-lb
@pvsousalima
Copy link

pvsousalima commented Mar 2, 2018

Thanks for the files! Why are you using LoadBalancer as type? Aren't we supposed to configure only NodePort services and Ingress expose them already?

@kirkins
Copy link

kirkins commented May 16, 2018

@pvsousalima does it still work for you if you switch to type NodePort?

I'm having trouble with RBAC

https://stackoverflow.com/q/50377271/773263

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment