Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update official reference #137

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 22 additions & 36 deletions submitted/nacos/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 | `{}` |
Expand Down Expand Up @@ -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.
Expand All @@ -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)
75 changes: 0 additions & 75 deletions submitted/nacos/charts/mysql/templates/master-deployment.yaml

This file was deleted.

10 changes: 0 additions & 10 deletions submitted/nacos/charts/mysql/templates/master-pvc.yaml

This file was deleted.

16 changes: 0 additions & 16 deletions submitted/nacos/charts/mysql/templates/master-service.yaml

This file was deleted.

71 changes: 71 additions & 0 deletions submitted/nacos/charts/mysql/templates/mysql-deployment.yaml
Original file line number Diff line number Diff line change
@@ -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 }}
10 changes: 10 additions & 0 deletions submitted/nacos/charts/mysql/templates/mysql-pvc.yaml
Original file line number Diff line number Diff line change
@@ -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 }}
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
69 changes: 0 additions & 69 deletions submitted/nacos/charts/mysql/templates/slave-deployment.yaml

This file was deleted.

11 changes: 0 additions & 11 deletions submitted/nacos/charts/mysql/templates/slave-pvc.yaml

This file was deleted.

Loading