kind: StatefulSet
apiVersion: apps/v1
metadata:
name: nacos-v1
namespace: health-examination-api
labels:
app: nacos
version: v1
annotations:
kubesphere.io/creator: project-admin
spec:
replicas: 2
selector:
matchLabels:
app: nacos
version: v1
template:
metadata:
creationTimestamp: null
labels:
app: nacos
version: v1
annotations:
kubesphere.io/restartedAt: '2021-06-08T07:35:59.555Z'
logging.kubesphere.io/logsidecar-config: '{}'
spec:
containers:
- name: nacos-v1
image: 'nacos/nacos-server:1.3.1'
ports:
- name: tcp-8848
containerPort: 8848
protocol: TCP
env:
- name: JVM_XMS
value: 512m
- name: JVM_XMX
value: 512m
- name: JVM_XMN
value: 200m
- name: NACOS_REPLICAS
value: '2'
- name: MYSQL_SERVICE_DB_NAME
valueFrom:
configMapKeyRef:
name: nacos-config
key: mysql.db.name
- name: MYSQL_SERVICE_HOST
valueFrom:
configMapKeyRef:
name: nacos-config
key: mysql.db.host
- name: MYSQL_SERVICE_PORT
valueFrom:
configMapKeyRef:
name: nacos-config
key: mysql.db.port
- name: MYSQL_SERVICE_USER
valueFrom:
configMapKeyRef:
name: nacos-config
key: mysql.user
- name: MYSQL_SERVICE_PASSWORD
value: ONEhealth!@#
- name: SPRING_DATASOURCE_PLATFORM
value: mysql
- name: NACOS_SERVER_PORT
value: '8848'
- name: PREFER_HOST_MODE
value: hostname
- name: NACOS_SERVERS
value: >-
nacos-v1-0.nacos.health-examination-api.svc.cluster.local:8848
nacos-v1-1.nacos.health-examination-api.svc.cluster.local:8848
resources:
limits:
cpu: 500m
memory: 500Mi
volumeMounts:
- name: nacos-pvc
mountPath: /home/nacos/data
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
imagePullPolicy: IfNotPresent
restartPolicy: Always
terminationGracePeriodSeconds: 30
dnsPolicy: ClusterFirst
serviceAccountName: default
serviceAccount: default
securityContext: {}
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 100
podAffinityTerm:
labelSelector:
matchLabels:
app: nacos
version: v1
topologyKey: kubernetes.io/hostname
schedulerName: default-scheduler
volumeClaimTemplates:
- kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: nacos-pvc
namespace: health-examination-api
creationTimestamp: null
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 5Gi
storageClassName: local
volumeMode: Filesystem
status:
phase: Pending
serviceName: nacos
podManagementPolicy: OrderedReady
updateStrategy:
type: RollingUpdate
rollingUpdate:
partition: 0
revisionHistoryLimit: 10
---
kind: Service
apiVersion: v1
metadata:
name: nacos
namespace: health-examination-api
labels:
app: nacos
version: v1
annotations:
kubesphere.io/creator: project-admin
kubesphere.io/serviceType: statefulservice
spec:
ports:
- name: tcp-8848
protocol: TCP
port: 8848
targetPort: 8848
selector:
app: nacos
clusterIP: None
type: ClusterIP
sessionAffinity: None
---
kind: ConfigMap
apiVersion: v1
metadata:
name: nacos-config
namespace: health-examination-api
annotations:
kubesphere.io/creator: project-admin
data:
mysql.db.host: '127.0.0.1'
mysql.db.name: nacos_config
mysql.db.port: '3306'
mysql.password: root
mysql.user: root
---
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: nacos-pvc-nacos-v1-1
namespace: health-examination-api
labels:
app: nacos
version: v1
annotations:
pv.kubernetes.io/bind-completed: 'yes'
pv.kubernetes.io/bound-by-controller: 'yes'
volume.beta.kubernetes.io/storage-provisioner: openebs.io/local
volume.kubernetes.io/selected-node: node1
finalizers:
- kubernetes.io/pvc-protection
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 5Gi
volumeName: pvc-2625f416-92a8-4ae2-9eee-21f536c600fc
storageClassName: local
volumeMode: Filesystem