add nacos (#992)
diff --git a/kubernetes/nacos/pv.yaml b/kubernetes/nacos/pv.yaml
new file mode 100644
index 0000000..490be19
--- /dev/null
+++ b/kubernetes/nacos/pv.yaml
@@ -0,0 +1,22 @@
+apiVersion: v1
+kind: PersistentVolume
+metadata:
+ name: nacos-pv
+spec:
+ capacity:
+ storage: 10Gi
+ volumeMode: Filesystem
+ accessModes:
+ - ReadWriteOnce
+ persistentVolumeReclaimPolicy: Retain
+ storageClassName: local
+ local:
+ path: /var/lib/nacos
+ nodeAffinity:
+ required:
+ nodeSelectorTerms:
+ - matchExpressions:
+ - key: kubernetes.io/hostname
+ operator: In
+ values:
+ - master
\ No newline at end of file
diff --git a/kubernetes/nacos/pvc.yaml b/kubernetes/nacos/pvc.yaml
new file mode 100644
index 0000000..7fa5b06
--- /dev/null
+++ b/kubernetes/nacos/pvc.yaml
@@ -0,0 +1,11 @@
+apiVersion: v1
+kind: PersistentVolumeClaim
+metadata:
+ name: nacos-pvc
+spec:
+ accessModes:
+ - ReadWriteOnce
+ resources:
+ requests:
+ storage: 5Gi
+ storageClassName: local
\ No newline at end of file
diff --git a/kubernetes/nacos/service.yaml b/kubernetes/nacos/service.yaml
new file mode 100644
index 0000000..281f6c0
--- /dev/null
+++ b/kubernetes/nacos/service.yaml
@@ -0,0 +1,21 @@
+apiVersion: v1
+kind: Service
+metadata:
+ name: nacos
+ namespace: default
+spec:
+ selector:
+ app: nacos
+ ports:
+ - name: http
+ port: 8848
+ targetPort: 8848
+ - name: client-rpc
+ port: 9848
+ targetPort: 9848
+ - name: raft-rpc
+ port: 9849
+ targetPort: 9849
+ - name: old-raft-rpc
+ port: 7848
+ targetPort: 7848
\ No newline at end of file
diff --git a/kubernetes/nacos/statefulset.yaml b/kubernetes/nacos/statefulset.yaml
new file mode 100644
index 0000000..fb5ae44
--- /dev/null
+++ b/kubernetes/nacos/statefulset.yaml
@@ -0,0 +1,79 @@
+apiVersion: apps/v1
+kind: StatefulSet
+metadata:
+ name: nacos
+ namespace: default
+spec:
+ serviceName: nacos
+ replicas: 1
+ selector:
+ matchLabels:
+ app: nacos
+ template:
+ metadata:
+ labels:
+ app: nacos
+ spec:
+ containers:
+ - name: nacos
+ image: "nacos/nacos-server:latest"
+ imagePullPolicy: IfNotPresent
+ startupProbe:
+ httpGet:
+ scheme: HTTP
+ port: 8848
+ path: /nacos/v1/console/health/readiness
+ initialDelaySeconds: 10
+ periodSeconds: 5
+ timeoutSeconds: 10
+ livenessProbe:
+ httpGet:
+ scheme: HTTP
+ port: 8848
+ path: /nacos/v1/console/health/liveness
+ initialDelaySeconds: 10
+ periodSeconds: 5
+ timeoutSeconds: 10
+ ports:
+ - name: http
+ containerPort: 8848
+ protocol: TCP
+ - containerPort: 9848
+ name: client-rpc
+ - containerPort: 9849
+ name: raft-rpc
+ - containerPort: 7848
+ name: old-raft-rpc
+ env:
+ - name: NACOS_SERVER_PORT
+ value: "8848"
+ - name: NACOS_APPLICATION_PORT
+ value: "8848"
+ - name: PREFER_HOST_MODE
+ value: "hostname"
+ - name: MODE
+ value: "standalone"
+ - name: EMBEDDED_STORAGE
+ value: embedded
+ resources:
+ requests:
+ cpu: 100m
+ memory: 500Mi
+ volumeMounts:
+ - name: storage
+ mountPath: /var/lib/nacos
+ - name: data
+ mountPath: /home/nacos/plugins/peer-finder
+ subPath: peer-finder
+ - name: data
+ mountPath: /home/nacos/data
+ subPath: data
+ - name: data
+ mountPath: /home/nacos/logs
+ subPath: logs
+ volumes:
+ - name: data
+ emptyDir: {}
+ - name: storage
+ persistentVolumeClaim:
+ claimName: nacos-pvc
\ No newline at end of file
diff --git a/kubernetes/nacos/storageclass.yaml b/kubernetes/nacos/storageclass.yaml
new file mode 100644
index 0000000..f364d73
--- /dev/null
+++ b/kubernetes/nacos/storageclass.yaml
@@ -0,0 +1,6 @@
+apiVersion: storage.k8s.io/v1
+kind: StorageClass
+metadata:
+ name: local
+provisioner: kubernetes.io/no-provisioner
+volumeBindingMode: WaitForFirstConsumer
\ No newline at end of file