Skip to content
Snippets Groups Projects
Commit 219814de authored by Bot's avatar Bot Committed by TakiBot
Browse files

Added solution for day-1 - step-3

parent fcc4142e
No related branches found
No related tags found
No related merge requests found
Pipeline #95774 canceled
apiVersion: v1
kind: ConfigMap
metadata:
name: hello-app-cm
data:
color: "#200"
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
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
apiVersion: v1
kind: Secret
metadata:
name: hello-app-secret
type: Opaque
data:
color: IiMyMDAi
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment