Skip to content

Instantly share code, notes, and snippets.

@carldanley
Last active July 31, 2018 18:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save carldanley/5dd90124d465269920e4deb27a0ca9d1 to your computer and use it in GitHub Desktop.
Save carldanley/5dd90124d465269920e4deb27a0ca9d1 to your computer and use it in GitHub Desktop.
Intro to Kubernetes Ingress - July 31, 2018
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: hello-world
namespace: sfkm
annotations:
kubernetes.io/ingress.class: "nginx"
kubernetes.io/tls-acme: "true"
labels:
app: hello-world
spec:
rules:
- host: sfkm.carldanley.com
http:
paths:
- path: /
backend:
serviceName: hello-world
servicePort: 1337
tls:
- hosts:
- sfkm.carldanley.com
secretName: hello-world-tls
apiVersion: apps/v1
kind: Deployment
metadata:
name: my-app
namespace: sfkm
labels:
app: hello-world
spec:
replicas: 3
selector:
matchLabels:
app: hello-world
template:
metadata:
labels:
app: hello-world
spec:
containers:
- name: hello-world
image: tutum/hello-world
ports:
- containerPort: 80
docker run --rm -p 1337:80 tutum/hello-world
kind: Service
apiVersion: v1
metadata:
name: hello-world
namespace: sfkm
spec:
selector:
app: hello-world
ports:
- protocol: TCP
port: 1337
targetPort: 80
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment