From 74e07b97adeba32c0b3f11c9899d945993279bb1 Mon Sep 17 00:00:00 2001 From: allen13 Date: Wed, 3 Mar 2021 18:22:27 -0600 Subject: [PATCH] filled in example from class --- buildconfig.yml | 2 +- deployment.yml | 24 ++++++++++++++++++------ pod.yml | 10 +++++----- route.yml | 10 +++++----- svc.yml | 12 ++++++------ 5 files changed, 35 insertions(+), 23 deletions(-) diff --git a/buildconfig.yml b/buildconfig.yml index 4eb2673..77de711 100644 --- a/buildconfig.yml +++ b/buildconfig.yml @@ -20,7 +20,7 @@ spec: source: type: Git git: - uri: + uri: https://github.com/allen13/hello-openshift.git --- diff --git a/deployment.yml b/deployment.yml index e7c83ac..32512b1 100644 --- a/deployment.yml +++ b/deployment.yml @@ -1,17 +1,29 @@ apiVersion: apps/v1 kind: Deployment metadata: - name: + name: hello-openshift labels: - app: + app: hello-openshift spec: - replicas: + replicas: 3 selector: matchLabels: - app: + app: hello-openshift template: metadata: labels: - app: + app: hello-openshift spec: - containers: \ No newline at end of file + containers: + - name: hello-openshift + image: image-registry.openshift-image-registry.svc:5000/timothya/hello-openshift + env: + # learn about the downward api https://kubernetes.io/docs/tasks/inject-data-application/environment-variable-expose-pod-information/#the-downward-api + - name: HELLO + valueFrom: + fieldRef: + fieldPath: metadata.name + ports: + - name: web + containerPort: 8090 + protocol: TCP \ No newline at end of file diff --git a/pod.yml b/pod.yml index 995f2b2..c0c8e84 100644 --- a/pod.yml +++ b/pod.yml @@ -1,13 +1,13 @@ apiVersion: v1 kind: Pod metadata: - name: + name: hello-openshift labels: - app: + app: hello-openshift spec: containers: - - name: - image: image-registry.openshift-image-registry.svc:5000//hello-openshift + - name: hello-openshift + image: image-registry.openshift-image-registry.svc:5000/timothya/hello-openshift env: # learn about the downward api https://kubernetes.io/docs/tasks/inject-data-application/environment-variable-expose-pod-information/#the-downward-api - name: HELLO @@ -16,5 +16,5 @@ spec: fieldPath: metadata.name ports: - name: web - containerPort: + containerPort: 8090 protocol: TCP \ No newline at end of file diff --git a/route.yml b/route.yml index 2ac4ea1..4ff41cb 100644 --- a/route.yml +++ b/route.yml @@ -2,15 +2,15 @@ apiVersion: route.openshift.io/v1 kind: Route metadata: labels: - app: - name: + app: hello-openshift + name: hello-openshift spec: port: targetPort: web to: - kind: - name: + kind: Service + name: hello-openshift weight: 100 tls: - termination: + termination: edge wildcardPolicy: None diff --git a/svc.yml b/svc.yml index 33d7b70..c88bba7 100644 --- a/svc.yml +++ b/svc.yml @@ -2,19 +2,19 @@ apiVersion: v1 kind: Service metadata: labels: - app: - name: + app: hello-openshift + name: hello-openshift spec: ports: - name: web - port: + port: 8080 protocol: TCP - targetPort: + targetPort: web selector: - app: + app: hello-openshift sessionAffinity: None #Pick from below - type: + type: ClusterIP # Types of Kubernetes services # There are four types of Kubernetes services: