diff --git a/submitted/nacos/README.md b/submitted/nacos/README.md index cb1f9de..d0b125d 100644 --- a/submitted/nacos/README.md +++ b/submitted/nacos/README.md @@ -64,39 +64,25 @@ The following table lists the configurable parameters of the Skywalking chart an | `global.mode` | Run Mode (quickstart, standalone, cluster; quickstart: without mysql and pv) | `quickstart` | | `global.storageClass.provisioner` | Global storage class provisioner | `nil` | | `mysql.resources` | The [resources] to allocate for mysql container | `{}` | -| `mysql.nodeSelector` | Mysql labels for master and slave pod assignment | `{}` | +| `mysql.nodeSelector` | Mysql labels for mysql | `{}` | | `mysql.affinity` | Mysql affinity policy | `{}` | | `mysql.tolerations` | Mysql tolerations | `{}` | -| `mysql.replication.user` | Master-slave replication username | `nacos_ru` | -| `mysql.replication.password` | Master-slave replication password | `nacos_ru` | | `mysql.image.pullPolicy` | Mysql container image pull policy | `IfNotPresent` | -| `mysql.master.annotations` | Mysql master annotations | `{}` | -| `mysql.master.image.repository` | Mysql master container image name | `nacos/nacos-mysql-master` | -| `mysql.master.image.tag` | Mysql master container image tag | `latest` | -| `mysql.master.rootPassword` | Mysql master root password | `root` | -| `mysql.master.database` | Nacos database name | `nacos_devtest` | -| `mysql.master.user` | Nacos database user | `nacos` | -| `mysql.master.password` | Nacos database password | `nacos` | -| `mysql.master.classParameters` | Mysql master storageclass parameters | `{}` | -| `mysql.master.persistence.enabled` | Enable the Mysql master data persistence or not | `false` | -| `mysql.master.persistence.existingClaim`|Use the existing PVC which must be created manually before bound, and specify the `subPath` if the PVC is shared with other components | `mysql-master-data` | -| `mysql.master.persistence.claim.name` | Mysql master pvc name | `mysql-master-data` | -| `mysql.master.persistence.claim.spec.accessModes` | Mysql master pvc access mode | `ReadWriteOnce` | -| `mysql.master.persistence.claim.spec.resources.requests.storage` | Mysql master pvc requests storage | `5G` | -| `mysql.master.persistence.claim.spec.storageClassName`| Mysql master pvc storage class name | `sc-mysql-master` | -| `mysql.master.service.port` | Mysql master service port | `3306` | -| `mysql.slave.annotations` | Mysql slave annotations | `{}` | -| `mysql.slave.image.repository` | Mysql slave container image name | `nacos/nacos-mysql-slave` | -| `mysql.slave.image.tag` | Mysql slave container image tag | `latest` | -| `mysql.slave.rootPassword` | Mysql slave root password | `root` | -| `mysql.slave.classParameters` | Mysql slave storageclass parameters | `{}` | -| `mysql.slave.persistence.enabled` | Enable the mysql slave data persistence or not | `false` | -| `mysql.slave.persistence.existingClaim`|Use the existing PVC which must be created manually before bound, and specify the `subPath` if the PVC is shared with other components | `mysql-slave-data` | -| `mysql.slave.persistence.claim.name` | Mysql slave pvc name | `mysql-slave-data` | -| `mysql.slave.persistence.claim.spec.accessModes` | Mysql slave pvc access mode | `ReadWriteOnce` | -| `mysql.slave.persistence.claim.spec.resources.requests.storage` | Mysql slave pvc requests storage | `5G` | -| `mysql.slave.persistence.claim.spec.storageClassName`| Mysql slave pvc storage class name | `sc-mysql-slave` | -| `mysql.slave.service.port` | Mysql slave service port | `3306` | +| `mysql.annotations` | Mysql annotations | `{}` | +| `mysql.image.repository` | Mysql container image name | `nacos/nacos-mysql` | +| `mysql.image.tag` | Mysql container image tag | `5.7` | +| `mysql.rootPassword` | Mysql root password | `root` | +| `mysql.database` | Nacos database name | `nacos_devtest` | +| `mysql.user` | Nacos database user | `nacos` | +| `mysql.password` | Nacos database password | `nacos` | +| `mysql.classParameters` | Mysql storageclass parameters | `{}` | +| `mysql.persistence.enabled` | Enable the data persistence or not | `false` | +| `mysql.persistence.existingClaim`|Use the existing PVC which must be created manually before bound, and specify the `subPath` if the PVC is shared with other components | `mysql-data` | +| `mysql.persistence.claim.name` | Mysql pvc name | `mysql-data` | +| `mysql.persistence.claim.spec.accessModes` | Mysql pvc access mode | `ReadWriteOnce` | +| `mysql.persistence.claim.spec.resources.requests.storage` | Mysql pvc requests storage | `5G` | +| `mysql.persistence.claim.spec.storageClassName`| Mysql pvc storage class name | `sc-mysql` | +| `mysql.service.port` | Mysql service port | `3306` | | `resources` | The [resources] to allocate for nacos container | `{}` | | `nodeSelector` | Nacos labels for pod assignment | `{}` | | `affinity` | Nacos affinity policy | `{}` | @@ -131,18 +117,18 @@ The following table lists the configurable parameters of the Skywalking chart an ## Example -![img](./images/nacos.png) +![img](images/nacos.png) #### quickstart mode(without mysql) ```console $ helm install `release name` ./ --set global.mode=quickstart ``` -![img](./images/quickstart.png) +![img](images/quickstart.png) #### standalone mode(without pv) ```console $ helm install `release name` ./ --set global.mode=standalone ``` -![img](./images/standalone.png) +![img](images/standalone.png) > **Tip**: if the logs of nacos pod throws exception, you may need to delete the pod. Because mysql pod is not ready, nacos pod has been started. @@ -151,13 +137,13 @@ $ helm install `release name` ./ --set global.mode=standalone ```console $ helm install `release name` ./ --set global.mode=cluster ``` -![img](./images/cluster1.png) +![img](images/cluster1.png) ```console $ kubectl scale sts `release name`-nacos --replicas=3 ``` -![img](./images/cluster2.png) +![img](images/cluster2.png) * Use kubectl exec to get the cluster config of the Pods in the nacos StatefulSet after scale StatefulSets -![img](./images/cluster3.png) +![img](images/cluster3.png) diff --git a/submitted/nacos/charts/mysql/templates/master-deployment.yaml b/submitted/nacos/charts/mysql/templates/master-deployment.yaml deleted file mode 100644 index 6e4bbdb..0000000 --- a/submitted/nacos/charts/mysql/templates/master-deployment.yaml +++ /dev/null @@ -1,75 +0,0 @@ -{{- if ne .Values.global.mode "quickstart" }} -apiVersion: v1 -kind: ReplicationController -metadata: - name: mysql-master - labels: - name: mysql-master - {{- if .Values.master.annotations }} - annotations: -{{ toYaml .Values.master.annotations | indent 4 }} - {{- end }} -spec: - replicas: 1 - selector: - name: mysql-master - template: - metadata: - labels: - name: mysql-master - spec: - containers: - - name: master - image: "{{ .Values.master.image.repository }}:{{ .Values.master.image.tag }}" - imagePullPolicy: {{ .Values.image.pullPolicy }} - ports: - - name: mysql - containerPort: 3306 - protocol: TCP - volumeMounts: - - name: mysql-master-data - mountPath: /var/lib/mysql - env: - - name: MYSQL_ROOT_PASSWORD - value: {{ .Values.master.rootPassword | quote }} - - name: MYSQL_DATABASE - value: {{ .Values.master.database | quote }} - - name: MYSQL_USER - value: {{ .Values.master.user | quote }} - - name: MYSQL_PASSWORD - value: {{ .Values.master.password | quote }} - - name: MYSQL_REPLICATION_USER - value: {{ .Values.replication.user | quote }} - - name: MYSQL_REPLICATION_PASSWORD - value: {{ .Values.replication.password | quote }} - resources: - {{- toYaml .Values.resources | nindent 12 }} - {{- if not .Values.master.persistence.enabled }} - volumes: - - name: mysql-master-data - emptyDir: {} - {{- else if .Values.master.persistence.existingClaim }} - volumes: - - name: mysql-master-data - persistentVolumeClaim: - claimName: {{ .Values.master.persistence.existingClaim }} - {{- end }} - {{- if and .Values.master.persistence.enabled (not .Values.master.persistence.existingClaim) }} - volumes: - - name: mysql-master-data - persistentVolumeClaim: - claimName: {{ .Values.master.persistence.claim}} - {{- end}} - {{- with .Values.nodeSelector }} - nodeSelector: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.affinity }} - affinity: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.tolerations }} - tolerations: - {{- toYaml . | nindent 8 }} - {{- end }} -{{- end }} diff --git a/submitted/nacos/charts/mysql/templates/master-pvc.yaml b/submitted/nacos/charts/mysql/templates/master-pvc.yaml deleted file mode 100644 index 8e771db..0000000 --- a/submitted/nacos/charts/mysql/templates/master-pvc.yaml +++ /dev/null @@ -1,10 +0,0 @@ -{{- if ne .Values.global.mode "quickstart" }} -{{- if and .Values.master.persistence.enabled (not .Values.master.persistence.existingClaim) -}} -kind: PersistentVolumeClaim -apiVersion: v1 -metadata: - name: {{ .Values.master.persistence.claim.name }} -spec: - {{ toYaml .Values.master.persistence.claim.spec | indent 2 }} -{{- end }} -{{- end }} diff --git a/submitted/nacos/charts/mysql/templates/master-service.yaml b/submitted/nacos/charts/mysql/templates/master-service.yaml deleted file mode 100644 index 69c99b8..0000000 --- a/submitted/nacos/charts/mysql/templates/master-service.yaml +++ /dev/null @@ -1,16 +0,0 @@ -{{- if ne .Values.global.mode "quickstart" }} -apiVersion: v1 -kind: Service -metadata: - name: mysql-master - labels: - name: mysql-master -spec: - ports: - - port: {{ .Values.master.service.port }} - targetPort: mysql - protocol: TCP - name: mysql - selector: - name: mysql-master -{{- end }} diff --git a/submitted/nacos/charts/mysql/templates/mysql-deployment.yaml b/submitted/nacos/charts/mysql/templates/mysql-deployment.yaml new file mode 100644 index 0000000..5003973 --- /dev/null +++ b/submitted/nacos/charts/mysql/templates/mysql-deployment.yaml @@ -0,0 +1,71 @@ +{{- if ne .Values.global.mode "quickstart" }} +apiVersion: v1 +kind: ReplicationController +metadata: + name: mysql + labels: + name: mysql + {{- if .Values.mysql.annotations }} + annotations: +{{ toYaml .Values.mysql.annotations | indent 4 }} + {{- end }} +spec: + replicas: 1 + selector: + name: mysql + template: + metadata: + labels: + name: mysql + spec: + containers: + - name: mysql + image: "{{ .Values.mysql.image.repository }}:{{ .Values.mysql.image.tag }}" + imagePullPolicy: {{ .Values.mysql.image.pullPolicy }} + ports: + - name: mysql + containerPort: 3306 + protocol: TCP + volumeMounts: + - name: mysql-data + mountPath: /var/lib/mysql + env: + - name: MYSQL_ROOT_PASSWORD + value: {{ .Values.mysql.rootPassword | quote }} + - name: MYSQL_DATABASE + value: {{ .Values.mysql.database | quote }} + - name: MYSQL_USER + value: {{ .Values.mysql.user | quote }} + - name: MYSQL_PASSWORD + value: {{ .Values.mysql.password | quote }} + resources: + {{- toYaml .Values.resources | nindent 12 }} + {{- if not .Values.mysql.persistence.enabled }} + volumes: + - name: mysql-data + emptyDir: {} + {{- else if .Values.mysql.persistence.existingClaim }} + volumes: + - name: mysql-data + persistentVolumeClaim: + claimName: {{ .Values.mysql.persistence.existingClaim }} + {{- end }} + {{- if and .Values.mysql.persistence.enabled (not .Values.mysql.persistence.existingClaim) }} + volumes: + - name: mysql-data + persistentVolumeClaim: + claimName: {{ .Values.mysql.persistence.claim}} + {{- end}} + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} +{{- end }} diff --git a/submitted/nacos/charts/mysql/templates/mysql-pvc.yaml b/submitted/nacos/charts/mysql/templates/mysql-pvc.yaml new file mode 100644 index 0000000..5de9b2a --- /dev/null +++ b/submitted/nacos/charts/mysql/templates/mysql-pvc.yaml @@ -0,0 +1,10 @@ +{{- if ne .Values.global.mode "quickstart" }} +{{- if and .Values.mysql.persistence.enabled (not .Values.mysql.persistence.existingClaim) -}} +kind: PersistentVolumeClaim +apiVersion: v1 +metadata: + name: {{ .Values.mysql.persistence.claim.name }} +spec: + {{ toYaml .Values.mysql.persistence.claim.spec | indent 2 }} +{{- end }} +{{- end }} diff --git a/submitted/nacos/charts/mysql/templates/slave-service.yaml b/submitted/nacos/charts/mysql/templates/mysql-service.yaml similarity index 64% rename from submitted/nacos/charts/mysql/templates/slave-service.yaml rename to submitted/nacos/charts/mysql/templates/mysql-service.yaml index e9eed28..8d5c880 100644 --- a/submitted/nacos/charts/mysql/templates/slave-service.yaml +++ b/submitted/nacos/charts/mysql/templates/mysql-service.yaml @@ -2,15 +2,15 @@ apiVersion: v1 kind: Service metadata: - name: mysql-slave + name: mysql labels: - name: mysql-slave + name: mysql spec: ports: - - port: {{ .Values.slave.service.port }} + - port: {{ .Values.mysql.service.port }} targetPort: mysql protocol: TCP name: mysql selector: - name: mysql-slave + name: mysql {{- end }} diff --git a/submitted/nacos/charts/mysql/templates/slave-deployment.yaml b/submitted/nacos/charts/mysql/templates/slave-deployment.yaml deleted file mode 100644 index e9716ee..0000000 --- a/submitted/nacos/charts/mysql/templates/slave-deployment.yaml +++ /dev/null @@ -1,69 +0,0 @@ -{{- if ne .Values.global.mode "quickstart" }} -apiVersion: v1 -kind: ReplicationController -metadata: - name: mysql-slave - labels: - name: mysql-slave - {{- if .Values.slave.annotations }} - annotations: -{{ toYaml .Values.slave.annotations | indent 4 }} - {{- end }} -spec: - replicas: 1 - selector: - name: mysql-slave - template: - metadata: - labels: - name: mysql-slave - spec: - containers: - - name: slave - image: "{{ .Values.slave.image.repository }}:{{ .Values.slave.image.tag }}" - imagePullPolicy: {{ .Values.image.pullPolicy }} - ports: - - name: mysql - containerPort: 3306 - protocol: TCP - volumeMounts: - - name: mysql-slave-data - mountPath: /var/lib/mysql - env: - - name: MYSQL_ROOT_PASSWORD - value: {{ .Values.slave.rootPassword | quote }} - - name: MYSQL_REPLICATION_USER - value: {{ .Values.replication.user | quote }} - - name: MYSQL_REPLICATION_PASSWORD - value: {{ .Values.replication.password | quote }} - resources: - {{- toYaml .Values.resources | nindent 12 }} - {{- if not .Values.slave.persistence.enabled }} - volumes: - - name: mysql-slave-data - emptyDir: {} - {{- else if .Values.slave.persistence.existingClaim }} - volumes: - - name: mysql-slave-data - persistentVolumeClaim: - claimName: {{ .Values.slave.persistence.existingClaim }} - {{- end }} - {{- if and .Values.slave.persistence.enabled (not .Values.slave.persistence.existingClaim) }} - volumes: - - name: mysql-slave-data - persistentVolumeClaim: - claimName: {{ .Values.slave.persistence.claim}} - {{- end}} - {{- with .Values.nodeSelector }} - nodeSelector: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.affinity }} - affinity: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.tolerations }} - tolerations: - {{- toYaml . | nindent 8 }} - {{- end }} -{{- end }} diff --git a/submitted/nacos/charts/mysql/templates/slave-pvc.yaml b/submitted/nacos/charts/mysql/templates/slave-pvc.yaml deleted file mode 100644 index 2aa64fc..0000000 --- a/submitted/nacos/charts/mysql/templates/slave-pvc.yaml +++ /dev/null @@ -1,11 +0,0 @@ -{{- if ne .Values.global.mode "quickstart" }} -{{- if and .Values.slave.persistence.enabled (not .Values.slave.persistence.existingClaim) -}} -kind: PersistentVolumeClaim -apiVersion: v1 -metadata: - name: {{ .Values.slave.persistence.claim.name }} -spec: - {{ toYaml .Values.master.persistence.claim.spec | indent 2 }} -{{- end }} -{{- end }} - diff --git a/submitted/nacos/charts/mysql/templates/storageclass.yaml b/submitted/nacos/charts/mysql/templates/storageclass.yaml index d04e495..0172513 100644 --- a/submitted/nacos/charts/mysql/templates/storageclass.yaml +++ b/submitted/nacos/charts/mysql/templates/storageclass.yaml @@ -1,21 +1,11 @@ -{{- if and .Values.master.persistence.enabled (not .Values.master.persistence.existingClaim) -}} +{{- if and .Values.mysql.persistence.enabled (not .Values.mysql.persistence.existingClaim) -}} apiVersion: storage.k8s.io/v1 kind: StorageClass metadata: - name: {{ .Values.master.persistence.claim.spec.storageClassName }} + name: {{ .Values.mysql.persistence.claim.spec.storageClassName }} provisioner: {{ toYaml .Values.global.storageClass.provisioner | indent 2 }} parameters: -{{ toYaml .Values.master.classParameters | indent 2 }} -{{- end }} ---- -{{- if and .Values.slave.persistence.enabled (not .Values.slave.persistence.existingClaim) -}} -apiVersion: storage.k8s.io/v1 -kind: StorageClass -metadata: - name: {{ .Values.slave.persistence.claim.spec.storageClassName }} -provisioner: -{{ toYaml .Values.global.storageClass.provisioner | indent 2 }} -parameters: -{{ toYaml .Values.slave.classParameters | indent 2 }} +{{ toYaml .Values.mysql.classParameters | indent 2 }} {{- end }} + diff --git a/submitted/nacos/charts/mysql/values.yaml b/submitted/nacos/charts/mysql/values.yaml index e69de29..98a0b39 100644 --- a/submitted/nacos/charts/mysql/values.yaml +++ b/submitted/nacos/charts/mysql/values.yaml @@ -0,0 +1,47 @@ +## Default values for nacos. +## This is a YAML-formatted file. +## Declare variables to be passed into your templates. +# +#global: +# mode: quickstart +# #mode: standalone +# #mode: cluster +# storageClass: +# provisioner: +# #nfs +# # provisioner: fuseim.pri/ifs +# ###ceph +# # provisioner: ceph.com/rbd +# +#############################mysql########################### +############################mysql########################### +mysql: + annotations: {} + resources: {} + nodeSelector: {} + affinity: {} + tolerations: {} + service: + port: 3306 + rootPassword: root + database: nacos_devtest + user: nacos + password: nacos + image: + pullPolicy: IfNotPresent + repository: nacos/nacos-mysql + tag: 5.7 + classParameters: {} + persistence: + enabled: false + existingClaim: mysql-data + #existingClaim: + claim: + name: mysql-data + spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 5G + storageClassName: sc-mysql diff --git a/submitted/nacos/images/cluster1.png b/submitted/nacos/images/cluster1.png old mode 100644 new mode 100755 diff --git a/submitted/nacos/images/cluster2.png b/submitted/nacos/images/cluster2.png old mode 100644 new mode 100755 diff --git a/submitted/nacos/images/cluster3.png b/submitted/nacos/images/cluster3.png old mode 100644 new mode 100755 diff --git a/submitted/nacos/images/nacos.png b/submitted/nacos/images/nacos.png old mode 100644 new mode 100755 diff --git a/submitted/nacos/images/quickstart.png b/submitted/nacos/images/quickstart.png old mode 100644 new mode 100755 diff --git a/submitted/nacos/images/standalone.png b/submitted/nacos/images/standalone.png old mode 100644 new mode 100755 diff --git a/submitted/nacos/templates/configmap.yaml b/submitted/nacos/templates/configmap.yaml index b4bb080..cd903e8 100644 --- a/submitted/nacos/templates/configmap.yaml +++ b/submitted/nacos/templates/configmap.yaml @@ -4,11 +4,10 @@ kind: ConfigMap metadata: name: nacos-cm data: - {{- with .Values.mysql.master }} - mysql.master.db.name: {{ .database }} - mysql.master.port: "3306" - mysql.slave.port: "3306" - mysql.master.user: {{ .user }} - mysql.master.password: {{ .password }} + {{- with .Values.mysql }} + mysql.db.name: {{ .database }} + mysql.port: "3306" + mysql.user: {{ .user }} + mysql.password: {{ .password }} {{- end }} {{- end }} diff --git a/submitted/nacos/templates/deployment.yaml b/submitted/nacos/templates/deployment.yaml index c4c5e1a..35cbe80 100644 --- a/submitted/nacos/templates/deployment.yaml +++ b/submitted/nacos/templates/deployment.yaml @@ -24,7 +24,7 @@ spec: {{- if eq .Values.global.mode "cluster" }} initContainers: - name: peer-finder-plugin-install - image: nacos/nacos-peer-finder-plugin:latest + image: nacos/nacos-peer-finder-plugin:1.0 imagePullPolicy: Always volumeMounts: - mountPath: /home/nacos/plugins/peer-finder @@ -38,20 +38,9 @@ spec: - name: http containerPort: {{ .Values.env.serverPort }} protocol: TCP -{{- if .Values.health.enabled }} - livenessProbe: - httpGet: - path: /nacos/v1/console/health/readiness - port: http - initialDelaySeconds: 60 - timeoutSeconds: 3 - readinessProbe: - httpGet: - path: /nacos/v1/console/health/readiness - port: http - initialDelaySeconds: 60 - timeoutSeconds: 3 -{{- end }} + - name: rpc + containerPort: 7848 + protocol: TCP resources: {{- toYaml .Values.resources | nindent 12 }} {{- if eq .Values.global.mode "quickstart" }} @@ -68,33 +57,30 @@ spec: value: "standalone" - name: SPRING_DATASOURCE_PLATFORM value: "mysql" - - name: MYSQL_MASTER_SERVICE_DB_NAME + - name: MYSQL_SERVICE_DB_NAME valueFrom: configMapKeyRef: name: nacos-cm - key: mysql.master.db.name - - name: MYSQL_MASTER_SERVICE_PORT - valueFrom: - configMapKeyRef: - name: nacos-cm - key: mysql.master.port - - name: MYSQL_SLAVE_SERVICE_PORT + key: mysql.db.name + - name: MYSQL_SERVICE_PORT valueFrom: configMapKeyRef: name: nacos-cm - key: mysql.slave.port - - name: MYSQL_MASTER_SERVICE_USER + key: mysql.port + - name: MYSQL_SERVICE_USER valueFrom: configMapKeyRef: name: nacos-cm - key: mysql.master.user - - name: MYSQL_MASTER_SERVICE_PASSWORD + key: mysql.user + - name: MYSQL_SERVICE_PASSWORD valueFrom: configMapKeyRef: name: nacos-cm - key: mysql.master.password + key: mysql.password - name: NACOS_SERVER_PORT value: {{ .Values.env.serverPort | quote }} + - name: NACOS_APPLICATION_PORT + value: {{ .Values.env.serverPort | quote }} volumeMounts: - name: datadir mountPath: /home/nacos/data @@ -109,6 +95,8 @@ spec: value: "3" - name: SERVICE_NAME value: "nacos-hs" + - name: DOMAIN_NAME + value: {{ .Values.env.domainName | quote }} - name: POD_NAMESPACE valueFrom: fieldRef: @@ -116,33 +104,34 @@ spec: fieldPath: metadata.namespace - name: PREFER_HOST_MODE value: {{ .Values.env.preferhostmode | quote }} - - name: MYSQL_MASTER_SERVICE_DB_NAME + {{- if .Values.env.dbHost }} + - name: MYSQL_SERVICE_HOST + value: {{ .Values.env.dbHost | quote }} + {{- end }} + - name: MYSQL_SERVICE_DB_NAME valueFrom: configMapKeyRef: name: nacos-cm - key: mysql.master.db.name - - name: MYSQL_MASTER_SERVICE_PORT + key: mysql.db.name + - name: MYSQL_SERVICE_PORT valueFrom: configMapKeyRef: name: nacos-cm - key: mysql.master.port - - name: MYSQL_SLAVE_SERVICE_PORT + key: mysql.port + - name: MYSQL_SERVICE_USER valueFrom: configMapKeyRef: name: nacos-cm - key: mysql.slave.port - - name: MYSQL_MASTER_SERVICE_USER + key: mysql.user + - name: MYSQL_SERVICE_PASSWORD valueFrom: configMapKeyRef: name: nacos-cm - key: mysql.master.user - - name: MYSQL_MASTER_SERVICE_PASSWORD - valueFrom: - configMapKeyRef: - name: nacos-cm - key: mysql.master.password + key: mysql.password - name: NACOS_SERVER_PORT value: {{ .Values.env.serverPort | quote }} + - name: NACOS_APPLICATION_PORT + value: {{ .Values.env.serverPort | quote }} volumeMounts: - name: plugindir mountPath: /home/nacos/plugins/peer-finder diff --git a/submitted/nacos/templates/service.yaml b/submitted/nacos/templates/service.yaml index 1217e0d..9e7af9d 100644 --- a/submitted/nacos/templates/service.yaml +++ b/submitted/nacos/templates/service.yaml @@ -3,14 +3,19 @@ apiVersion: v1 kind: Service metadata: name: nacos-hs + annotations: + service.alpha.kubernetes.io/tolerate-unready-endpoints: "true" spec: - type: ClusterIP clusterIP: None ports: - port: {{ .Values.service.port }} targetPort: http protocol: TCP name: http + - port: 7848 + name: rpc + targetPort: 7848 + protocol: TCP selector: app.kubernetes.io/name: {{ include "nacos.name" . }} app.kubernetes.io/instance: {{ .Release.Name }} @@ -34,6 +39,12 @@ spec: {{- if eq .Values.service.type "NodePort" }} nodePort: {{ .Values.service.nodePort }} {{- end }} + - port: 7848 + name: rpc + targetPort: 7848 + {{- if eq .Values.service.type "NodePort" }} + nodePort: {{ .Values.service.rpcPort }} + {{- end }} selector: app.kubernetes.io/name: {{ include "nacos.name" . }} app.kubernetes.io/instance: {{ .Release.Name }} diff --git a/submitted/nacos/values.yaml b/submitted/nacos/values.yaml index 1bda6df..61e7c58 100644 --- a/submitted/nacos/values.yaml +++ b/submitted/nacos/values.yaml @@ -14,33 +14,39 @@ global: # provisioner: ceph.com/rbd ############################mysql########################### -mysql: +mysql: + annotations: {} resources: {} nodeSelector: {} affinity: {} tolerations: {} - - replication: - user: nacos_ru - password: nacos_ru - + service: + port: 3306 + rootPassword: root + database: nacos_devtest + user: nacos + password: nacos image: pullPolicy: IfNotPresent - #####master##### - master: - annotations: {} + repository: nacos/nacos-mysql + tag: 5.7 + classParameters: {} + persistence: + enabled: false + existingClaim: mysql-data + #existingClaim: + claim: + name: mysql-data + spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 5G + storageClassName: sc-mysql - image: - repository: nacos/nacos-mysql-master - tag: latest - rootPassword: root - - database: nacos_devtest - user: nacos - password: nacos - classParameters: {} ######nfs # archiveOnDelete: "false" @@ -58,68 +64,10 @@ mysql: # imageFormat: "2" # imageFeatures: "layering" - persistence: - enabled: false - existingClaim: mysql-master-data - #existingClaim: - claim: - name: mysql-master-data - spec: - accessModes: - - ReadWriteOnce - resources: - requests: - storage: 5G - storageClassName: sc-mysql-master - - service: - port: 3306 - - #####slave##### - - slave: - annotations: {} - - image: - repository: nacos/nacos-mysql-slave - tag: latest - rootPassword: root - classParameters: {} -######nfs -# archiveOnDelete: "false" -######ceph -# monitors: 10.144.131.48:6789 -# adminId: admin -# adminSecretName: ceph-secret-admin -# adminSecretNamespace: nacos -# pool: nacos-mysql-slave-data -# userId: mysql-slave -# userSecretName: ceph-secret-mysql-slave -# userSecretNamespace: nacos -# fsType: ext4 -# imageFormat: "2" -# imageFeatures: "layering" - - persistence: - enabled: false - existingClaim: mysql-slave-data - #existingClaim: - claim: - name: mysql-slave-data - spec: - accessModes: - - ReadWriteOnce - resources: - requests: - storage: 5G - storageClassName: sc-mysql-slave - - service: - port: 3306 ############################mysql########################### ############################nacos########################### @@ -127,15 +75,17 @@ replicaCount: 1 image: repository: nacos/nacos-server - tag: 0.9.0 + tag: latest pullPolicy: IfNotPresent health: enabled: false env: + domainName: cluster.local preferhostmode: hostname serverPort: 8848 +# dbHost: 127.0.0.1 persistence: enabled: false @@ -168,6 +118,8 @@ service: type: NodePort port: 8848 nodePort: 30000 + rpcPort: 7848 + ingress: enabled: false