Skip to content

Instantly share code, notes, and snippets.

@brunokrebs
Last active December 12, 2018 18:17
Show Gist options
  • Save brunokrebs/5cd7922d39070bb35d4236ea667a9834 to your computer and use it in GitHub Desktop.
Save brunokrebs/5cd7922d39070bb35d4236ea667a9834 to your computer and use it in GitHub Desktop.
apiVersion: v1
kind: Service
metadata:
name: nginx-cluster-ip
spec:
ports:
- port: 80
protocol: TCP
targetPort: 80
selector:
app: nginx-deployment
type: ClusterIP
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-deployment
spec:
replicas: 2
selector:
matchLabels:
app: nginx-deployment
template:
metadata:
labels:
app: nginx-deployment
spec:
containers:
- name: nginx
image: nginx:1.7.9
ports:
- containerPort: 80
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: nginx-ingress
annotations:
nginx.ingress.kubernetes.io/rewrite-target: /
nginx.ingress.kubernetes.io/ssl-redirect: "false"
spec:
rules:
- http:
paths:
- path: /
backend:
serviceName: nginx-cluster-ip
servicePort: 80
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment