Skip to content

Instantly share code, notes, and snippets.

@michidk
Created September 20, 2018 09:01
Show Gist options
  • Save michidk/33f547808b4251401a2802590ce79134 to your computer and use it in GitHub Desktop.
Save michidk/33f547808b4251401a2802590ce79134 to your computer and use it in GitHub Desktop.
k8-nginx
apiVersion: apps/v1
kind: Deployment
metadata:
name: my-nginx
spec:
selector:
matchLabels:
run: my-nginx
replicas: 1
strategy:
type: Recreate
template:
metadata:
labels:
run: my-nginx
spec:
containers:
- name: my-nginx
image: nginx
ports:
- name: http
containerPort: 80
protocol: TCP
---
apiVersion: v1
kind: Service
metadata:
name: my-nginx
labels:
run: my-nginx
spec:
type: ClusterIP
ports:
- name: http
port: 80
protocol: TCP
targetPort: http
selector:
run: my-nginx
---
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: my-nginx
annotations:
kubernetes.io/ingress.class: traefik
spec:
rules:
- host: vps.brokenvector.com
http:
paths:
- backend:
serviceName: my-nginx
servicePort: 80
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment