From c371d7e673d01d2b470a474789fa5847d9723eed Mon Sep 17 00:00:00 2001 From: liyang Date: Tue, 10 Oct 2023 11:33:23 +0800 Subject: [PATCH] refactor: delete etcd chart (#63) * refactor: delete greptimedb-etcd chart * refactor: chart ci test * chore: operator resource --- .../chart-testing.yaml => chart-test.yaml} | 1 - .github/workflows/ci.yaml | 6 +- charts/greptimedb-etcd/.helmignore | 23 ------- charts/greptimedb-etcd/Chart.yaml | 6 -- charts/greptimedb-etcd/README.md | 37 ----------- charts/greptimedb-etcd/templates/service.yaml | 16 ----- .../templates/statefulset.yaml | 66 ------------------- charts/greptimedb-etcd/values.yaml | 17 ----- 8 files changed, 3 insertions(+), 169 deletions(-) rename .github/{linters/chart-testing.yaml => chart-test.yaml} (75%) delete mode 100644 charts/greptimedb-etcd/.helmignore delete mode 100644 charts/greptimedb-etcd/Chart.yaml delete mode 100644 charts/greptimedb-etcd/README.md delete mode 100644 charts/greptimedb-etcd/templates/service.yaml delete mode 100644 charts/greptimedb-etcd/templates/statefulset.yaml delete mode 100644 charts/greptimedb-etcd/values.yaml diff --git a/.github/linters/chart-testing.yaml b/.github/chart-test.yaml similarity index 75% rename from .github/linters/chart-testing.yaml rename to .github/chart-test.yaml index 859c907..2772345 100644 --- a/.github/linters/chart-testing.yaml +++ b/.github/chart-test.yaml @@ -2,5 +2,4 @@ chart-dirs: - charts charts: - charts/greptimedb-operator - - charts/greptimedb-etcd - charts/greptimedb diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 29485d8..a9aebe9 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -3,7 +3,7 @@ name: CI on: [push, pull_request] jobs: - lint-test: + chart-test: runs-on: ubuntu-latest steps: - name: Checkout sources @@ -29,7 +29,7 @@ jobs: uses: helm/chart-testing-action@v2.3.1 - name: Run chart-testing (lint) - run: ct lint --config .github/linters/chart-testing.yaml --validate-maintainers=false + run: ct lint --config .github/chart-test.yaml --validate-maintainers=false - name: Create Kubernetes uses: helm/kind-action@v1.4.0 @@ -37,4 +37,4 @@ jobs: wait: 120s - name: Run chart-testing (install) - run: ct install --helm-extra-set-args --set=etcdEndpoints=mydb-etcd-svc.default:2379 --config .github/linters/chart-testing.yaml + run: ct install --config .github/chart-test.yaml diff --git a/charts/greptimedb-etcd/.helmignore b/charts/greptimedb-etcd/.helmignore deleted file mode 100644 index 0e8a0eb..0000000 --- a/charts/greptimedb-etcd/.helmignore +++ /dev/null @@ -1,23 +0,0 @@ -# Patterns to ignore when building packages. -# This supports shell glob matching, relative path matching, and -# negation (prefixed with !). Only one pattern per line. -.DS_Store -# Common VCS dirs -.git/ -.gitignore -.bzr/ -.bzrignore -.hg/ -.hgignore -.svn/ -# Common backup files -*.swp -*.bak -*.tmp -*.orig -*~ -# Various IDEs -.project -.idea/ -*.tmproj -.vscode/ diff --git a/charts/greptimedb-etcd/Chart.yaml b/charts/greptimedb-etcd/Chart.yaml deleted file mode 100644 index 78c72c5..0000000 --- a/charts/greptimedb-etcd/Chart.yaml +++ /dev/null @@ -1,6 +0,0 @@ -name: greptimedb-etcd -apiVersion: v2 -description: A Helm chart for deploying etcd cluster in Kubernetes -type: application -version: 0.1.1-alpha.3 -appVersion: 3.5.5 diff --git a/charts/greptimedb-etcd/README.md b/charts/greptimedb-etcd/README.md deleted file mode 100644 index 66a5ff9..0000000 --- a/charts/greptimedb-etcd/README.md +++ /dev/null @@ -1,37 +0,0 @@ -# Overview - -This chart bootstraps an etcd cluster on the [Kubernetes](http://kubernetes.io) cluster used for [GreptimDB](../greptimedb/README.md). - -**Note**: This chart is not production ready. Only for testing purposes now. - -## How to install - -```console -# Add charts repo. -helm repo add greptime https://greptimeteam.github.io/helm-charts/ -helm repo update - -# Deploy greptimedb-etcd in default namespace. -helm install etcd greptime/greptimedb-etcd -n default --devel -``` - -You can use the following commands to access the etcd cluster: - -```console -# Create the diagnostic pod. -kubectl run etcd-client --image greptime/etcd:v3.5.5 --command sleep infinity - -# List the members of etcd cluster. -kubectl exec etcd-client -- etcdctl --endpoints=etcd.default.svc.cluster.local:2379 member list - -# Get etcd endpoints status. -kubectl exec etcd-client -- etcdctl \ ---endpoints=etcd-0.etcd.default.svc.cluster.local:2379,etcd-1.etcd.default.svc.cluster.local:2379,etcd-2.etcd.default.svc.cluster.local:2379 \ -endpoint status -w table -``` - -## How to uninstall - -```console -helm uninstall etcd -n default -``` diff --git a/charts/greptimedb-etcd/templates/service.yaml b/charts/greptimedb-etcd/templates/service.yaml deleted file mode 100644 index b37c405..0000000 --- a/charts/greptimedb-etcd/templates/service.yaml +++ /dev/null @@ -1,16 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: {{ .Release.Name }} - namespace: {{ .Release.Namespace }} - labels: - app: {{ .Release.Name }} -spec: - ports: - - name: client - port: {{ .Values.servicePorts.client }} - - name: peer - port: {{ .Values.servicePorts.peer }} - clusterIP: None - selector: - app: {{ .Release.Name }} diff --git a/charts/greptimedb-etcd/templates/statefulset.yaml b/charts/greptimedb-etcd/templates/statefulset.yaml deleted file mode 100644 index a3fd1a0..0000000 --- a/charts/greptimedb-etcd/templates/statefulset.yaml +++ /dev/null @@ -1,66 +0,0 @@ -apiVersion: apps/v1 -kind: StatefulSet -metadata: - name: {{ .Release.Name }} - namespace: {{ .Release.Namespace }} - labels: - app: {{ .Release.Name }} -spec: - serviceName: {{ .Release.Name }} - replicas: 3 - selector: - matchLabels: - app: {{ .Release.Name }} - volumeClaimTemplates: - - metadata: - name: etcd-storage - spec: - storageClassName: {{ .Values.storage.storageClassName }} - accessModes: [ "ReadWriteOnce" ] - resources: - requests: - storage: {{ .Values.storage.volumeSize }} - template: - metadata: - labels: - app: {{ .Release.Name }} - spec: - containers: - - name: etcd - image: '{{ .Values.image.registry }}/{{ .Values.image.repository }}:{{ .Values.image.tag }}' - imagePullPolicy: {{ .Values.image.imagePullPolicy | default "IfNotPresent" }} - command: - - "etcd" - - "--name" - - "$(HOSTNAME)" - - "--data-dir" - - "{{ .Values.storage.dataDir }}" - - "--initial-advertise-peer-urls" - - "http://$(HOSTNAME):{{ .Values.servicePorts.peer }}" - - "--listen-peer-urls" - - "http://0.0.0.0:{{ .Values.servicePorts.peer }}" - - "--advertise-client-urls" - - "http://$(HOSTNAME):{{ .Values.servicePorts.client }}" - - "--listen-client-urls" - - "http://0.0.0.0:{{ .Values.servicePorts.client }}" - - "--initial-cluster" - - "{{ .Release.Name }}-0=http://{{ .Release.Name }}-0.{{ .Release.Name }}:{{ .Values.servicePorts.peer }},{{ .Release.Name }}-1=http://{{ .Release.Name }}-1.{{ .Release.Name }}:{{ .Values.servicePorts.peer }},{{ .Release.Name }}-2=http://{{ .Release.Name }}-2.{{ .Release.Name }}:{{ .Values.servicePorts.peer }}" - - "--initial-cluster-state" - - "new" - - "--initial-cluster-token" - - "{{ .Release.Name }}" - volumeMounts: - - name: etcd-storage - mountPath: {{ .Values.storage.dataDir }} - ports: - - name: client - containerPort: {{ .Values.servicePorts.client }} - - name: peer - containerPort: {{ .Values.servicePorts.peer }} - env: - - name: HOSTNAME - valueFrom: - fieldRef: - fieldPath: metadata.name - - name: ETCDCTL_API - value: "3" diff --git a/charts/greptimedb-etcd/values.yaml b/charts/greptimedb-etcd/values.yaml deleted file mode 100644 index bbd41d2..0000000 --- a/charts/greptimedb-etcd/values.yaml +++ /dev/null @@ -1,17 +0,0 @@ -image: - registry: docker.io - # The image repository - repository: greptime/etcd - # The image pull policy for the controller - imagePullPolicy: IfNotPresent - # The image tag - tag: v3.5.5 - -servicePorts: - client: 2379 - peer: 2380 - -storage: - storageClassName: "standard" - volumeSize: 10Gi - dataDir: /var/lib/etcd