diff --git a/Chapter_Four/Lecture_4_Lab/myapp/ingress-blue.yaml b/Chapter_Four/Lecture_4_Lab/myapp/ingress-blue.yaml new file mode 100644 index 0000000..ba0b960 --- /dev/null +++ b/Chapter_Four/Lecture_4_Lab/myapp/ingress-blue.yaml @@ -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 + diff --git a/Chapter_Four/Lecture_4_Lab/myapp/ingress-green.yaml b/Chapter_Four/Lecture_4_Lab/myapp/ingress-green.yaml new file mode 100644 index 0000000..447cd54 --- /dev/null +++ b/Chapter_Four/Lecture_4_Lab/myapp/ingress-green.yaml @@ -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 + diff --git a/Chapter_Four/Lecture_4_Lab/myapp/myapp-blue.yaml b/Chapter_Four/Lecture_4_Lab/myapp/myapp-blue.yaml new file mode 100644 index 0000000..9cb9aa9 --- /dev/null +++ b/Chapter_Four/Lecture_4_Lab/myapp/myapp-blue.yaml @@ -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 + diff --git a/Chapter_Four/Lecture_4_Lab/myapp/myapp-green.yaml b/Chapter_Four/Lecture_4_Lab/myapp/myapp-green.yaml new file mode 100644 index 0000000..f3b9b2d --- /dev/null +++ b/Chapter_Four/Lecture_4_Lab/myapp/myapp-green.yaml @@ -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 + diff --git a/Chapter_Four/Lecture_4_Lab/myapp/myapp-service.yaml b/Chapter_Four/Lecture_4_Lab/myapp/myapp-service.yaml new file mode 100644 index 0000000..9ea2a2e --- /dev/null +++ b/Chapter_Four/Lecture_4_Lab/myapp/myapp-service.yaml @@ -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 +