Skip to content

Commit

Permalink
Add Chapter 4 Lecture 4 files
Browse files Browse the repository at this point in the history
  • Loading branch information
timhberry committed Aug 27, 2019
1 parent 9ebe6e4 commit 68d7ef9
Show file tree
Hide file tree
Showing 5 changed files with 110 additions and 0 deletions.
18 changes: 18 additions & 0 deletions Chapter_Four/Lecture_4_Lab/myapp/ingress-blue.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: blue-ingress
annotations:
kubernetes.io/ingress.class: nginx
nginx.ingress.kubernetes.io/ssl-redirect: "false"
nginx.ingress.kubernetes.io/rewrite-target: /
spec:
rules:
- host: myapp.example.com
http:
paths:
- path: /blue
backend:
serviceName: myapp-blue-service
servicePort: 80

18 changes: 18 additions & 0 deletions Chapter_Four/Lecture_4_Lab/myapp/ingress-green.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: green-ingress
annotations:
kubernetes.io/ingress.class: nginx
nginx.ingress.kubernetes.io/ssl-redirect: "false"
nginx.ingress.kubernetes.io/rewrite-target: /
spec:
rules:
- host: myapp.example.com
http:
paths:
- path: /green
backend:
serviceName: myapp-green-service
servicePort: 80

24 changes: 24 additions & 0 deletions Chapter_Four/Lecture_4_Lab/myapp/myapp-blue.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: myapp-blue
labels:
app: myapp
spec:
replicas: 3
selector:
matchLabels:
app: myapp
version: blue
template:
metadata:
labels:
app: myapp
version: blue
spec:
containers:
- name: myapp
image: gcr.io/tim-acloud-guru/myapp:blue
ports:
- containerPort: 8888

24 changes: 24 additions & 0 deletions Chapter_Four/Lecture_4_Lab/myapp/myapp-green.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: myapp-green
labels:
app: myapp
spec:
replicas: 3
selector:
matchLabels:
app: myapp
version: green
template:
metadata:
labels:
app: myapp
version: green
spec:
containers:
- name: myapp
image: gcr.io/tim-acloud-guru/myapp:green
ports:
- containerPort: 8888

26 changes: 26 additions & 0 deletions Chapter_Four/Lecture_4_Lab/myapp/myapp-service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
apiVersion: v1
kind: Service
metadata:
name: myapp-blue-service
spec:
selector:
app: myapp
version: blue
ports:
- protocol: TCP
port: 80
targetPort: 8888
---
apiVersion: v1
kind: Service
metadata:
name: myapp-green-service
spec:
selector:
app: myapp
version: green
ports:
- protocol: TCP
port: 80
targetPort: 8888

0 comments on commit 68d7ef9

Please sign in to comment.