From 9ac143f3f697cd4ed0d3a36b5fbf4a82798269fa Mon Sep 17 00:00:00 2001 From: root Date: Thu, 10 Jul 2025 17:23:45 +0330 Subject: [PATCH] update kuber: longhorn statfullset --- .../workloads/manifests/state-full-set.yaml | 49 +++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 Containerization & Orchestration/Kubernetes/workloads/manifests/state-full-set.yaml diff --git a/Containerization & Orchestration/Kubernetes/workloads/manifests/state-full-set.yaml b/Containerization & Orchestration/Kubernetes/workloads/manifests/state-full-set.yaml new file mode 100644 index 0000000..07ad5b0 --- /dev/null +++ b/Containerization & Orchestration/Kubernetes/workloads/manifests/state-full-set.yaml @@ -0,0 +1,49 @@ +--- +apiVersion: v1 +kind: Service +metadata: + labels: + app: nginx + name: nginx +spec: + clusterIP: None + ports: + - name: web + port: 80 + selector: + app: nginx +--- +apiVersion: apps/v1 +kind: StatefulSet +metadata: + name: simple-stateful-set +spec: + replicas: 3 # the default is 1 + selector: + matchLabels: + app: nginx # has to match .spec.template.metadata.labels + serviceName: "nginx" + template: + metadata: + labels: + app: nginx # has to match .spec.selector.matchLabels + spec: + terminationGracePeriodSeconds: 10 + containers: + - image: nginx + name: nginx + ports: + - containerPort: 80 + name: web + volumeMounts: + - mountPath: /usr/share/nginx/html + name: www + volumeClaimTemplates: + - metadata: + name: www + spec: + accessModes: ["ReadWriteOnce"] + resources: + requests: + storage: 1Gi + storageClassName: "longhorn" \ No newline at end of file