From 79dde0487825e732f2299ab1afbf8e005b8e5b9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Blanc?= Date: Wed, 12 Apr 2023 10:52:48 +0200 Subject: [PATCH] othe changes --- .gitignore | 2 + README.md | 31 ++++++++++++++ .../devoxxfr23-v1-deployment-affinity.yml | 42 +++++++++++++++++++ .../devoxxfr23-v1-deployment-secrets.yml | 42 +++++++++++++++++++ .../devoxxfr23-v1-deployment-toleration.yml | 38 +++++++++++++++++ my.propreties | 1 + 6 files changed, 156 insertions(+) create mode 100644 .gitignore create mode 100644 manifests/devoxxfr23-v1-deployment-affinity.yml create mode 100644 manifests/devoxxfr23-v1-deployment-secrets.yml create mode 100644 manifests/devoxxfr23-v1-deployment-toleration.yml create mode 100644 my.propreties diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e0adba3 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ + +.odo \ No newline at end of file diff --git a/README.md b/README.md index d28fe0e..f8a655a 100644 --- a/README.md +++ b/README.md @@ -153,3 +153,34 @@ selector: Save and exit. +## ConfigMap + +`kubectl set env deployment/devoxxfr23-v2 GREETING=hola` + +`kubectl create cm my-config --from-env-file=my.properties` + +`kubectl apply -f manifests/devoxxfr23-v1-deployment-configmap` + +## Secret + +`kubectl create secret generic mysecret --from-literal=user='MyUserName' --from-literal=password='mypassword'` + +`kubectl get secret mysecret -o yaml` + +`kubectl replace -f manifests/devoxxfr23-v1-deployment-secrets.yml` + +## Taint + +`kubectl describe nodes | egrep "Name:|Taints:"` + +`kubectl taint nodes --all=true color=blue:NoSchedule` + +`kubectl taint node devnation-m02 color:NoSchedule- ` + +`kubectl taint nodes --all=true color=blue:NoSchedule --overwrite` + +`kubectl label nodes devnation-m02 color=blue ` + + + + diff --git a/manifests/devoxxfr23-v1-deployment-affinity.yml b/manifests/devoxxfr23-v1-deployment-affinity.yml new file mode 100644 index 0000000..8ed63be --- /dev/null +++ b/manifests/devoxxfr23-v1-deployment-affinity.yml @@ -0,0 +1,42 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + labels: + app.kubernetes.io/name: devoxxfr23 + name: devoxxfr23 +spec: + replicas: 1 + selector: + matchLabels: + app.kubernetes.io/name: devoxxfr23 + app.kubernetes.io/version: "1.0" + template: + metadata: + labels: + app.kubernetes.io/name: devoxxfr23 + app.kubernetes.io/version: "1.0" + spec: + affinity: + nodeAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + nodeSelectorTerms: + - matchExpressions: + - key: color + operator: In + values: + - blue + containers: + - image: sebi2706/devoxxfr23:1.0 + imagePullPolicy: Always + name: devoxxfr23 + ports: + - containerPort: 8080 + name: http + protocol: TCP + resources: + requests: + memory: "300Mi" + cpu: "750m" # 10 cores + limits: + memory: "500Mi" + cpu: "1000m" diff --git a/manifests/devoxxfr23-v1-deployment-secrets.yml b/manifests/devoxxfr23-v1-deployment-secrets.yml new file mode 100644 index 0000000..197c285 --- /dev/null +++ b/manifests/devoxxfr23-v1-deployment-secrets.yml @@ -0,0 +1,42 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + labels: + app.kubernetes.io/name: devoxxfr23 + name: devoxxfr23 +spec: + replicas: 1 + selector: + matchLabels: + app.kubernetes.io/name: devoxxfr23 + app.kubernetes.io/version: "1.0" + template: + metadata: + labels: + app.kubernetes.io/name: devoxxfr23 + app.kubernetes.io/version: "1.0" + spec: + containers: + - image: sebi2706/devoxxfr23:1.0 + imagePullPolicy: Always + name: devoxxfr23 + ports: + - containerPort: 8080 + name: http + protocol: TCP + resources: + requests: + memory: "300Mi" + cpu: "750m" # 10 cores + limits: + memory: "500Mi" + cpu: "1000m" + volumeMounts: + - name: mysecretvolume + mountPath: /mystuff/secretstuff + readOnly: true + volumes: + - name: mysecretvolume + secret: + secretName: mysecret + diff --git a/manifests/devoxxfr23-v1-deployment-toleration.yml b/manifests/devoxxfr23-v1-deployment-toleration.yml new file mode 100644 index 0000000..033bad7 --- /dev/null +++ b/manifests/devoxxfr23-v1-deployment-toleration.yml @@ -0,0 +1,38 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + labels: + app.kubernetes.io/name: devoxxfr23 + name: devoxxfr23 +spec: + replicas: 1 + selector: + matchLabels: + app.kubernetes.io/name: devoxxfr23 + app.kubernetes.io/version: "1.0" + template: + metadata: + labels: + app.kubernetes.io/name: devoxxfr23 + app.kubernetes.io/version: "1.0" + spec: + tolerations: + - key: "color" + operator: "Equal" + value: "blue" + effect: "NoSchedule" + containers: + - image: sebi2706/devoxxfr23:1.0 + imagePullPolicy: Always + name: devoxxfr23 + ports: + - containerPort: 8080 + name: http + protocol: TCP + resources: + requests: + memory: "300Mi" + cpu: "750m" # 10 cores + limits: + memory: "500Mi" + cpu: "1000m" diff --git a/my.propreties b/my.propreties new file mode 100644 index 0000000..fa465d8 --- /dev/null +++ b/my.propreties @@ -0,0 +1 @@ +GREETING=halloooo