diff --git a/solution/day-1/step-3/hello-app-cm.yaml b/solution/day-1/step-3/hello-app-cm.yaml new file mode 100644 index 0000000000000000000000000000000000000000..12004af16a6e155dc9fd70f9a0b607a854919747 --- /dev/null +++ b/solution/day-1/step-3/hello-app-cm.yaml @@ -0,0 +1,6 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: hello-app-cm +data: + color: "#200" diff --git a/solution/day-1/step-3/hello-app-deployment-secret.yaml b/solution/day-1/step-3/hello-app-deployment-secret.yaml new file mode 100644 index 0000000000000000000000000000000000000000..8de00649552695f46ebfa9ed60ba56790379987d --- /dev/null +++ b/solution/day-1/step-3/hello-app-deployment-secret.yaml @@ -0,0 +1,41 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: hello-app-secret + labels: + app: hello-app +spec: + replicas: 3 + selector: + matchLabels: + app: hello-app + template: + metadata: + labels: + app: hello-app + spec: + imagePullSecrets: + - name: auth-master3-registry + containers: + - name: hello-app + image: registry.master3.takima.io/guide/kubernetes-resources/hello_world:latest + ports: + - containerPort: 3000 + env: + - name: K8S_NODE_NAME + valueFrom: + fieldRef: + fieldPath: spec.nodeName + - name: K8S_POD_NAME + valueFrom: + fieldRef: + fieldPath: metadata.name + - name: K8S_POD_IP + valueFrom: + fieldRef: + fieldPath: status.podIP + - name: CUSTOM_COLOR # Vrai key de la variable d'env. Peut être différent de la valeur dans le config map + valueFrom: + secretKeyRef: + name: hello-app-secret # Nom du configmap + key: color diff --git a/solution/day-1/step-3/hello-app-deployment.yaml b/solution/day-1/step-3/hello-app-deployment.yaml new file mode 100644 index 0000000000000000000000000000000000000000..cd938b7789a3622c32895589c85a6d36b57cd642 --- /dev/null +++ b/solution/day-1/step-3/hello-app-deployment.yaml @@ -0,0 +1,41 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: hello-app-deployment + labels: + app: hello-app +spec: + replicas: 3 + selector: + matchLabels: + app: hello-app + template: + metadata: + labels: + app: hello-app + spec: + imagePullSecrets: + - name: takima-school-registry + containers: + - name: hello-app + image: registry.gitlab.com/takima-school/images/simple-website:latest + ports: + - containerPort: 3000 + env: + - name: K8S_NODE_NAME + valueFrom: + fieldRef: + fieldPath: spec.nodeName + - name: K8S_POD_NAME + valueFrom: + fieldRef: + fieldPath: metadata.name + - name: K8S_POD_IP + valueFrom: + fieldRef: + fieldPath: status.podIP + - name: CUSTOM_COLOR # Vrai key de la variable d'env. Peut être différent de la valeur dans le config map + valueFrom: + configMapKeyRef: + name: hello-app-cm # Nom du configmap + key: color diff --git a/solution/day-1/step-3/hello-secret.yaml b/solution/day-1/step-3/hello-secret.yaml new file mode 100644 index 0000000000000000000000000000000000000000..7499207c5c2c413cfb9eb11fde7fda5e95bb1028 --- /dev/null +++ b/solution/day-1/step-3/hello-secret.yaml @@ -0,0 +1,7 @@ +apiVersion: v1 +kind: Secret +metadata: + name: hello-app-secret +type: Opaque +data: + color: IiMyMDAi