From eb79c8a8817a706db6019c1abd94ebcf3575f140 Mon Sep 17 00:00:00 2001 From: jumbo4git Date: Thu, 7 Dec 2023 11:33:17 -0500 Subject: [PATCH 1/6] Added new yaml files --- App/v1/Dockerfile | 2 +- Deployments/deploy-complete.yml | 2 +- Deployments/deploy.yml | 2 +- Deployments/deployment-label.yml | 22 ++++++++++++++++++ Deployments/deployment.yml | 24 ++++++++++++++++++++ Deployments/deployment2.yml | 20 +++++++++++++++++ Deployments/deployment3.yml | 20 +++++++++++++++++ Deployments/kind-3workers.yml | 9 ++++++++ Pods/PodsToNodes.yml | 13 +++++++++++ Pods/container-probes-startup.yml | 37 +++++++++++++++++++++++++++++++ Pods/init-containers.yml | 15 +++++++++++++ Pods/mypod.yml | 15 +++++++++++++ Pods/newPod.yml | 21 ++++++++++++++++++ Pods/newPod2.yml | 23 +++++++++++++++++++ Pods/pod-restart-policy.yml | 20 +++++++++++++++++ Pods/pod.yml | 4 ++-- Pods/pod2.yml | 13 +++++++++++ Services/service.yml | 13 +++++++++++ Services/service2.yml | 14 ++++++++++++ 19 files changed, 284 insertions(+), 5 deletions(-) create mode 100644 Deployments/deployment-label.yml create mode 100644 Deployments/deployment.yml create mode 100644 Deployments/deployment2.yml create mode 100644 Deployments/deployment3.yml create mode 100644 Deployments/kind-3workers.yml create mode 100644 Pods/PodsToNodes.yml create mode 100644 Pods/container-probes-startup.yml create mode 100644 Pods/init-containers.yml create mode 100644 Pods/mypod.yml create mode 100644 Pods/newPod.yml create mode 100644 Pods/newPod2.yml create mode 100644 Pods/pod-restart-policy.yml create mode 100644 Pods/pod2.yml create mode 100644 Services/service.yml create mode 100644 Services/service2.yml diff --git a/App/v1/Dockerfile b/App/v1/Dockerfile index 6b23026..5849cb7 100644 --- a/App/v1/Dockerfile +++ b/App/v1/Dockerfile @@ -1,6 +1,6 @@ FROM node:current-slim -LABEL MAINTAINER=nigelpoulton@hotmail.com +LABEL MAINTAINER=hnguyenva60@@gmail.com # Copy source code to /src in container COPY . /src diff --git a/Deployments/deploy-complete.yml b/Deployments/deploy-complete.yml index ac3ba08..6d39160 100644 --- a/Deployments/deploy-complete.yml +++ b/Deployments/deploy-complete.yml @@ -9,7 +9,7 @@ spec: selector: matchLabels: app: web - replicas: 5 + replicas: 3 minReadySeconds: 5 strategy: type: RollingUpdate diff --git a/Deployments/deploy.yml b/Deployments/deploy.yml index af2b037..f515dcc 100644 --- a/Deployments/deploy.yml +++ b/Deployments/deploy.yml @@ -6,7 +6,7 @@ metadata: labels: app: web spec: - replicas: 5 + replicas: 3 selector: matchLabels: app: web diff --git a/Deployments/deployment-label.yml b/Deployments/deployment-label.yml new file mode 100644 index 0000000..453ad47 --- /dev/null +++ b/Deployments/deployment-label.yml @@ -0,0 +1,22 @@ +# Simple deployment used to deploy and manage the app in nigelpoulton/getting-started-k8s:1.0 +apiVersion: apps/v1 +kind: Deployment +metadata: + name: hello-world + labels: + app: hello-world +spec: + replicas: 5 + selector: + matchLabels: + app: hello-world + template: + metadata: + labels: + app: hello-world + spec: + containers: + - name: hello-world + image: gcr.io/google-samples/hello-app:1.0 + ports: + - containerPort: 8080 \ No newline at end of file diff --git a/Deployments/deployment.yml b/Deployments/deployment.yml new file mode 100644 index 0000000..5eacfb2 --- /dev/null +++ b/Deployments/deployment.yml @@ -0,0 +1,24 @@ +# Simple deployment used to deploy and manage the app in nigelpoulton/getting-started-k8s:1.0 +apiVersion: apps/v1 +kind: Pod +metadata: + name: web-deploy + labels: + app: web +spec: + replicas: 3 + selector: + matchLabels: + app: web + template: + metadata: + labels: + app: web + spec: + terminationGracePeriodSeconds: 1 + containers: + - name: hello-pod + image: nigelpoulton/getting-started-k8s:1.0 + imagePullPolicy: Always + ports: + - containerPort: 8080 \ No newline at end of file diff --git a/Deployments/deployment2.yml b/Deployments/deployment2.yml new file mode 100644 index 0000000..41e388a --- /dev/null +++ b/Deployments/deployment2.yml @@ -0,0 +1,20 @@ +# Hoang deployment version 2 on 12/06/2023 +apiVersion: apps/v1 +kind: Deployment +metadata: + name: hello-world +spec: + replicas: 10 + selector: + matchLabels: + app: hello-world + template: + metadata: + labels: + app: hello-world + spec: + containers: + - name: hello-world + image: gcr.io/google-samples/hello-app:1.0 + ports: + - containerPort: 8080 diff --git a/Deployments/deployment3.yml b/Deployments/deployment3.yml new file mode 100644 index 0000000..17cd5be --- /dev/null +++ b/Deployments/deployment3.yml @@ -0,0 +1,20 @@ +# Hoang deployment version 2 on 12/06/2023 +apiVersion: apps/v1 +kind: Deployment +metadata: + name: hello-world +spec: + replicas: 10 + selector: + matchLabels: + app: hello-world + template: + metadata: + labels: + app: hello-world + spec: + containers: + - name: hello-world + image: gcr.io/google-samples/hello-app:2.0 + ports: + - containerPort: 8080 diff --git a/Deployments/kind-3workers.yml b/Deployments/kind-3workers.yml new file mode 100644 index 0000000..d53e3c1 --- /dev/null +++ b/Deployments/kind-3workers.yml @@ -0,0 +1,9 @@ +# three node (two workers) cluster config +kind: Cluster +apiVersion: kind.x-k8s.io/v1alpha4 +nodes: + - role: control-plane + - role: control-plane + - role: worker + - role: worker + - role: worker diff --git a/Pods/PodsToNodes.yml b/Pods/PodsToNodes.yml new file mode 100644 index 0000000..cc87fb9 --- /dev/null +++ b/Pods/PodsToNodes.yml @@ -0,0 +1,13 @@ +# Simple Kubernetes to deploy Pod +apiVersion: v1 +kind: Pod +metadata: + name: nginx-pod-ssd +spec: + containers: + - name: nginx + image: nginx + ports: + - containerPort: 80 + nodeSelector: + disk: local_ssd diff --git a/Pods/container-probes-startup.yml b/Pods/container-probes-startup.yml new file mode 100644 index 0000000..8daefcc --- /dev/null +++ b/Pods/container-probes-startup.yml @@ -0,0 +1,37 @@ +apiVersion: v1 +kind: Deployment +metadata: + name: hello-world +spec: + replicas: 1 + selector: + matchLabels: + app: hello-world + template: + metadata: + labels: + app: hello-world + spec: + containers: + - name: hello-world + image: gcr.io/google-samples/hello-app:1.0 + ports: + - containerPort: 8080 + startupProbe: + tcpSocket: + port: 8081 + initialDeplaySeconds: 10 + periodSeconds: 5 + failureThreshold: 1 + livenessProbe: + tcpSocket: + port: 8080 + initialDelaySeconds: 10 + periodSeconds: 5 + readinessProbe: + httpGet: + path: / + port: 8080 + initialDelaySeconds: 10 + periodSeconds: 5 + diff --git a/Pods/init-containers.yml b/Pods/init-containers.yml new file mode 100644 index 0000000..47e99be --- /dev/null +++ b/Pods/init-containers.yml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Pod +metadata: + name: init-containers +spec: + initContainers: + - name: init-service + image: ubuntu + command: ['sh', '-c', "echo waiting for service; sleep 2"] + - name: init-database + image: ubuntu + command: ['sh', '-c', "echo waiting for database; sleep 2"] + containers: + - name: app-container + image: nginx \ No newline at end of file diff --git a/Pods/mypod.yml b/Pods/mypod.yml new file mode 100644 index 0000000..54aad27 --- /dev/null +++ b/Pods/mypod.yml @@ -0,0 +1,15 @@ +# Simple Kubernetes Pod to deploy the app contained in nigelpoulton/getting-started-k8s:1.0 +apiVersion: v1 +kind: Pod +metadata: + creationTimestamp: null + labels: + run: hello-world + name: hello-world +spec: + containers: + - image: nigelpoulton/getting-started-k8s:1.0 + name: hello-world + ports: + - containerPort: 8080 + resources: {} diff --git a/Pods/newPod.yml b/Pods/newPod.yml new file mode 100644 index 0000000..cc9ec48 --- /dev/null +++ b/Pods/newPod.yml @@ -0,0 +1,21 @@ +# new created by Hoang 12/01/2023 +apiVersion: apps/v1 +kind: Deployment +metadata: + name: hello-world +spec: + replicas: 5 + selector: + matchLabels: + app: hello-world + template: + metadata: + labels: + app: hello-world + spec: + containers: + - name: hello-world + image: gcr.io/google-samples/hello-app:1.0 + ports: + - containerPort: 8080 + diff --git a/Pods/newPod2.yml b/Pods/newPod2.yml new file mode 100644 index 0000000..5e4f9ed --- /dev/null +++ b/Pods/newPod2.yml @@ -0,0 +1,23 @@ +# new created by Hoang 12/01/2023 +apiVersion: apps/v1 +kind: Deployment +metadata: + name: hello-world +spec: + replicas: 5 + selector: + matchExpressions: + - key: app + operator: In + values: + - hello-world-pod-me + template: + metadata: + labels: + app: hello-world-pod-me + spec: + containers: + - name: hello-world + image: gcr.io/google-samples/hello-app:1.0 + ports: + - containerPort: 8080 \ No newline at end of file diff --git a/Pods/pod-restart-policy.yml b/Pods/pod-restart-policy.yml new file mode 100644 index 0000000..8b507e8 --- /dev/null +++ b/Pods/pod-restart-policy.yml @@ -0,0 +1,20 @@ +# Testing Pod life cycle 2 +apiVersion: v1 +kind: Pod +metadata: + name: hello-world-onfailure-pod +spec: + containers: + - name: hello-world + image: gcr.io/google-samples/hello-app:1.0 + restartPolicy: OnFailure +apiVersion: v1 +kind: Pod +metadata: + name: hello-world-never-pod +spec: + containers: + - name: hello-world + image: gcr.io/google-samples/hello-app:1.0 + restartPolicy: Never + diff --git a/Pods/pod.yml b/Pods/pod.yml index b1f4e31..d4cda69 100644 --- a/Pods/pod.yml +++ b/Pods/pod.yml @@ -1,8 +1,8 @@ -# Simple Kubernetes Pod to deploy the app contained in nigelpoulton/getting-started-k8s:1.0 +# testing Pod life cycle apiVersion: v1 kind: Pod metadata: - name: hello-pod + name: hello-world labels: app: web spec: diff --git a/Pods/pod2.yml b/Pods/pod2.yml new file mode 100644 index 0000000..54bf57b --- /dev/null +++ b/Pods/pod2.yml @@ -0,0 +1,13 @@ +# Testing Pod life cycle +apiVersion: v1 +kind: Pod +metadata: + name: hello-world + labels: + app: hello-world +spec: + containers: + - name: hello-world + image: gcr.io/google-samples/hello-app:1.0 + ports: + - containerPort: 8080 \ No newline at end of file diff --git a/Services/service.yml b/Services/service.yml new file mode 100644 index 0000000..471b5db --- /dev/null +++ b/Services/service.yml @@ -0,0 +1,13 @@ +# LoadBalancer Service. Will only work on supported cloud platforms (AKS, EKS, GKE, DOK, IBM, LKE etc...) +# Listens externally on 80 and forwards to Pod/container on 8080 +apiVersion: v1 +kind: Service +metadata: + name: hello-world +spec: + ports: + - port: 80 + protocol: TCP + targetPort: 8080 + selector: + app: hello-world diff --git a/Services/service2.yml b/Services/service2.yml new file mode 100644 index 0000000..202e012 --- /dev/null +++ b/Services/service2.yml @@ -0,0 +1,14 @@ +# +# Listens externally on 80 and forwards to Pod/container on 8080 +apiVersion: v1 +kind: Service +metadata: + name: hello-world +spec: + selector: + app: hello-world + ports: + - port: 80 + protocol: TCP + targetPort: 8080 + From ad4d20a5d4ff5903de64735ff757044fc76b1de1 Mon Sep 17 00:00:00 2001 From: jumbo4git Date: Thu, 7 Dec 2023 15:49:32 -0500 Subject: [PATCH 2/6] Added new yaml files --- Deployments/deployment-rolling.yml | 0 Deployments/deployment.20replicas.yml | 19 ++++++++++++++++ Deployments/deployment.broken.yml | 20 +++++++++++++++++ Deployments/deployment.probes-1.yml | 31 +++++++++++++++++++++++++++ Deployments/deployment.probes-2.yml | 31 +++++++++++++++++++++++++++ Deployments/deployment.probes-3.yml | 31 +++++++++++++++++++++++++++ Deployments/deployment2.yml | 1 - 7 files changed, 132 insertions(+), 1 deletion(-) create mode 100644 Deployments/deployment-rolling.yml create mode 100644 Deployments/deployment.20replicas.yml create mode 100644 Deployments/deployment.broken.yml create mode 100644 Deployments/deployment.probes-1.yml create mode 100644 Deployments/deployment.probes-2.yml create mode 100644 Deployments/deployment.probes-3.yml diff --git a/Deployments/deployment-rolling.yml b/Deployments/deployment-rolling.yml new file mode 100644 index 0000000..e69de29 diff --git a/Deployments/deployment.20replicas.yml b/Deployments/deployment.20replicas.yml new file mode 100644 index 0000000..f34a3ee --- /dev/null +++ b/Deployments/deployment.20replicas.yml @@ -0,0 +1,19 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: hello-world +spec: + replicas: 20 + selector: + matchLabels: + app: hello-world + template: + metadata: + labels: + app: hello-world + spec: + containers: + - name: hello-world + image: gcr.io/google-samples/hello-app:1.0 + ports: + - containerPort: 8080 diff --git a/Deployments/deployment.broken.yml b/Deployments/deployment.broken.yml new file mode 100644 index 0000000..9425554 --- /dev/null +++ b/Deployments/deployment.broken.yml @@ -0,0 +1,20 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: hello-world +spec: + progressDeadlineSeconds: 10 + replicas: 10 + selector: + matchLabels: + app: hello-world + template: + metadata: + labels: + app: hello-world + spec: + containers: + - name: hello-pod + image: gcr.io/google-samples/hello-app:2.0 + ports: + - containerPort: 8080 \ No newline at end of file diff --git a/Deployments/deployment.probes-1.yml b/Deployments/deployment.probes-1.yml new file mode 100644 index 0000000..36bb8e4 --- /dev/null +++ b/Deployments/deployment.probes-1.yml @@ -0,0 +1,31 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: hello-world +spec: + replicas: 20 + strategy: + type: RollingUpdate + rollingUpdate: + maxUnavailable: 10% + maxSurge: 2 + revisionHistoryLimit: 20 + selector: + matchLabels: + app: hello-world + template: + metadata: + labels: + app: hello-world + spec: + containers: + - name: hello-world + image: gcr.io/google-samples/hello-app:1.0 + ports: + - containerPort: 8080 + readinessProbe: + httpGet: + path: /index.html + port: 8080 + initialDelaySeconds: 10 + periodSeconds: 10 diff --git a/Deployments/deployment.probes-2.yml b/Deployments/deployment.probes-2.yml new file mode 100644 index 0000000..c01516d --- /dev/null +++ b/Deployments/deployment.probes-2.yml @@ -0,0 +1,31 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: hello-world +spec: + replicas: 20 + strategy: + type: RollingUpdate + rollingUpdate: + maxUnavailable: 10% + maxSurge: 2 + revisionHistoryLimit: 20 + selector: + matchLabels: + app: hello-world + template: + metadata: + labels: + app: hello-world + spec: + containers: + - name: hello-world + image: gcr.io/google-samples/hello-app:2.0 + ports: + - containerPort: 8080 + readinessProbe: + httpGet: + path: /index.html + port: 8080 + initialDelaySeconds: 10 + periodSeconds: 10 diff --git a/Deployments/deployment.probes-3.yml b/Deployments/deployment.probes-3.yml new file mode 100644 index 0000000..d4c04b0 --- /dev/null +++ b/Deployments/deployment.probes-3.yml @@ -0,0 +1,31 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: hello-world +spec: + replicas: 20 + strategy: + type: RollingUpdate + rollingUpdate: + maxUnavailable: 10% + maxSurge: 2 + revisionHistoryLimit: 20 + selector: + matchLabels: + app: hello-world + template: + metadata: + labels: + app: hello-world + spec: + containers: + - name: hello-world + image: gcr.io/google-samples/hello-app:2.0 + ports: + - containerPort: 8080 + readinessProbe: + httpGet: + path: /index.html + port: 8081 + initialDelaySeconds: 10 + periodSeconds: 10 diff --git a/Deployments/deployment2.yml b/Deployments/deployment2.yml index 41e388a..3321822 100644 --- a/Deployments/deployment2.yml +++ b/Deployments/deployment2.yml @@ -1,4 +1,3 @@ -# Hoang deployment version 2 on 12/06/2023 apiVersion: apps/v1 kind: Deployment metadata: From ef20057c7105970c114858a9bc75d0253f9f7c56 Mon Sep 17 00:00:00 2001 From: jumbo4git Date: Mon, 11 Dec 2023 13:02:02 -0500 Subject: [PATCH 3/6] add my new files --- Deployments/CoreDNSConfigCustom.yml | 26 ++ Deployments/ParallelJob.yml | 17 + Deployments/deployNginx.yml | 21 ++ Deployments/deployUbuntu.yml | 15 + Deployments/deployment-old.yml | 24 ++ Deployments/deployment-rolling.yml | 20 ++ Deployments/deployment.yml | 21 +- Deployments/deployment2.yml | 3 +- ...ment.broken.yml => deployment3.broken.yml} | 2 +- Deployments/deployment3.yml | 20 -- Deployments/job-failure-OnFailure.yml | 16 + Deployments/linux-ubuntu-deploy.yml | 22 ++ recommended.yaml | 303 ++++++++++++++++++ 13 files changed, 475 insertions(+), 35 deletions(-) create mode 100644 Deployments/CoreDNSConfigCustom.yml create mode 100644 Deployments/ParallelJob.yml create mode 100644 Deployments/deployNginx.yml create mode 100644 Deployments/deployUbuntu.yml create mode 100644 Deployments/deployment-old.yml rename Deployments/{deployment.broken.yml => deployment3.broken.yml} (86%) delete mode 100644 Deployments/deployment3.yml create mode 100644 Deployments/job-failure-OnFailure.yml create mode 100644 Deployments/linux-ubuntu-deploy.yml create mode 100644 recommended.yaml diff --git a/Deployments/CoreDNSConfigCustom.yml b/Deployments/CoreDNSConfigCustom.yml new file mode 100644 index 0000000..ab0cc1b --- /dev/null +++ b/Deployments/CoreDNSConfigCustom.yml @@ -0,0 +1,26 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: coredns + namespace: kube-system +data: + Corefile: | + .:53 { + errors + health + ready + kubernetes cluster.local in-addr.arpa ip6.arpa { + pod insecure + fallthrough in-addr.arpa ip6.arpa + ttl 30 + } + prometheus :9153 + forward . 1.1.1.1 + cache 30 + loop + reload + loadbalance + } + centinosystems.com { + forward . 9.9.9.9 + } \ No newline at end of file diff --git a/Deployments/ParallelJob.yml b/Deployments/ParallelJob.yml new file mode 100644 index 0000000..c80f657 --- /dev/null +++ b/Deployments/ParallelJob.yml @@ -0,0 +1,17 @@ +apiVersion: batch/v1 +kind: Job +metadata: + name: hello-world-job-parallel +spec: + completions: 50 + parallelism: 10 + template: + spec: + containers: + - name: ubuntu + image: ubuntu + command: + - "/bin/bash" + - "-c" + - "/bin/echo Hello from Pod %(hostname) at $(date)" + restartPolicy: Never \ No newline at end of file diff --git a/Deployments/deployNginx.yml b/Deployments/deployNginx.yml new file mode 100644 index 0000000..d2bc980 --- /dev/null +++ b/Deployments/deployNginx.yml @@ -0,0 +1,21 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: nginx-deployment + labels: + app: nginx +spec: + replicas: 3 + selector: + matchLabels: + app: nginx + template: + metadata: + labels: + app: nginx + spec: + containers: + - name: nginx + image: nginx:1.14.2 + ports: + - containerPort: 8080 \ No newline at end of file diff --git a/Deployments/deployUbuntu.yml b/Deployments/deployUbuntu.yml new file mode 100644 index 0000000..ced8dd7 --- /dev/null +++ b/Deployments/deployUbuntu.yml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Pod +metadata: + name: ubuntu + labels: + app: ubuntu +spec: + containers: + - image: ubuntu + command: + - "sleep" + - "604800" + imagePullPolicy: IfNotPresent + name: ubuntu + restartPolicy: Always \ No newline at end of file diff --git a/Deployments/deployment-old.yml b/Deployments/deployment-old.yml new file mode 100644 index 0000000..5eacfb2 --- /dev/null +++ b/Deployments/deployment-old.yml @@ -0,0 +1,24 @@ +# Simple deployment used to deploy and manage the app in nigelpoulton/getting-started-k8s:1.0 +apiVersion: apps/v1 +kind: Pod +metadata: + name: web-deploy + labels: + app: web +spec: + replicas: 3 + selector: + matchLabels: + app: web + template: + metadata: + labels: + app: web + spec: + terminationGracePeriodSeconds: 1 + containers: + - name: hello-pod + image: nigelpoulton/getting-started-k8s:1.0 + imagePullPolicy: Always + ports: + - containerPort: 8080 \ No newline at end of file diff --git a/Deployments/deployment-rolling.yml b/Deployments/deployment-rolling.yml index e69de29..7579095 100644 --- a/Deployments/deployment-rolling.yml +++ b/Deployments/deployment-rolling.yml @@ -0,0 +1,20 @@ +# Hoang deployment rolling version 2 on 12/07/2023 +apiVersion: apps/v1 +kind: Deployment +metadata: + name: hello-world +spec: + replicas: 20 + selector: + matchLabels: + app: hello-world + template: + metadata: + labels: + app: hello-world + spec: + containers: + - name: hello-world + image: gcr.io/google-samples/hello-app:1.0 + ports: + - containerPort: 8080 diff --git a/Deployments/deployment.yml b/Deployments/deployment.yml index 5eacfb2..d791b2c 100644 --- a/Deployments/deployment.yml +++ b/Deployments/deployment.yml @@ -1,24 +1,19 @@ -# Simple deployment used to deploy and manage the app in nigelpoulton/getting-started-k8s:1.0 apiVersion: apps/v1 -kind: Pod +kind: Deployment metadata: - name: web-deploy - labels: - app: web + name: hello-world spec: - replicas: 3 + replicas: 10 selector: matchLabels: - app: web + app: hello-world template: metadata: labels: - app: web - spec: - terminationGracePeriodSeconds: 1 + app: hello-world + spec: containers: - - name: hello-pod - image: nigelpoulton/getting-started-k8s:1.0 - imagePullPolicy: Always + - name: hello-world + image: gcr.io/google-samples/hello-app:1.0 ports: - containerPort: 8080 \ No newline at end of file diff --git a/Deployments/deployment2.yml b/Deployments/deployment2.yml index 3321822..17cd5be 100644 --- a/Deployments/deployment2.yml +++ b/Deployments/deployment2.yml @@ -1,3 +1,4 @@ +# Hoang deployment version 2 on 12/06/2023 apiVersion: apps/v1 kind: Deployment metadata: @@ -14,6 +15,6 @@ spec: spec: containers: - name: hello-world - image: gcr.io/google-samples/hello-app:1.0 + image: gcr.io/google-samples/hello-app:2.0 ports: - containerPort: 8080 diff --git a/Deployments/deployment.broken.yml b/Deployments/deployment3.broken.yml similarity index 86% rename from Deployments/deployment.broken.yml rename to Deployments/deployment3.broken.yml index 9425554..9b9d808 100644 --- a/Deployments/deployment.broken.yml +++ b/Deployments/deployment3.broken.yml @@ -15,6 +15,6 @@ spec: spec: containers: - name: hello-pod - image: gcr.io/google-samples/hello-app:2.0 + image: gcr.io/google-samples/hello-ap:2.0 ports: - containerPort: 8080 \ No newline at end of file diff --git a/Deployments/deployment3.yml b/Deployments/deployment3.yml deleted file mode 100644 index 17cd5be..0000000 --- a/Deployments/deployment3.yml +++ /dev/null @@ -1,20 +0,0 @@ -# Hoang deployment version 2 on 12/06/2023 -apiVersion: apps/v1 -kind: Deployment -metadata: - name: hello-world -spec: - replicas: 10 - selector: - matchLabels: - app: hello-world - template: - metadata: - labels: - app: hello-world - spec: - containers: - - name: hello-world - image: gcr.io/google-samples/hello-app:2.0 - ports: - - containerPort: 8080 diff --git a/Deployments/job-failure-OnFailure.yml b/Deployments/job-failure-OnFailure.yml new file mode 100644 index 0000000..1b25688 --- /dev/null +++ b/Deployments/job-failure-OnFailure.yml @@ -0,0 +1,16 @@ +apiVersion: batch/v1 +kind: Job +metadata: + name: hello-world-job-fail +spec: + backoffLimit: 2 + template: + spec: + containers: + - name: ubuntu + image: ubuntu + command: + - "/bin/bash" + - "-c" + - "/bin/ech Hello from Pod %(hostname) at $(date)" + restartPolicy: Never \ No newline at end of file diff --git a/Deployments/linux-ubuntu-deploy.yml b/Deployments/linux-ubuntu-deploy.yml new file mode 100644 index 0000000..23fa116 --- /dev/null +++ b/Deployments/linux-ubuntu-deploy.yml @@ -0,0 +1,22 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: ubuntu-deployment + labels: + app: ubuntu +spec: + replicas: 3 + selector: + matchLabels: + app: ubuntu + template: + metadata: + labels: + app: ubuntu + spec: + containers: + - name: ubuntu + image: ubuntu + command: ["sleep", "123456"] + nodeSelector: + kubernetes.io/os: linux \ No newline at end of file diff --git a/recommended.yaml b/recommended.yaml new file mode 100644 index 0000000..5bc4004 --- /dev/null +++ b/recommended.yaml @@ -0,0 +1,303 @@ +# Copyright 2017 The Kubernetes Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +apiVersion: v1 +kind: Namespace +metadata: + name: kubernetes-dashboard + +--- + +apiVersion: v1 +kind: ServiceAccount +metadata: + labels: + k8s-app: kubernetes-dashboard + name: kubernetes-dashboard + namespace: kubernetes-dashboard + +--- + +kind: Service +apiVersion: v1 +metadata: + labels: + k8s-app: kubernetes-dashboard + name: kubernetes-dashboard + namespace: kubernetes-dashboard +spec: + ports: + - port: 443 + targetPort: 8443 + selector: + k8s-app: kubernetes-dashboard + +--- + +apiVersion: v1 +kind: Secret +metadata: + labels: + k8s-app: kubernetes-dashboard + name: kubernetes-dashboard-certs + namespace: kubernetes-dashboard +type: Opaque + +--- + +apiVersion: v1 +kind: Secret +metadata: + labels: + k8s-app: kubernetes-dashboard + name: kubernetes-dashboard-csrf + namespace: kubernetes-dashboard +type: Opaque +data: + csrf: "" + +--- + +apiVersion: v1 +kind: Secret +metadata: + labels: + k8s-app: kubernetes-dashboard + name: kubernetes-dashboard-key-holder + namespace: kubernetes-dashboard +type: Opaque + +--- + +kind: ConfigMap +apiVersion: v1 +metadata: + labels: + k8s-app: kubernetes-dashboard + name: kubernetes-dashboard-settings + namespace: kubernetes-dashboard + +--- + +kind: Role +apiVersion: rbac.authorization.k8s.io/v1 +metadata: + labels: + k8s-app: kubernetes-dashboard + name: kubernetes-dashboard + namespace: kubernetes-dashboard +rules: + # Allow Dashboard to get, update and delete Dashboard exclusive secrets. + - apiGroups: [""] + resources: ["secrets"] + resourceNames: ["kubernetes-dashboard-key-holder", "kubernetes-dashboard-certs", "kubernetes-dashboard-csrf"] + verbs: ["get", "update", "delete"] + # Allow Dashboard to get and update 'kubernetes-dashboard-settings' config map. + - apiGroups: [""] + resources: ["configmaps"] + resourceNames: ["kubernetes-dashboard-settings"] + verbs: ["get", "update"] + # Allow Dashboard to get metrics. + - apiGroups: [""] + resources: ["services"] + resourceNames: ["heapster", "dashboard-metrics-scraper"] + verbs: ["proxy"] + - apiGroups: [""] + resources: ["services/proxy"] + resourceNames: ["heapster", "http:heapster:", "https:heapster:", "dashboard-metrics-scraper", "http:dashboard-metrics-scraper"] + verbs: ["get"] + +--- + +kind: ClusterRole +apiVersion: rbac.authorization.k8s.io/v1 +metadata: + labels: + k8s-app: kubernetes-dashboard + name: kubernetes-dashboard +rules: + # Allow Metrics Scraper to get metrics from the Metrics server + - apiGroups: ["metrics.k8s.io"] + resources: ["pods", "nodes"] + verbs: ["get", "list", "watch"] + +--- + +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + labels: + k8s-app: kubernetes-dashboard + name: kubernetes-dashboard + namespace: kubernetes-dashboard +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: kubernetes-dashboard +subjects: + - kind: ServiceAccount + name: kubernetes-dashboard + namespace: kubernetes-dashboard + +--- + +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: kubernetes-dashboard +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: kubernetes-dashboard +subjects: + - kind: ServiceAccount + name: kubernetes-dashboard + namespace: kubernetes-dashboard + +--- + +kind: Deployment +apiVersion: apps/v1 +metadata: + labels: + k8s-app: kubernetes-dashboard + name: kubernetes-dashboard + namespace: kubernetes-dashboard +spec: + replicas: 1 + revisionHistoryLimit: 10 + selector: + matchLabels: + k8s-app: kubernetes-dashboard + template: + metadata: + labels: + k8s-app: kubernetes-dashboard + spec: + containers: + - name: kubernetes-dashboard + image: kubernetesui/dashboard:v2.4.0 + imagePullPolicy: Always + ports: + - containerPort: 8443 + protocol: TCP + args: + - --auto-generate-certificates + - --namespace=kubernetes-dashboard + # Uncomment the following line to manually specify Kubernetes API server Host + # If not specified, Dashboard will attempt to auto discover the API server and connect + # to it. Uncomment only if the default does not work. + # - --apiserver-host=http://my-address:port + volumeMounts: + - name: kubernetes-dashboard-certs + mountPath: /certs + # Create on-disk volume to store exec logs + - mountPath: /tmp + name: tmp-volume + livenessProbe: + httpGet: + scheme: HTTPS + path: / + port: 8443 + initialDelaySeconds: 30 + timeoutSeconds: 30 + securityContext: + allowPrivilegeEscalation: false + readOnlyRootFilesystem: true + runAsUser: 1001 + runAsGroup: 2001 + volumes: + - name: kubernetes-dashboard-certs + secret: + secretName: kubernetes-dashboard-certs + - name: tmp-volume + emptyDir: {} + serviceAccountName: kubernetes-dashboard + nodeSelector: + "kubernetes.io/os": linux + # Comment the following tolerations if Dashboard must not be deployed on master + tolerations: + - key: node-role.kubernetes.io/master + effect: NoSchedule + +--- + +kind: Service +apiVersion: v1 +metadata: + labels: + k8s-app: dashboard-metrics-scraper + name: dashboard-metrics-scraper + namespace: kubernetes-dashboard +spec: + ports: + - port: 8000 + targetPort: 8000 + selector: + k8s-app: dashboard-metrics-scraper + +--- + +kind: Deployment +apiVersion: apps/v1 +metadata: + labels: + k8s-app: dashboard-metrics-scraper + name: dashboard-metrics-scraper + namespace: kubernetes-dashboard +spec: + replicas: 1 + revisionHistoryLimit: 10 + selector: + matchLabels: + k8s-app: dashboard-metrics-scraper + template: + metadata: + labels: + k8s-app: dashboard-metrics-scraper + spec: + securityContext: + seccompProfile: + type: RuntimeDefault + containers: + - name: dashboard-metrics-scraper + image: kubernetesui/metrics-scraper:v1.0.7 + ports: + - containerPort: 8000 + protocol: TCP + livenessProbe: + httpGet: + scheme: HTTP + path: / + port: 8000 + initialDelaySeconds: 30 + timeoutSeconds: 30 + volumeMounts: + - mountPath: /tmp + name: tmp-volume + securityContext: + allowPrivilegeEscalation: false + readOnlyRootFilesystem: true + runAsUser: 1001 + runAsGroup: 2001 + serviceAccountName: kubernetes-dashboard + nodeSelector: + "kubernetes.io/os": linux + # Comment the following tolerations if Dashboard must not be deployed on master + tolerations: + - key: node-role.kubernetes.io/master + effect: NoSchedule + volumes: + - name: tmp-volume + emptyDir: {} From 5312641fdba3209660640c2c8f3802221c4d1a48 Mon Sep 17 00:00:00 2001 From: jumbo4git Date: Fri, 15 Dec 2023 15:16:29 -0500 Subject: [PATCH 4/6] added new files --- Deployments/AzureDisk.yaml | 43 ++++ Deployments/AzureDiskCustomStorageClass.yml | 16 ++ Deployments/CustomStorageClass.yml | 8 + Deployments/aks-store-quickstart.yaml | 226 ++++++++++++++++++ Deployments/apache.yaml | 20 ++ ...deployUbuntu.yml => deployment-Ubuntu.yml} | 0 ...untu-deploy.yml => deployment-Ubuntu3.yml} | 0 Deployments/deployment-alpha.yaml | 37 +++ Deployments/deployment-beta.yaml | 39 +++ Deployments/nfs.nginx.yml | 38 +++ 10 files changed, 427 insertions(+) create mode 100644 Deployments/AzureDisk.yaml create mode 100644 Deployments/AzureDiskCustomStorageClass.yml create mode 100644 Deployments/CustomStorageClass.yml create mode 100644 Deployments/aks-store-quickstart.yaml create mode 100644 Deployments/apache.yaml rename Deployments/{deployUbuntu.yml => deployment-Ubuntu.yml} (100%) rename Deployments/{linux-ubuntu-deploy.yml => deployment-Ubuntu3.yml} (100%) create mode 100644 Deployments/deployment-alpha.yaml create mode 100644 Deployments/deployment-beta.yaml create mode 100644 Deployments/nfs.nginx.yml diff --git a/Deployments/AzureDisk.yaml b/Deployments/AzureDisk.yaml new file mode 100644 index 0000000..9ecf79f --- /dev/null +++ b/Deployments/AzureDisk.yaml @@ -0,0 +1,43 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: pvc-azure-managed +spec: + accessModes: + - ReadWriteOnce + storageClassName: managed-premium + resources: + requests: + storage: 10Gi +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: nginx-azdisk-deployment +spec: + replicas: 1 + selector: + matchLabels: + app: nginx + template: + metadata: + labels: + app: nginx + spec: + volumes: + - name: webcontent + persistentVolumeClaim: + claimName: pvc-azure-managed + containers: + - name: nginx + image: nginx + ports: + - containerPort: 80 + volumeMounts: + - name: webcontent + mountPath: "/usr/share/nginx/html/web-app" + + + + + diff --git a/Deployments/AzureDiskCustomStorageClass.yml b/Deployments/AzureDiskCustomStorageClass.yml new file mode 100644 index 0000000..f8612ca --- /dev/null +++ b/Deployments/AzureDiskCustomStorageClass.yml @@ -0,0 +1,16 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: pvc-azure-standard-ssd + spec: + accessModes: + - ReadWriteOnce + storageClassName: managed-standard-ssd + resources: + requests: + storage: 10Gi +--- + + + + diff --git a/Deployments/CustomStorageClass.yml b/Deployments/CustomStorageClass.yml new file mode 100644 index 0000000..f6c8ed6 --- /dev/null +++ b/Deployments/CustomStorageClass.yml @@ -0,0 +1,8 @@ +apiVersion: storage.k8s.io/v1 +kind: storageClassName:metadata: + name: managed-standard-ssd +parameters: + cachingmode: ReadOnly + kind: managed + storageaccounttype: StandardSSD_LRS +provisioner: kubernetes.io/azure-disk \ No newline at end of file diff --git a/Deployments/aks-store-quickstart.yaml b/Deployments/aks-store-quickstart.yaml new file mode 100644 index 0000000..953a420 --- /dev/null +++ b/Deployments/aks-store-quickstart.yaml @@ -0,0 +1,226 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: rabbitmq +spec: + replicas: 1 + selector: + matchLabels: + app: rabbitmq + template: + metadata: + labels: + app: rabbitmq + spec: + nodeSelector: + "kubernetes.io/os": linux + containers: + - name: rabbitmq + image: mcr.microsoft.com/mirror/docker/library/rabbitmq:3.10-management-alpine + ports: + - containerPort: 5672 + name: rabbitmq-amqp + - containerPort: 15672 + name: rabbitmq-http + env: + - name: RABBITMQ_DEFAULT_USER + value: "username" + - name: RABBITMQ_DEFAULT_PASS + value: "password" + resources: + requests: + cpu: 10m + memory: 128Mi + limits: + cpu: 250m + memory: 256Mi + volumeMounts: + - name: rabbitmq-enabled-plugins + mountPath: /etc/rabbitmq/enabled_plugins + subPath: enabled_plugins + volumes: + - name: rabbitmq-enabled-plugins + configMap: + name: rabbitmq-enabled-plugins + items: + - key: rabbitmq_enabled_plugins + path: enabled_plugins +--- +apiVersion: v1 +data: + rabbitmq_enabled_plugins: | + [rabbitmq_management,rabbitmq_prometheus,rabbitmq_amqp1_0]. +kind: ConfigMap +metadata: + name: rabbitmq-enabled-plugins +--- +apiVersion: v1 +kind: Service +metadata: + name: rabbitmq +spec: + selector: + app: rabbitmq + ports: + - name: rabbitmq-amqp + port: 5672 + targetPort: 5672 + - name: rabbitmq-http + port: 15672 + targetPort: 15672 + type: ClusterIP +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: order-service +spec: + replicas: 1 + selector: + matchLabels: + app: order-service + template: + metadata: + labels: + app: order-service + spec: + nodeSelector: + "kubernetes.io/os": linux + containers: + - name: order-service + image: ghcr.io/azure-samples/aks-store-demo/order-service:latest + ports: + - containerPort: 3000 + env: + - name: ORDER_QUEUE_HOSTNAME + value: "rabbitmq" + - name: ORDER_QUEUE_PORT + value: "5672" + - name: ORDER_QUEUE_USERNAME + value: "username" + - name: ORDER_QUEUE_PASSWORD + value: "password" + - name: ORDER_QUEUE_NAME + value: "orders" + - name: FASTIFY_ADDRESS + value: "0.0.0.0" + resources: + requests: + cpu: 1m + memory: 50Mi + limits: + cpu: 75m + memory: 128Mi + initContainers: + - name: wait-for-rabbitmq + image: busybox + command: ['sh', '-c', 'until nc -zv rabbitmq 5672; do echo waiting for rabbitmq; sleep 2; done;'] + resources: + requests: + cpu: 1m + memory: 50Mi + limits: + cpu: 75m + memory: 128Mi +--- +apiVersion: v1 +kind: Service +metadata: + name: order-service +spec: + type: ClusterIP + ports: + - name: http + port: 3000 + targetPort: 3000 + selector: + app: order-service +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: product-service +spec: + replicas: 1 + selector: + matchLabels: + app: product-service + template: + metadata: + labels: + app: product-service + spec: + nodeSelector: + "kubernetes.io/os": linux + containers: + - name: product-service + image: ghcr.io/azure-samples/aks-store-demo/product-service:latest + ports: + - containerPort: 3002 + resources: + requests: + cpu: 1m + memory: 1Mi + limits: + cpu: 1m + memory: 7Mi +--- +apiVersion: v1 +kind: Service +metadata: + name: product-service +spec: + type: ClusterIP + ports: + - name: http + port: 3002 + targetPort: 3002 + selector: + app: product-service +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: store-front +spec: + replicas: 1 + selector: + matchLabels: + app: store-front + template: + metadata: + labels: + app: store-front + spec: + nodeSelector: + "kubernetes.io/os": linux + containers: + - name: store-front + image: ghcr.io/azure-samples/aks-store-demo/store-front:latest + ports: + - containerPort: 8080 + name: store-front + env: + - name: VUE_APP_ORDER_SERVICE_URL + value: "http://order-service:3000/" + - name: VUE_APP_PRODUCT_SERVICE_URL + value: "http://product-service:3002/" + resources: + requests: + cpu: 1m + memory: 200Mi + limits: + cpu: 1000m + memory: 512Mi +--- +apiVersion: v1 +kind: Service +metadata: + name: store-front +spec: + ports: + - port: 80 + targetPort: 8080 + selector: + app: store-front + type: LoadBalancer \ No newline at end of file diff --git a/Deployments/apache.yaml b/Deployments/apache.yaml new file mode 100644 index 0000000..dca5157 --- /dev/null +++ b/Deployments/apache.yaml @@ -0,0 +1,20 @@ +- name: 'Manage Apache Webserver Deployment' + hosts: RedHat + become: true + gather_facts: false + tasks: + - name: 'Install the Apache Webserver' + package: + name: 'httpd' + state: 'present' + - name: 'Ensure webserver is enable and running' + service: + name: 'httpd' + state: 'started' + enabled: true + - name: 'Copy web contents' + copy: + dest: '/var/www/html/index.html' + content: | + This is a simple page +

Welcome

\ No newline at end of file diff --git a/Deployments/deployUbuntu.yml b/Deployments/deployment-Ubuntu.yml similarity index 100% rename from Deployments/deployUbuntu.yml rename to Deployments/deployment-Ubuntu.yml diff --git a/Deployments/linux-ubuntu-deploy.yml b/Deployments/deployment-Ubuntu3.yml similarity index 100% rename from Deployments/linux-ubuntu-deploy.yml rename to Deployments/deployment-Ubuntu3.yml diff --git a/Deployments/deployment-alpha.yaml b/Deployments/deployment-alpha.yaml new file mode 100644 index 0000000..d29f28b --- /dev/null +++ b/Deployments/deployment-alpha.yaml @@ -0,0 +1,37 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: hello-world-alpha +spec: + replicas: 1 + selector: + matchLabels: + app: hello-world-alpha + template: + metadata: + labels: + app: hello-world-alpha + spec: + containers: + - name: hello-world + image: gcr.io/google-samples/hello-app:1.0 + env: + - name: DATABASE_SERVERNAME + value: "sql.example.local" + - name: BACKEND_SERVERNAME + value: "be.example.local" + ports: + - containerPort: 8080 +--- +apiVersion: v1 +kind: Service +metadata: + name: hello-world-alpha +spec: + selector: + app: hello-world-alpha + ports: + - protocol: TCP + port: 80 + targetPort: 8080 + diff --git a/Deployments/deployment-beta.yaml b/Deployments/deployment-beta.yaml new file mode 100644 index 0000000..7446b70 --- /dev/null +++ b/Deployments/deployment-beta.yaml @@ -0,0 +1,39 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: hello-world-beta +spec: + replicas: 1 + selector: + matchLabels: + app: hello-world-beta + template: + metadata: + labels: + app: hello-world-beta + spec: + containers: + - name: hello-world + image: gcr.io/google-samples/hello-app:1.0 + env: + - name: DATABASE_SERVERNAME + value: "sql.example.local" + - name: BACKEND_SERVERNAME + value: "be.example.local" + ports: + - containerPort: 8080 +--- +apiVersion: v1 +kind: Service +metadata: + name: hello-world-beta +spec: + selector: + app: hello-world-beta + ports: + - protocol: TCP + port: 80 + targetPort: 8080 + type: ClusterIP + + diff --git a/Deployments/nfs.nginx.yml b/Deployments/nfs.nginx.yml new file mode 100644 index 0000000..060c1e1 --- /dev/null +++ b/Deployments/nfs.nginx.yml @@ -0,0 +1,38 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: nginx-nfs-deployment +spec: + replicas: 1 + selector: + matchLabels: + app: nginx + template: + metadata: + lables: + app: nginx + spec: + volumes: + - name: webcontent + persistentVolumeClain: + claimName: pvc-nfs-data + containers: + - name: nginx + image: nginx:1.14.2 + ports: + - containerPort: 80 + volumeMounts: + - name: webcontent + mountPath: "/usr/share/nginx/html/web-app" +--- +apiVersion: v1 +kind: Service +metadata: + name: nginx-nfs-service +spec: + selector: + app: nginx + ports: + - port: 80 + protocol: TCP + targetPort: 80 From eeee72c5ddb71cbebfc7c4d46307f4380768f042 Mon Sep 17 00:00:00 2001 From: jumbo4git Date: Fri, 15 Dec 2023 16:10:01 -0500 Subject: [PATCH 5/6] changed files extension to yaml --- ...iskCustomStorageClass.yml => AzureDiskCustomStorageClass.yaml} | 0 Deployments/{CoreDNSConfigCustom.yml => CoreDNSConfigCustom.yaml} | 0 Deployments/{CustomStorageClass.yml => CustomStorageClass.yaml} | 0 Deployments/{ParallelJob.yml => ParallelJob.yaml} | 0 Deployments/{deploy-complete.yml => deploy-complete.yaml} | 0 Deployments/{deploy.yml => deploy.yaml} | 0 Deployments/{deployNginx.yml => deployNginx.yaml} | 0 Deployments/{deployment-Ubuntu.yml => deployment-Ubuntu.yaml} | 0 Deployments/{deployment-Ubuntu3.yml => deployment-Ubuntu3.yaml} | 0 Deployments/{deployment-label.yml => deployment-label.yaml} | 0 Deployments/{deployment-old.yml => deployment-old.yaml} | 0 Deployments/{deployment-rolling.yml => deployment-rolling.yaml} | 0 .../{deployment.20replicas.yml => deployment.20replicas.yaml} | 0 Deployments/{deployment.probes-1.yml => deployment.probes-1.yaml} | 0 Deployments/{deployment.probes-2.yml => deployment.probes-2.yaml} | 0 Deployments/{deployment.probes-3.yml => deployment.probes-3.yaml} | 0 Deployments/{deployment.yml => deployment.yaml} | 0 Deployments/{deployment2.yml => deployment2.yaml} | 0 Deployments/{deployment3.broken.yml => deployment3.broken.yaml} | 0 .../{job-failure-OnFailure.yml => job-failure-OnFailure.yaml} | 0 Deployments/{kind-3workers.yml => kind-3workers.yaml} | 0 Deployments/{nfs.nginx.yml => nfs.nginx.yaml} | 0 Pods/{PodsToNodes.yml => PodsToNodes.yaml} | 0 ...container-probes-startup.yml => container-probes-startup.yaml} | 0 Pods/{init-containers.yml => init-containers.yaml} | 0 Pods/{multi-pod.yml => multi-pod.yaml} | 0 Pods/{mypod.yml => mypod.yaml} | 0 Pods/{newPod.yml => newPod.yaml} | 0 Pods/{newPod2.yml => newPod2.yaml} | 0 Pods/{pod-restart-policy.yml => pod-restart-policy.yaml} | 0 Pods/{pod.yml => pod.yaml} | 0 Pods/{pod2.yml => pod2.yaml} | 0 Services/{service.yml => service.yaml} | 0 Services/{service2.yml => service2.yaml} | 0 Services/{svc-lb.yml => svc-lb.yaml} | 0 Services/{svc-nodeport.yml => svc-nodeport.yaml} | 0 36 files changed, 0 insertions(+), 0 deletions(-) rename Deployments/{AzureDiskCustomStorageClass.yml => AzureDiskCustomStorageClass.yaml} (100%) rename Deployments/{CoreDNSConfigCustom.yml => CoreDNSConfigCustom.yaml} (100%) rename Deployments/{CustomStorageClass.yml => CustomStorageClass.yaml} (100%) rename Deployments/{ParallelJob.yml => ParallelJob.yaml} (100%) rename Deployments/{deploy-complete.yml => deploy-complete.yaml} (100%) rename Deployments/{deploy.yml => deploy.yaml} (100%) rename Deployments/{deployNginx.yml => deployNginx.yaml} (100%) rename Deployments/{deployment-Ubuntu.yml => deployment-Ubuntu.yaml} (100%) rename Deployments/{deployment-Ubuntu3.yml => deployment-Ubuntu3.yaml} (100%) rename Deployments/{deployment-label.yml => deployment-label.yaml} (100%) rename Deployments/{deployment-old.yml => deployment-old.yaml} (100%) rename Deployments/{deployment-rolling.yml => deployment-rolling.yaml} (100%) rename Deployments/{deployment.20replicas.yml => deployment.20replicas.yaml} (100%) rename Deployments/{deployment.probes-1.yml => deployment.probes-1.yaml} (100%) rename Deployments/{deployment.probes-2.yml => deployment.probes-2.yaml} (100%) rename Deployments/{deployment.probes-3.yml => deployment.probes-3.yaml} (100%) rename Deployments/{deployment.yml => deployment.yaml} (100%) rename Deployments/{deployment2.yml => deployment2.yaml} (100%) rename Deployments/{deployment3.broken.yml => deployment3.broken.yaml} (100%) rename Deployments/{job-failure-OnFailure.yml => job-failure-OnFailure.yaml} (100%) rename Deployments/{kind-3workers.yml => kind-3workers.yaml} (100%) rename Deployments/{nfs.nginx.yml => nfs.nginx.yaml} (100%) rename Pods/{PodsToNodes.yml => PodsToNodes.yaml} (100%) rename Pods/{container-probes-startup.yml => container-probes-startup.yaml} (100%) rename Pods/{init-containers.yml => init-containers.yaml} (100%) rename Pods/{multi-pod.yml => multi-pod.yaml} (100%) rename Pods/{mypod.yml => mypod.yaml} (100%) rename Pods/{newPod.yml => newPod.yaml} (100%) rename Pods/{newPod2.yml => newPod2.yaml} (100%) rename Pods/{pod-restart-policy.yml => pod-restart-policy.yaml} (100%) rename Pods/{pod.yml => pod.yaml} (100%) rename Pods/{pod2.yml => pod2.yaml} (100%) rename Services/{service.yml => service.yaml} (100%) rename Services/{service2.yml => service2.yaml} (100%) rename Services/{svc-lb.yml => svc-lb.yaml} (100%) rename Services/{svc-nodeport.yml => svc-nodeport.yaml} (100%) diff --git a/Deployments/AzureDiskCustomStorageClass.yml b/Deployments/AzureDiskCustomStorageClass.yaml similarity index 100% rename from Deployments/AzureDiskCustomStorageClass.yml rename to Deployments/AzureDiskCustomStorageClass.yaml diff --git a/Deployments/CoreDNSConfigCustom.yml b/Deployments/CoreDNSConfigCustom.yaml similarity index 100% rename from Deployments/CoreDNSConfigCustom.yml rename to Deployments/CoreDNSConfigCustom.yaml diff --git a/Deployments/CustomStorageClass.yml b/Deployments/CustomStorageClass.yaml similarity index 100% rename from Deployments/CustomStorageClass.yml rename to Deployments/CustomStorageClass.yaml diff --git a/Deployments/ParallelJob.yml b/Deployments/ParallelJob.yaml similarity index 100% rename from Deployments/ParallelJob.yml rename to Deployments/ParallelJob.yaml diff --git a/Deployments/deploy-complete.yml b/Deployments/deploy-complete.yaml similarity index 100% rename from Deployments/deploy-complete.yml rename to Deployments/deploy-complete.yaml diff --git a/Deployments/deploy.yml b/Deployments/deploy.yaml similarity index 100% rename from Deployments/deploy.yml rename to Deployments/deploy.yaml diff --git a/Deployments/deployNginx.yml b/Deployments/deployNginx.yaml similarity index 100% rename from Deployments/deployNginx.yml rename to Deployments/deployNginx.yaml diff --git a/Deployments/deployment-Ubuntu.yml b/Deployments/deployment-Ubuntu.yaml similarity index 100% rename from Deployments/deployment-Ubuntu.yml rename to Deployments/deployment-Ubuntu.yaml diff --git a/Deployments/deployment-Ubuntu3.yml b/Deployments/deployment-Ubuntu3.yaml similarity index 100% rename from Deployments/deployment-Ubuntu3.yml rename to Deployments/deployment-Ubuntu3.yaml diff --git a/Deployments/deployment-label.yml b/Deployments/deployment-label.yaml similarity index 100% rename from Deployments/deployment-label.yml rename to Deployments/deployment-label.yaml diff --git a/Deployments/deployment-old.yml b/Deployments/deployment-old.yaml similarity index 100% rename from Deployments/deployment-old.yml rename to Deployments/deployment-old.yaml diff --git a/Deployments/deployment-rolling.yml b/Deployments/deployment-rolling.yaml similarity index 100% rename from Deployments/deployment-rolling.yml rename to Deployments/deployment-rolling.yaml diff --git a/Deployments/deployment.20replicas.yml b/Deployments/deployment.20replicas.yaml similarity index 100% rename from Deployments/deployment.20replicas.yml rename to Deployments/deployment.20replicas.yaml diff --git a/Deployments/deployment.probes-1.yml b/Deployments/deployment.probes-1.yaml similarity index 100% rename from Deployments/deployment.probes-1.yml rename to Deployments/deployment.probes-1.yaml diff --git a/Deployments/deployment.probes-2.yml b/Deployments/deployment.probes-2.yaml similarity index 100% rename from Deployments/deployment.probes-2.yml rename to Deployments/deployment.probes-2.yaml diff --git a/Deployments/deployment.probes-3.yml b/Deployments/deployment.probes-3.yaml similarity index 100% rename from Deployments/deployment.probes-3.yml rename to Deployments/deployment.probes-3.yaml diff --git a/Deployments/deployment.yml b/Deployments/deployment.yaml similarity index 100% rename from Deployments/deployment.yml rename to Deployments/deployment.yaml diff --git a/Deployments/deployment2.yml b/Deployments/deployment2.yaml similarity index 100% rename from Deployments/deployment2.yml rename to Deployments/deployment2.yaml diff --git a/Deployments/deployment3.broken.yml b/Deployments/deployment3.broken.yaml similarity index 100% rename from Deployments/deployment3.broken.yml rename to Deployments/deployment3.broken.yaml diff --git a/Deployments/job-failure-OnFailure.yml b/Deployments/job-failure-OnFailure.yaml similarity index 100% rename from Deployments/job-failure-OnFailure.yml rename to Deployments/job-failure-OnFailure.yaml diff --git a/Deployments/kind-3workers.yml b/Deployments/kind-3workers.yaml similarity index 100% rename from Deployments/kind-3workers.yml rename to Deployments/kind-3workers.yaml diff --git a/Deployments/nfs.nginx.yml b/Deployments/nfs.nginx.yaml similarity index 100% rename from Deployments/nfs.nginx.yml rename to Deployments/nfs.nginx.yaml diff --git a/Pods/PodsToNodes.yml b/Pods/PodsToNodes.yaml similarity index 100% rename from Pods/PodsToNodes.yml rename to Pods/PodsToNodes.yaml diff --git a/Pods/container-probes-startup.yml b/Pods/container-probes-startup.yaml similarity index 100% rename from Pods/container-probes-startup.yml rename to Pods/container-probes-startup.yaml diff --git a/Pods/init-containers.yml b/Pods/init-containers.yaml similarity index 100% rename from Pods/init-containers.yml rename to Pods/init-containers.yaml diff --git a/Pods/multi-pod.yml b/Pods/multi-pod.yaml similarity index 100% rename from Pods/multi-pod.yml rename to Pods/multi-pod.yaml diff --git a/Pods/mypod.yml b/Pods/mypod.yaml similarity index 100% rename from Pods/mypod.yml rename to Pods/mypod.yaml diff --git a/Pods/newPod.yml b/Pods/newPod.yaml similarity index 100% rename from Pods/newPod.yml rename to Pods/newPod.yaml diff --git a/Pods/newPod2.yml b/Pods/newPod2.yaml similarity index 100% rename from Pods/newPod2.yml rename to Pods/newPod2.yaml diff --git a/Pods/pod-restart-policy.yml b/Pods/pod-restart-policy.yaml similarity index 100% rename from Pods/pod-restart-policy.yml rename to Pods/pod-restart-policy.yaml diff --git a/Pods/pod.yml b/Pods/pod.yaml similarity index 100% rename from Pods/pod.yml rename to Pods/pod.yaml diff --git a/Pods/pod2.yml b/Pods/pod2.yaml similarity index 100% rename from Pods/pod2.yml rename to Pods/pod2.yaml diff --git a/Services/service.yml b/Services/service.yaml similarity index 100% rename from Services/service.yml rename to Services/service.yaml diff --git a/Services/service2.yml b/Services/service2.yaml similarity index 100% rename from Services/service2.yml rename to Services/service2.yaml diff --git a/Services/svc-lb.yml b/Services/svc-lb.yaml similarity index 100% rename from Services/svc-lb.yml rename to Services/svc-lb.yaml diff --git a/Services/svc-nodeport.yml b/Services/svc-nodeport.yaml similarity index 100% rename from Services/svc-nodeport.yml rename to Services/svc-nodeport.yaml From 210e6f083e7dd4c1490f8d19d067e6ecd8057f5e Mon Sep 17 00:00:00 2001 From: jumbo4git Date: Wed, 20 Dec 2023 11:57:02 -0500 Subject: [PATCH 6/6] Saved all new files --- Deployments/CreateUserCertificate.sh | 13 +++++++++++++ Deployments/create_CSR1.yaml | 10 ++++++++++ Deployments/create_roleBinding.yaml | 0 Deployments/demouser.csr | 15 +++++++++++++++ Deployments/demouser.key | 27 +++++++++++++++++++++++++++ Deployments/deployment.yaml | 2 +- Deployments/firewalld_enable.yaml | 8 ++++++++ 7 files changed, 74 insertions(+), 1 deletion(-) create mode 100644 Deployments/CreateUserCertificate.sh create mode 100644 Deployments/create_CSR1.yaml create mode 100644 Deployments/create_roleBinding.yaml create mode 100644 Deployments/demouser.csr create mode 100644 Deployments/demouser.key create mode 100644 Deployments/firewalld_enable.yaml diff --git a/Deployments/CreateUserCertificate.sh b/Deployments/CreateUserCertificate.sh new file mode 100644 index 0000000..d17d829 --- /dev/null +++ b/Deployments/CreateUserCertificate.sh @@ -0,0 +1,13 @@ +cat < demouser.base64.csr diff --git a/Deployments/create_roleBinding.yaml b/Deployments/create_roleBinding.yaml new file mode 100644 index 0000000..e69de29 diff --git a/Deployments/demouser.csr b/Deployments/demouser.csr new file mode 100644 index 0000000..0ae3461 --- /dev/null +++ b/Deployments/demouser.csr @@ -0,0 +1,15 @@ +-----BEGIN CERTIFICATE REQUEST----- +MIICWDCCAUACAQAwEzERMA8GA1UEAwwIZGVtb3VzZXIwggEiMA0GCSqGSIb3DQEB +AQUAA4IBDwAwggEKAoIBAQCdpLkIHcUvYI+j44RcuKz6SGmLzIJSrh7/vKX6Lf+W +g/vA97wLo+M7QE1zfgQ+MDt3hExuZdHODKZpXpJ8x2u5qPlR5zMiNz7m85y1sS/n +et2FsTsdoNRV9T3/bZOvCq4vGPOAg4bP4PoeN0fcUjUnOEAbRG0n2ySfZCoerAJh +HCTidsAEvobVErwMDyzvJg9ssEQKiRbPGvEysf4/wnD26WiE8XjdM2JhzU9GpaJf +DUi/l1fVLyLg5cGjyPYee4PGIkhvTvmTCuO1+hJfuWlnl/Od/6tMEWWaCXONX7pW +WJzctK2QQkBlfJSMbXmcLefypDR1YB/mw0J5VYsxUTvdAgMBAAGgADANBgkqhkiG +9w0BAQsFAAOCAQEAfMsjvPvPQBoI70JZtFSbN6t4Mn1e++aWb0pEdNp11lnOrobr +gznLLX48LRGL3iCDAfyiAFdKbspWzYt2eH2Z0/iv7mc6Hx/0JT3AcXkn2qU9NNgv +PiCZ5Dg33iWDZoVcGcwOnqn7Gj16xm52yovWWcDJ4Q9iOtv0RmopWWfvLyewwveE +Iq8YGaiFueT9POl9JFvXoLP3dZK5YrcTXDFw7QvIGWkxWpVBQtEFA3DKIFvUzq/S +OWyWLWqqV9OFEZlYS8zsUhgEkKS9nUTLDdfk8G6LrSaps2dzetWpQyNVYMtivDEG +1bpX53G5VpFuC3TiJQHmlYbyOFyrsoJpFK/QuA== +-----END CERTIFICATE REQUEST----- diff --git a/Deployments/demouser.key b/Deployments/demouser.key new file mode 100644 index 0000000..4b67ea0 --- /dev/null +++ b/Deployments/demouser.key @@ -0,0 +1,27 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIEpAIBAAKCAQEAnaS5CB3FL2CPo+OEXLis+khpi8yCUq4e/7yl+i3/loP7wPe8 +C6PjO0BNc34EPjA7d4RMbmXRzgymaV6SfMdruaj5UeczIjc+5vOctbEv53rdhbE7 +HaDUVfU9/22TrwquLxjzgIOGz+D6HjdH3FI1JzhAG0RtJ9skn2QqHqwCYRwk4nbA +BL6G1RK8DA8s7yYPbLBECokWzxrxMrH+P8Jw9ulohPF43TNiYc1PRqWiXw1Iv5dX +1S8i4OXBo8j2HnuDxiJIb075kwrjtfoSX7lpZ5fznf+rTBFlmglzjV+6Vlic3LSt +kEJAZXyUjG15nC3n8qQ0dWAf5sNCeVWLMVE73QIDAQABAoIBAQCS4RVdUI+Wsvti +keuTkKXqlGlyzdtnOcC8OoLS9OS80sBQbQISPmLLpAAF6ZX+c2YU13l3KvsuZm7u +oiUOiaf/VkbmXuovqRW8jaKnTy35GWso05bm5iCw7k0Tnn8JioP8cdz/Eo0bRt0E +JjGYQCgyIKDqRvkFN5OJxwPPjCizXNVIzIrMCv0YyWoInn4QU0if03KfJG15XKyC +yGObv4jGbOUMnlr10sAvMoX18uHPuiRE5i2J7rl9xmHs3MyoqQvNJfvyrrPY8DTT +UfujdQosiZqsU05bXLVh9UZnlDqK7MPtynG0hgCzXA/oup6OF38JlscV9EsNkVgs +HKS00CupAoGBAMs3R6IVdBenTmBzcnZLsl31il7TCWWE/ZzYHo0I3hmT3Bg4hpJw +kYB0/Ne5TVlhK7/6oZHJeGKW/D0YgozpWgUkZV56a0ie9QhnD0o30RpOdLXJUDFM +DxraG6e0CdP0p1B8RHea55zun7abN58uce5mAR1EUBIDkmWAAR/HqyQXAoGBAMaX +IMfJHXg11MfJYGxJNTAj4IiPmmeAysFeUfrClHbjpP/DbWAbBexH2LAQg9iFsRYR +U/nyrOa5HQ+lB82CnfvPN/mKl0+ORF5qt9bmH/pezxO2sVOnKo/HrH41m+Nqud05 +UA6FI9ATI0DHxRZi4Can2vTcWBW6WsnzajvUnrQrAoGAMOoyfOpLEnJ8JC1FzQG1 +gnZbAy4rIducLEe9Otd6lo+Ht/DLO66K52/BeK+q1avVGxXaFDx5lMmhF5exvPdi +asBzAgXXkxhoBMjB3myHEZz27NbzTZpwPFdptrlYcEOAjpgK5vtLavPpT8wW3GMS +m37EH+ZUm7FuaK4iFyM5p6sCgYEAmZX1/y02Qmr3hg/jJ7wyi2mj1FmjY5sCtCv7 +IQFtiskiKb/9jg84NHWYSwpqvYEf5N4/4RXizImrxRawAyuafU3Uj4S04w03KQJF +7ciKQLskUa3AVN77FrmpWO6jAm3fEw2pMaGcgebbI9WcQmTz0FGPEEJ9SUiXwIol +xeH5X4MCgYAo5br/v7YasCZq48Mkn6eIUBEJ0j7ezLdT74hKmf70Jp21weApNbj2 +TNtC3XxnXCEH5CPx/TE+IWZlPOvOg8WK/8agSqbQuL4JB3D2JfgsSlNXxHvLlBv4 +0ixNGmmJnUpb7jqkRh3ZURNSIuhaQ/LDo66snEJvhdNk5ogiUVuB/w== +-----END RSA PRIVATE KEY----- diff --git a/Deployments/deployment.yaml b/Deployments/deployment.yaml index d791b2c..92c7ebe 100644 --- a/Deployments/deployment.yaml +++ b/Deployments/deployment.yaml @@ -3,7 +3,7 @@ kind: Deployment metadata: name: hello-world spec: - replicas: 10 + replicas: 3 selector: matchLabels: app: hello-world diff --git a/Deployments/firewalld_enable.yaml b/Deployments/firewalld_enable.yaml new file mode 100644 index 0000000..aaf6b3b --- /dev/null +++ b/Deployments/firewalld_enable.yaml @@ -0,0 +1,8 @@ +- name: Start and enable http in firewall rules + ansible.builtin.systemd: + hosts: redhat + name: firewalld + state: started + enabled: yes + service: http + permanent: yes \ No newline at end of file