diff --git a/charts/dubbo-admin/values.yaml b/charts/dubbo-admin/values.yaml index 21ad2301e..c229a4665 100644 --- a/charts/dubbo-admin/values.yaml +++ b/charts/dubbo-admin/values.yaml @@ -125,11 +125,11 @@ serverCompression: minResponseSize: 10240 zookeeper: - enabled: false + enabled: true address: zookeeper://zookeeper:2181 nacos: - enabled: true + enabled: false address: nacos://nacos:8848 group: DEFAULT_GROUP namespace: public diff --git a/docker/0.3.0/test.sh b/docker/0.3.0/test.sh old mode 100755 new mode 100644 diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh old mode 100755 new mode 100644 diff --git a/kubernetes/dubbo-admin.yaml b/kubernetes/dubbo-admin.yaml new file mode 100644 index 000000000..ee1dc2456 --- /dev/null +++ b/kubernetes/dubbo-admin.yaml @@ -0,0 +1,138 @@ +--- +# Source: dubbo-admin/templates/cm.yaml +apiVersion: v1 +kind: ConfigMap +metadata: + name: dubbo-admin-cm + namespace: default +data: + application.properties: |- + admin.registry.address: zookeeper://zookeeper:2181 + admin.config-center: zookeeper://zookeeper:2181 + admin.metadata-report.address: zookeeper://zookeeper:2181 + admin.root.user.name: root + admin.root.user.password: root + admin.check.tokenTimeoutMilli: 3600000 + admin.check.sessionTimeoutMilli: 3600000 + admin.check.signSecret: + server.compression.enabled: true + server.compression.mime-types: text/css,text/javascript,application/javascript + server.compression.min-response-size: 10240 + dubbo.application.name: dubbo-admin + dubbo.application.logger: slf4j + dubbo.registry.address: ${admin.registry.address} + spring.datasource.url: jdbc:h2:mem:~/dubbo-admin;MODE=MYSQL; + spring.datasource.username: sa + spring.datasource.password: + mybatis-plus.global-config.db-config.id-type: none +--- +# Source: dubbo-admin/templates/svc.yaml +apiVersion: v1 +kind: Service +metadata: + name: dubbo-admin + namespace: default +spec: + type: ClusterIP + ports: + - name: http + port: 38080 + protocol: TCP + targetPort: http +--- +# Source: dubbo-admin/templates/svc.yaml +apiVersion: v1 +kind: Service +metadata: + name: dubbo-admin-headless + namespace: default +spec: + type: ClusterIP + clusterIP: None + ports: + - name: http + port: 38080 + protocol: TCP + targetPort: http + appProtocol: +--- +# Source: dubbo-admin/templates/deploy.yaml +apiVersion: apps/v1 +kind: Deployment +metadata: + name: dubbo-admin + namespace: default +spec: + replicas: 1 + selector: + matchLabels: + + app.kubernetes.io/name: dubbo-admin + helm.sh/chart: dubbo-admin-0.5.0 + app.kubernetes.io/instance: dubbo-admin + app.kubernetes.io/managed-by: Helm + template: + metadata: + labels: + + app.kubernetes.io/name: dubbo-admin + helm.sh/chart: dubbo-admin-0.5.0 + app.kubernetes.io/instance: dubbo-admin + app.kubernetes.io/managed-by: Helm + spec: + imagePullSecrets: + null + nodeSelector: + null + affinity: + null + tolerations: + null + containers: + - name: dubbo-admin + image: "apache/dubbo-admin:0.5.0" + imagePullPolicy: IfNotPresent + ports: + - name: http + containerPort: 8080 + volumeMounts: + - mountPath: /config + name: application-properties + readOnly: true + - mountPath: /storage + name: storage + readOnly: true + livenessProbe: + httpGet: + path: / + port: 8080 + initialDelaySeconds: 60 + timeoutSeconds: 30 + periodSeconds: 10 + successThreshold: 1 + failureThreshold: 3 + readinessProbe: + httpGet: + path: / + port: 8080 + initialDelaySeconds: 60 + timeoutSeconds: 30 + periodSeconds: 10 + successThreshold: 1 + failureThreshold: 3 + startupProbe: + httpGet: + path: / + port: 8080 + initialDelaySeconds: 60 + timeoutSeconds: 30 + periodSeconds: 10 + successThreshold: 1 + failureThreshold: 3 + resources: + {} + volumes: + - name: application-properties + configMap: + name: dubbo-admin-cm + - name: storage diff --git a/kubernetes/dubbo-admin/configmap.yaml b/kubernetes/dubbo-admin/configmap.yaml deleted file mode 100644 index 1e84c9d0f..000000000 --- a/kubernetes/dubbo-admin/configmap.yaml +++ /dev/null @@ -1,54 +0,0 @@ -apiVersion: v1 -kind: ConfigMap -metadata: - name: dubbo-admin - namespace: default -data: - application.properties: | - admin.registry.address=zookeeper://zookeeper:2181 - admin.config-center=zookeeper://zookeeper:2181 - admin.metadata-report.address=zookeeper://zookeeper:2181 - admin.root.user.name=root - admin.root.user.password=root - admin.check.sessionTimeoutMilli=3600000 - server.compression.enabled=true - server.compression.mime-types=text/css,text/javascript,application/javascript - server.compression.min-response-size=10240 - admin.check.tokenTimeoutMilli=3600000 - admin.check.signSecret=86295dd0c4ef69a1036b0b0c15158d77 - dubbo.application.name=dubbo-admin - dubbo.registry.address=${admin.registry.address} - spring.datasource.url=jdbc:h2:mem:~/dubbo-admin;MODE=MYSQL; - spring.datasource.username=sa - spring.datasource.password= - mybatis-plus.global-config.db-config.id-type=none - dubbo.application.logger=slf4j - - # nacos config, add parameters to url like username=nacos&password=nacos - # admin.registry.address=nacos://127.0.0.1:8848?group=DEFAULT_GROUP&namespace=public - # admin.config-center=nacos://127.0.0.1:8848?group=dubbo - # admin.metadata-report.address=nacos://127.0.0.1:8848?group=dubbo - - - # group (Deprecated it is recommended to use URL to add parameters,will be removed in the future) - # admin.registry.group=dubbo - # admin.config-center.group=dubbo - # admin.metadata-report.group=dubbo - - # namespace used by nacos.(Deprecated it is recommended to use URL to add parameters,will be removed in the future) - # admin.registry.namespace=public - # admin.config-center.namespace=public - # admin.metadata-report.namespace=public - - # apollo config - # admin.config-center = apollo://localhost:8070?token=e16e5cd903fd0c97a116c873b448544b9d086de9&app.id=test&env=dev&cluster=default&namespace=dubbo - # admin.apollo.token=e16e5cd903fd0c97a116c873b448544b9d086de9 - # admin.apollo.appId=test - # admin.apollo.env=dev - # admin.apollo.cluster=default - - # mysql - # spring.datasource.driver-class-name=com.mysql.jdbc.Driver - # spring.datasource.url=jdbc:mysql://localhost:3306/dubbo-admin?characterEncoding=utf8&connectTimeout=1000&socketTimeout=10000&autoReconnect=true - # spring.datasource.username=root - # spring.datasource.password=mysql \ No newline at end of file diff --git a/kubernetes/dubbo-admin/deployment.yaml b/kubernetes/dubbo-admin/deployment.yaml deleted file mode 100644 index 0903850ba..000000000 --- a/kubernetes/dubbo-admin/deployment.yaml +++ /dev/null @@ -1,59 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - labels: - app: dubbo-admin - name: dubbo-admin -spec: - replicas: 1 - selector: - matchLabels: - app: dubbo-admin - template: - metadata: - labels: - app: dubbo-admin - spec: - serviceAccountName: dubbo-admin - containers: - - name: dubbo-admin - image: apache/dubbo-admin:0.5.0 - imagePullPolicy: IfNotPresent - ports: - - containerPort: 8080 - name: http - volumeMounts: - - mountPath: /config - name: application-properties - - mountPath: /storage - name: dubbo-admin-storage - livenessProbe: - httpGet: - path: / - port: 8080 - initialDelaySeconds: 10 - periodSeconds: 10 - successThreshold: 1 - timeoutSeconds: 15 - readinessProbe: - httpGet: - path: / - port: 8080 - initialDelaySeconds: 10 - periodSeconds: 10 - successThreshold: 1 - timeoutSeconds: 15 - resources: - limits: {} - requests: - cpu: 500m - memory: 1Gi - securityContext: - runAsUser: 0 - volumes: - - name: application-properties - configMap: - name: dubbo-admin - - name: dubbo-admin-storage - persistentVolumeClaim: - claimName: dubbo-admin-pvc \ No newline at end of file diff --git a/kubernetes/dubbo-admin/pv.yaml b/kubernetes/dubbo-admin/pv.yaml deleted file mode 100644 index 721af604f..000000000 --- a/kubernetes/dubbo-admin/pv.yaml +++ /dev/null @@ -1,22 +0,0 @@ -apiVersion: v1 -kind: PersistentVolume -metadata: - name: dubbo-admin-pv -spec: - capacity: - storage: 10Gi - volumeMode: Filesystem - accessModes: - - ReadWriteOnce - persistentVolumeReclaimPolicy: Retain - storageClassName: local - local: - path: /var/lib/dubbo-admin - nodeAffinity: - required: - nodeSelectorTerms: - - matchExpressions: - - key: kubernetes.io/hostname - operator: In - values: - - master \ No newline at end of file diff --git a/kubernetes/dubbo-admin/pvc.yaml b/kubernetes/dubbo-admin/pvc.yaml deleted file mode 100644 index 57352a5fa..000000000 --- a/kubernetes/dubbo-admin/pvc.yaml +++ /dev/null @@ -1,11 +0,0 @@ -apiVersion: v1 -kind: PersistentVolumeClaim -metadata: - name: dubbo-admin-pvc -spec: - accessModes: - - ReadWriteOnce - resources: - requests: - storage: 5Gi - storageClassName: local \ No newline at end of file diff --git a/kubernetes/dubbo-admin/rbac.yaml b/kubernetes/dubbo-admin/rbac.yaml deleted file mode 100644 index 072b376f9..000000000 --- a/kubernetes/dubbo-admin/rbac.yaml +++ /dev/null @@ -1,48 +0,0 @@ -apiVersion: v1 -kind: ServiceAccount -metadata: - name: dubbo-admin - namespace: default ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRole -metadata: - name: dubbo-admin -rules: - - apiGroups: - - "" - resources: - - pods - verbs: - - get - - list - - watch - - apiGroups: - - "extensions" - resources: - - ingresses - verbs: - - get - - apiGroups: - - "apps" - resources: - - configmaps - - deployments - - services - verbs: - - get - - list - - watch ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRoleBinding -metadata: - name: dubbo-admin -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: ClusterRole - name: dubbo-admin -subjects: - - kind: ServiceAccount - name: dubbo-admin - namespace: default \ No newline at end of file diff --git a/kubernetes/dubbo-admin/service.yaml b/kubernetes/dubbo-admin/service.yaml deleted file mode 100644 index 439027c81..000000000 --- a/kubernetes/dubbo-admin/service.yaml +++ /dev/null @@ -1,14 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: dubbo-admin - namespace: default -spec: - type: NodePort - ports: - - name: dubbo-admin - port: 38080 - targetPort: http - protocol: TCP - selector: - app: dubbo-admin \ No newline at end of file diff --git a/kubernetes/dubbo-admin/storageclass.yaml b/kubernetes/dubbo-admin/storageclass.yaml deleted file mode 100644 index f364d73af..000000000 --- a/kubernetes/dubbo-admin/storageclass.yaml +++ /dev/null @@ -1,6 +0,0 @@ -apiVersion: storage.k8s.io/v1 -kind: StorageClass -metadata: - name: local -provisioner: kubernetes.io/no-provisioner -volumeBindingMode: WaitForFirstConsumer \ No newline at end of file diff --git a/kubernetes/grafana/configmap.yaml b/kubernetes/grafana/configmap.yaml deleted file mode 100644 index cd743c073..000000000 --- a/kubernetes/grafana/configmap.yaml +++ /dev/null @@ -1,22 +0,0 @@ -apiVersion: v1 -kind: ConfigMap -metadata: - name: grafana - namespace: default - labels: - app: grafana -data: - grafana.ini: | - [analytics] - check_for_updates = true - [grafana_net] - url = https://grafana.net - [log] - mode = console - [paths] - data = /var/lib/grafana/ - logs = /var/log/grafana - plugins = /var/lib/grafana/plugins - provisioning = /etc/grafana/provisioning - [server] - domain = '' \ No newline at end of file diff --git a/kubernetes/grafana/rbac.yaml b/kubernetes/grafana/rbac.yaml deleted file mode 100644 index 74f5693a3..000000000 --- a/kubernetes/grafana/rbac.yaml +++ /dev/null @@ -1,63 +0,0 @@ -apiVersion: v1 -kind: ServiceAccount -metadata: - name: grafana - namespace: default - labels: - app: grafana ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRole -metadata: - name: grafana-clusterrole - labels: - app: grafana -rules: [] ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRoleBinding -metadata: - name: grafana-clusterrolebinding - labels: - app: grafana -subjects: - - kind: ServiceAccount - name: grafana - namespace: default -roleRef: - kind: ClusterRole - name: grafana-clusterrole - apiGroup: rbac.authorization.k8s.io ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: Role -metadata: - name: grafana - namespace: default - labels: - app: grafana -rules: - - apiGroups: - - extensions - resources: - - podsecuritypolicies - verbs: - - use - resourceNames: - - grafana ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: RoleBinding -metadata: - name: grafana - namespace: default - labels: - app: grafana -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: Role - name: grafana -subjects: - - kind: ServiceAccount - name: grafana - namespace: default \ No newline at end of file diff --git a/kubernetes/grafana/secret.yaml b/kubernetes/grafana/secret.yaml deleted file mode 100644 index 57c4c59f2..000000000 --- a/kubernetes/grafana/secret.yaml +++ /dev/null @@ -1,12 +0,0 @@ -apiVersion: v1 -kind: Secret -metadata: - name: grafana - namespace: default - labels: - app: grafana -type: Opaque -data: - admin-user: "YWRtaW4=" - admin-password: "NnhlY1JVSHJpNm1MSktVRGV5cnBtZ0Jja1RUYkJmNG1ZcmdsVElKZQ==" - ldap-toml: "" \ No newline at end of file diff --git a/kubernetes/grafana/service.yaml b/kubernetes/grafana/service.yaml deleted file mode 100644 index 269c1cd0d..000000000 --- a/kubernetes/grafana/service.yaml +++ /dev/null @@ -1,16 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: grafana - namespace: default - labels: - app: grafana -spec: - type: ClusterIP - ports: - - name: service - port: 80 - protocol: TCP - targetPort: 3000 - selector: - app: grafana \ No newline at end of file diff --git a/kubernetes/grafana/statefulset.yaml b/kubernetes/grafana/statefulset.yaml deleted file mode 100644 index 670565e1f..000000000 --- a/kubernetes/grafana/statefulset.yaml +++ /dev/null @@ -1,93 +0,0 @@ -apiVersion: apps/v1 -kind: StatefulSet -metadata: - name: grafana - namespace: default - labels: - app: grafana - annotations: - checksum/config: 4b9517b76dc0f685555140b24fa94df4dff5a5f3ea72c424290168afe0465276 - checksum/dashboards-json-config: 01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b - checksum/sc-dashboard-provider-config: 01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b - checksum/secret: 87b3dc176b564805256e2f3207f32567cf2dcf805f5ff51c0b48650907047595 -spec: - replicas: 1 - selector: - matchLabels: - app: grafana - template: - metadata: - labels: - app: grafana - spec: - serviceAccountName: grafana - containers: - - name: grafana - image: "grafana/grafana:9.3.6" - imagePullPolicy: IfNotPresent - volumeMounts: - - name: config - mountPath: "/etc/grafana/grafana.ini" - subPath: grafana.ini - - name: storage - mountPath: "/etc/grafana" - ports: - - name: grafana - containerPort: 3000 - protocol: TCP - - name: gossip-tcp - containerPort: 9094 - protocol: TCP - - name: gossip-udp - containerPort: 9094 - protocol: UDP - env: - - name: POD_IP - valueFrom: - fieldRef: - fieldPath: status.podIP - - name: GF_SECURITY_ADMIN_USER - valueFrom: - secretKeyRef: - name: grafana - key: admin-user - - name: GF_SECURITY_ADMIN_PASSWORD - valueFrom: - secretKeyRef: - name: grafana - key: admin-password - - name: GF_PATHS_DATA - value: /var/lib/grafana/ - - name: GF_PATHS_LOGS - value: /var/log/grafana - - name: GF_PATHS_PLUGINS - value: /var/lib/grafana/plugins - - name: GF_PATHS_PROVISIONING - value: /etc/grafana/provisioning - livenessProbe: - failureThreshold: 10 - httpGet: - path: /api/health - port: 3000 - initialDelaySeconds: 60 - timeoutSeconds: 30 - readinessProbe: - httpGet: - path: /api/health - port: 3000 - volumes: - - name: config - configMap: - name: grafana - volumeClaimTemplates: - - metadata: - name: storage - labels: - app: grafana - spec: - storageClassName: local - accessModes: - - ReadWriteOnce - resources: - requests: - storage: 2Gi \ No newline at end of file diff --git a/kubernetes/grafana/storage.yaml b/kubernetes/grafana/storage.yaml deleted file mode 100644 index a4e2e9967..000000000 --- a/kubernetes/grafana/storage.yaml +++ /dev/null @@ -1,19 +0,0 @@ -apiVersion: v1 -kind: PersistentVolume -metadata: - name: storage-grafana-pv -spec: - storageClassName: local - capacity: - storage: 10Gi - accessModes: - - ReadWriteOnce - hostPath: - path: /var/lib/grafana ---- -apiVersion: storage.k8s.io/v1 -kind: StorageClass -metadata: - name: local -provisioner: kubernetes.io/no-provisioner -volumeBindingMode: WaitForFirstConsumer \ No newline at end of file diff --git a/kubernetes/nacos.yaml b/kubernetes/nacos.yaml new file mode 100644 index 000000000..ed3318c05 --- /dev/null +++ b/kubernetes/nacos.yaml @@ -0,0 +1,217 @@ +--- +# Source: nacos/templates/svc.yaml +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +apiVersion: v1 +kind: Service +metadata: + name: nacos + namespace: default + labels: + app.kubernetes.io/name: nacos + helm.sh/chart: nacos-0.1.5 + app.kubernetes.io/instance: nacos + app.kubernetes.io/managed-by: Helm +spec: + type: NodePort + ports: + - port: 8848 + targetPort: 8848 + protocol: TCP + name: http + - port: 9848 + name: clientgen-rpc + targetPort: 9848 + - port: 9849 + name: raft-rpc + targetPort: 9849 + - port: 7848 + name: old-raft-rpc + targetPort: 7848 + protocol: TCP + nodePort: 30000 + selector: + app.kubernetes.io/name: nacos +--- +# Source: nacos/templates/statefulset.yaml +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +apiVersion: apps/v1 +kind: StatefulSet +metadata: + name: nacos + namespace: default +spec: + replicas: 1 + serviceName: nacos + selector: + matchLabels: + app.kubernetes.io/name: nacos + template: + metadata: + labels: + app.kubernetes.io/name: nacos + spec: + containers: + - name: nacos + image: "nacos/nacos-server:latest" + imagePullPolicy: IfNotPresent + startupProbe: + initialDelaySeconds: 180 + periodSeconds: 5 + timeoutSeconds: 10 + httpGet: + scheme: HTTP + port: 8848 + path: /nacos/v1/console/health/readiness + livenessProbe: + initialDelaySeconds: 10 + periodSeconds: 5 + timeoutSeconds: 10 + httpGet: + scheme: HTTP + port: 8848 + path: /nacos/v1/console/health/liveness + ports: + - name: http + containerPort: 8848 + protocol: TCP + - containerPort: 9848 + name: clientgen-rpc + - containerPort: 9849 + name: raft-rpc + - containerPort: 7848 + name: old-raft-rpc + resources: + limits: {} + requests: {} + env: + - name: NACOS_SERVER_PORT + value: "8848" + - name: NACOS_APPLICATION_PORT + value: "8848" + - name: PREFER_HOST_MODE + value: "8848" + - name: MODE + value: "standalone" + - name: EMBEDDED_STORAGE + value: embedded + volumeMounts: + - 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: {} +--- +# Source: nacos/templates/configmap.yaml +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +--- +# Source: nacos/templates/extra-list.yaml +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +--- +# Source: nacos/templates/networkpolicy.yaml +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +--- +# Source: nacos/templates/pdb.yaml +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +--- +# Source: nacos/templates/svc-headless.yaml +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/kubernetes/nacos/pv.yaml b/kubernetes/nacos/pv.yaml deleted file mode 100644 index 490be1911..000000000 --- a/kubernetes/nacos/pv.yaml +++ /dev/null @@ -1,22 +0,0 @@ -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 deleted file mode 100644 index 7fa5b06be..000000000 --- a/kubernetes/nacos/pvc.yaml +++ /dev/null @@ -1,11 +0,0 @@ -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 deleted file mode 100644 index 281f6c092..000000000 --- a/kubernetes/nacos/service.yaml +++ /dev/null @@ -1,21 +0,0 @@ -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 deleted file mode 100644 index fb5ae4466..000000000 --- a/kubernetes/nacos/statefulset.yaml +++ /dev/null @@ -1,79 +0,0 @@ -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 deleted file mode 100644 index f364d73af..000000000 --- a/kubernetes/nacos/storageclass.yaml +++ /dev/null @@ -1,6 +0,0 @@ -apiVersion: storage.k8s.io/v1 -kind: StorageClass -metadata: - name: local -provisioner: kubernetes.io/no-provisioner -volumeBindingMode: WaitForFirstConsumer \ No newline at end of file diff --git a/kubernetes/zookeeper.yaml b/kubernetes/zookeeper.yaml new file mode 100644 index 000000000..2160064c0 --- /dev/null +++ b/kubernetes/zookeeper.yaml @@ -0,0 +1,250 @@ +--- +# Source: zookeeper/templates/scripts-configmap.yaml +apiVersion: v1 +kind: ConfigMap +metadata: + name: zookeeper-scripts + namespace: default + labels: + app.kubernetes.io/name: zookeeper + helm.sh/chart: zookeeper-11.1.6 + app.kubernetes.io/instance: zookeeper + app.kubernetes.io/managed-by: Helm + app.kubernetes.io/component: zookeeper +data: + init-certs.sh: |- + #!/bin/bash + setup.sh: |- + #!/bin/bash + + # Execute entrypoint as usual after obtaining ZOO_SERVER_ID + # check ZOO_SERVER_ID in persistent volume via myid + # if not present, set based on POD hostname + if [[ -f "/bitnami/zookeeper/data/myid" ]]; then + export ZOO_SERVER_ID="$(cat /bitnami/zookeeper/data/myid)" + else + HOSTNAME="$(hostname -s)" + if [[ $HOSTNAME =~ (.*)-([0-9]+)$ ]]; then + ORD=${BASH_REMATCH[2]} + export ZOO_SERVER_ID="$((ORD + 1 ))" + else + echo "Failed to get index from hostname $HOST" + exit 1 + fi + fi + exec /entrypoint.sh /run.sh +--- +# Source: zookeeper/templates/svc-headless.yaml +apiVersion: v1 +kind: Service +metadata: + name: zookeeper-headless + namespace: default + labels: + app.kubernetes.io/name: zookeeper + helm.sh/chart: zookeeper-11.1.6 + app.kubernetes.io/instance: zookeeper + app.kubernetes.io/managed-by: Helm + app.kubernetes.io/component: zookeeper +spec: + type: ClusterIP + clusterIP: None + publishNotReadyAddresses: true + ports: + - name: tcp-client + port: 2181 + targetPort: client + - name: tcp-follower + port: 2888 + targetPort: follower + - name: tcp-election + port: 3888 + targetPort: election + selector: + app.kubernetes.io/name: zookeeper + app.kubernetes.io/instance: zookeeper + app.kubernetes.io/component: zookeeper +--- +# Source: zookeeper/templates/svc.yaml +apiVersion: v1 +kind: Service +metadata: + name: zookeeper + namespace: default + labels: + app.kubernetes.io/name: zookeeper + helm.sh/chart: zookeeper-11.1.6 + app.kubernetes.io/instance: zookeeper + app.kubernetes.io/managed-by: Helm + app.kubernetes.io/component: zookeeper +spec: + type: ClusterIP + sessionAffinity: None + ports: + - name: tcp-client + port: 2181 + targetPort: client + nodePort: null + - name: tcp-follower + port: 2888 + targetPort: follower + - name: tcp-election + port: 3888 + targetPort: election + selector: + app.kubernetes.io/name: zookeeper + app.kubernetes.io/instance: zookeeper + app.kubernetes.io/component: zookeeper +--- +# Source: zookeeper/templates/statefulset.yaml +apiVersion: apps/v1 +kind: StatefulSet +metadata: + name: zookeeper + namespace: default + labels: + app.kubernetes.io/name: zookeeper + helm.sh/chart: zookeeper-11.1.6 + app.kubernetes.io/instance: zookeeper + app.kubernetes.io/managed-by: Helm + app.kubernetes.io/component: zookeeper + role: zookeeper +spec: + replicas: 1 + podManagementPolicy: Parallel + selector: + matchLabels: + app.kubernetes.io/name: zookeeper + app.kubernetes.io/instance: zookeeper + app.kubernetes.io/component: zookeeper + serviceName: zookeeper-headless + updateStrategy: + rollingUpdate: {} + type: RollingUpdate + template: + metadata: + annotations: + labels: + app.kubernetes.io/name: zookeeper + helm.sh/chart: zookeeper-11.1.6 + app.kubernetes.io/instance: zookeeper + app.kubernetes.io/managed-by: Helm + app.kubernetes.io/component: zookeeper + spec: + serviceAccountName: default + + affinity: + podAffinity: + + podAntiAffinity: + preferredDuringSchedulingIgnoredDuringExecution: + - podAffinityTerm: + labelSelector: + matchLabels: + app.kubernetes.io/name: zookeeper + app.kubernetes.io/instance: zookeeper + app.kubernetes.io/component: zookeeper + topologyKey: kubernetes.io/hostname + weight: 1 + nodeAffinity: + + securityContext: + fsGroup: 1001 + initContainers: + containers: + - name: zookeeper + image: docker.io/bitnami/zookeeper:3.8.1-debian-11-r18 + imagePullPolicy: "IfNotPresent" + securityContext: + allowPrivilegeEscalation: false + runAsNonRoot: true + runAsUser: 1001 + command: + - /scripts/setup.sh + resources: + limits: {} + requests: + cpu: 250m + memory: 256Mi + env: + - name: BITNAMI_DEBUG + value: "false" + - name: ZOO_DATA_LOG_DIR + value: "" + - name: ZOO_PORT_NUMBER + value: "2181" + - name: ZOO_TICK_TIME + value: "2000" + - name: ZOO_INIT_LIMIT + value: "10" + - name: ZOO_SYNC_LIMIT + value: "5" + - name: ZOO_PRE_ALLOC_SIZE + value: "65536" + - name: ZOO_SNAPCOUNT + value: "100000" + - name: ZOO_MAX_CLIENT_CNXNS + value: "60" + - name: ZOO_4LW_COMMANDS_WHITELIST + value: "srvr, mntr, ruok" + - name: ZOO_LISTEN_ALLIPS_ENABLED + value: "no" + - name: ZOO_AUTOPURGE_INTERVAL + value: "0" + - name: ZOO_AUTOPURGE_RETAIN_COUNT + value: "3" + - name: ZOO_MAX_SESSION_TIMEOUT + value: "40000" + - name: ZOO_SERVERS + value: zookeeper-0.zookeeper-headless.default.svc.cluster.local:2888:3888::1 + - name: ZOO_ENABLE_AUTH + value: "no" + - name: ZOO_ENABLE_QUORUM_AUTH + value: "no" + - name: ZOO_HEAP_SIZE + value: "1024" + - name: ZOO_LOG_LEVEL + value: "ERROR" + - name: ALLOW_ANONYMOUS_LOGIN + value: "yes" + - name: POD_NAME + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: metadata.name + ports: + - name: client + containerPort: 2181 + - name: follower + containerPort: 2888 + - name: election + containerPort: 3888 + livenessProbe: + failureThreshold: 6 + initialDelaySeconds: 30 + periodSeconds: 10 + successThreshold: 1 + timeoutSeconds: 5 + exec: + command: ['/bin/bash', '-c', 'echo "ruok" | timeout 2 nc -w 2 localhost 2181 | grep imok'] + readinessProbe: + failureThreshold: 6 + initialDelaySeconds: 5 + periodSeconds: 10 + successThreshold: 1 + timeoutSeconds: 5 + exec: + command: ['/bin/bash', '-c', 'echo "ruok" | timeout 2 nc -w 2 localhost 2181 | grep imok'] + volumeMounts: + - name: scripts + mountPath: /scripts/setup.sh + subPath: setup.sh + - name: data + mountPath: /bitnami/zookeeper + volumes: + - name: scripts + configMap: + name: zookeeper-scripts + defaultMode: 0755 + - name: data + emptyDir: {} diff --git a/kubernetes/zookeeper/configmap.yaml b/kubernetes/zookeeper/configmap.yaml deleted file mode 100644 index 867f27f16..000000000 --- a/kubernetes/zookeeper/configmap.yaml +++ /dev/null @@ -1,25 +0,0 @@ -apiVersion: v1 -kind: ConfigMap -metadata: - name: zookeeper-scripts -data: - init-certs.sh: '#!/bin/bash' - setup.sh: |- - #!/bin/bash - - # Execute entrypoint as usual after obtaining ZOO_SERVER_ID - # check ZOO_SERVER_ID in persistent volume via myid - # if not present, set based on POD hostname - if [[ -f "/bitnami/zookeeper/data/myid" ]]; then - export ZOO_SERVER_ID="$(cat /bitnami/zookeeper/data/myid)" - else - HOSTNAME="$(hostname -s)" - if [[ $HOSTNAME =~ (.*)-([0-9]+)$ ]]; then - ORD=${BASH_REMATCH[2]} - export ZOO_SERVER_ID="$((ORD + 1 ))" - else - echo "Failed to get index from hostname $HOST" - exit 1 - fi - fi - exec /entrypoint.sh /run.sh \ No newline at end of file diff --git a/kubernetes/zookeeper/pv.yaml b/kubernetes/zookeeper/pv.yaml deleted file mode 100644 index a8c3f6bf9..000000000 --- a/kubernetes/zookeeper/pv.yaml +++ /dev/null @@ -1,22 +0,0 @@ -apiVersion: v1 -kind: PersistentVolume -metadata: - name: zookeeper-pv -spec: - capacity: - storage: 10Gi - volumeMode: Filesystem - accessModes: - - ReadWriteOnce - persistentVolumeReclaimPolicy: Retain - storageClassName: local - local: - path: /var/lib/zookeeper - nodeAffinity: - required: - nodeSelectorTerms: - - matchExpressions: - - key: kubernetes.io/hostname - operator: In - values: - - master \ No newline at end of file diff --git a/kubernetes/zookeeper/pvc.yaml b/kubernetes/zookeeper/pvc.yaml deleted file mode 100644 index f6378cfa9..000000000 --- a/kubernetes/zookeeper/pvc.yaml +++ /dev/null @@ -1,11 +0,0 @@ -apiVersion: v1 -kind: PersistentVolumeClaim -metadata: - name: zookeeper-pvc -spec: - accessModes: - - ReadWriteOnce - resources: - requests: - storage: 5Gi - storageClassName: local \ No newline at end of file diff --git a/kubernetes/zookeeper/service.yaml b/kubernetes/zookeeper/service.yaml deleted file mode 100644 index c8d6c5fd8..000000000 --- a/kubernetes/zookeeper/service.yaml +++ /dev/null @@ -1,20 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: zookeeper - labels: - app: zookeeper -spec: - selector: - app: zookeeper - ports: - - name: client - port: 2181 - targetPort: client - - name: follower - port: 2888 - targetPort: follower - - name: election - port: 3888 - targetPort: election - type: ClusterIP \ No newline at end of file diff --git a/kubernetes/zookeeper/statefulset.yaml b/kubernetes/zookeeper/statefulset.yaml deleted file mode 100644 index dfc7295e7..000000000 --- a/kubernetes/zookeeper/statefulset.yaml +++ /dev/null @@ -1,85 +0,0 @@ -apiVersion: apps/v1 -kind: StatefulSet -metadata: - name: zookeeper - labels: - app: zookeeper -spec: - replicas: 1 - selector: - matchLabels: - app: zookeeper - template: - metadata: - labels: - app: zookeeper - spec: - containers: - - name: zookeeper - image: docker.io/bitnami/zookeeper:3.8.0-debian-11-r56 - imagePullPolicy: IfNotPresent - ports: - - containerPort: 2181 - name: client - - containerPort: 2888 - name: follower - - containerPort: 3888 - name: election - command: - - /scripts/setup.sh - env: - - name: MY_POD_NAME - valueFrom: - fieldRef: - apiVersion: v1 - fieldPath: metadata.name - - name: ZOO_PORT_NUMBER - value: "2181" - - name: ZOO_LISTEN_ALLIPS_ENABLED - value: "no" - - name: ZOO_AUTOPURGE_INTERVAL - value: "0" - - name: ZOO_AUTOPURGE_RETAIN_COUNT - value: "3" - - name: ZOO_SERVERS - value: $(MY_POD_NAME).zookeeper.journal.svc.cluster.local:2888:3888::1 - - name: ZOO_ENABLE_AUTH - value: "no" - - name: ZOO_ENABLE_QUORUM_AUTH - value: "no" - - name: ALLOW_ANONYMOUS_LOGIN - value: "yes" - - name: BITNAMI_DEBUG - value: "false" - - name: ZOO_PRE_ALLOC_SIZE - value: "65536" - - name: ZOO_4LW_COMMANDS_WHITELIST - value: srvr, mntr, ruok - - name: ZOO_MAX_SESSION_TIMEOUT - value: "40000" - - name: ZOO_HEAP_SIZE - value: "1024" - - name: ZOO_LOG_LEVEL - value: ERROR - resources: - requests: - cpu: 250m - memory: 256Mi - volumeMounts: - - mountPath: /scripts/setup.sh - name: scripts - subPath: setup.sh - - mountPath: /bitnami/zookeeper - name: data - - mountPath: /etc/zookeeper - name: storage - volumes: - - name: data - emptyDir: {} - - name: storage - persistentVolumeClaim: - claimName: zookeeper-pvc - - configMap: - defaultMode: 493 - name: zookeeper-scripts - name: scripts \ No newline at end of file diff --git a/kubernetes/zookeeper/storageclass.yaml b/kubernetes/zookeeper/storageclass.yaml deleted file mode 100644 index f364d73af..000000000 --- a/kubernetes/zookeeper/storageclass.yaml +++ /dev/null @@ -1,6 +0,0 @@ -apiVersion: storage.k8s.io/v1 -kind: StorageClass -metadata: - name: local -provisioner: kubernetes.io/no-provisioner -volumeBindingMode: WaitForFirstConsumer \ No newline at end of file