From 8eda42c57fa8a6563d582e440e8d5de7dd15b325 Mon Sep 17 00:00:00 2001 From: LongYinan Date: Fri, 29 Dec 2023 17:51:23 +0800 Subject: [PATCH] chore: remove abbey-wood helm chart (#5464) --- .github/helm/affine-cloud/.gitignore | 1 - .github/helm/affine-cloud/.helmignore | 23 ------- .github/helm/affine-cloud/Chart.lock | 6 -- .github/helm/affine-cloud/Chart.yaml | 12 ---- .github/helm/affine-cloud/readme.md | 30 ---------- .../helm/affine-cloud/templates/_helper.tpl | 51 ---------------- .../affine-cloud/templates/deployment.yaml | 51 ---------------- .../helm/affine-cloud/templates/secret.yaml | 9 --- .../helm/affine-cloud/templates/services.yaml | 15 ----- .github/helm/affine-cloud/values.yaml | 30 ---------- .github/helm/deployment_guide.md | 60 ------------------- 11 files changed, 288 deletions(-) delete mode 100644 .github/helm/affine-cloud/.gitignore delete mode 100644 .github/helm/affine-cloud/.helmignore delete mode 100644 .github/helm/affine-cloud/Chart.lock delete mode 100644 .github/helm/affine-cloud/Chart.yaml delete mode 100644 .github/helm/affine-cloud/readme.md delete mode 100644 .github/helm/affine-cloud/templates/_helper.tpl delete mode 100644 .github/helm/affine-cloud/templates/deployment.yaml delete mode 100644 .github/helm/affine-cloud/templates/secret.yaml delete mode 100644 .github/helm/affine-cloud/templates/services.yaml delete mode 100644 .github/helm/affine-cloud/values.yaml delete mode 100644 .github/helm/deployment_guide.md diff --git a/.github/helm/affine-cloud/.gitignore b/.github/helm/affine-cloud/.gitignore deleted file mode 100644 index 711a39c54..000000000 --- a/.github/helm/affine-cloud/.gitignore +++ /dev/null @@ -1 +0,0 @@ -charts/ \ No newline at end of file diff --git a/.github/helm/affine-cloud/.helmignore b/.github/helm/affine-cloud/.helmignore deleted file mode 100644 index 691fa13d6..000000000 --- a/.github/helm/affine-cloud/.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/ \ No newline at end of file diff --git a/.github/helm/affine-cloud/Chart.lock b/.github/helm/affine-cloud/Chart.lock deleted file mode 100644 index cc917f26f..000000000 --- a/.github/helm/affine-cloud/Chart.lock +++ /dev/null @@ -1,6 +0,0 @@ -dependencies: -- name: postgresql - repository: https://charts.bitnami.com/bitnami - version: 13.2.26 -digest: sha256:713de3747ceef9b5347adb30018e07f8587900f045d16c63348268a3f8a0c570 -generated: "2023-12-28T05:10:36.372020401Z" diff --git a/.github/helm/affine-cloud/Chart.yaml b/.github/helm/affine-cloud/Chart.yaml deleted file mode 100644 index 8c931e45e..000000000 --- a/.github/helm/affine-cloud/Chart.yaml +++ /dev/null @@ -1,12 +0,0 @@ -apiVersion: v2 -name: affine-cloud -description: A Helm chart for AFFiNE Cloud - -type: application -version: 0.6.1 -appVersion: '0.6.1' - -dependencies: - - name: postgresql - version: 13.2.26 - repository: https://charts.bitnami.com/bitnami diff --git a/.github/helm/affine-cloud/readme.md b/.github/helm/affine-cloud/readme.md deleted file mode 100644 index 0cac15cf5..000000000 --- a/.github/helm/affine-cloud/readme.md +++ /dev/null @@ -1,30 +0,0 @@ -# Helm Chart Configuration - -The following table lists the configurable parameters of this Helm chart and their default values. - -## AFFiNE Cloud Server parameters - -| Parameter | Description | Default | -| ------------------------------ | -------------------------------------------------- | ------------------ | -| `affineCloud.tag` | The Docker tag of the AffineCloud image to be used | `'nightly-latest'` | -| `affineCloud.resources.cpu` | The CPU resources allocated for AffineCloud | `'250m'` | -| `affineCloud.resources.memory` | The memory resources allocated for AffineCloud | `'0.5Gi'` | -| `affineCloud.signKey` | The key used to sign the JWT tokens | `'c2VjcmV0'` | -| `affineCloud.service.type` | The type of the Kubernetes service | `'ClusterIP'` | -| `affineCloud.service.port` | The port of the Kubernetes service | `'http'` | -| `affineCloud.mail.account` | The email account used to send emails | `''` | -| `affineCloud.mail.password` | The password of the email account | `''` | - -## PostgreSQL parameters - -| Parameter | Description | Default | -| -------------------------------------------- | ------------------------------------------------------------------------------------- | ------------ | -| `postgresql.auth.username` | Username for the PostgreSQL database | `'affine'` | -| `postgresql.auth.password` | Password for the PostgreSQL database. Please change this for production environments. | `'password'` | -| `postgresql.auth.database` | The name of the default database that will be created on image startup | `'affine'` | -| `postgresql.primary.resources.limits.cpu` | The CPU resources allocated for the PostgreSQL primary node | `'500m'` | -| `postgresql.primary.resources.limits.memory` | The memory resources allocated for the PostgreSQL primary node | `'0.5Gi'` | - -For more postgres parameters, please refer to: https://artifacthub.io/packages/helm/bitnami/postgresql - -Please note that for the `postgresql.auth.password`, you should provide your own password for production environments. The default value is provided only for demonstration purposes. diff --git a/.github/helm/affine-cloud/templates/_helper.tpl b/.github/helm/affine-cloud/templates/_helper.tpl deleted file mode 100644 index 06a02feb8..000000000 --- a/.github/helm/affine-cloud/templates/_helper.tpl +++ /dev/null @@ -1,51 +0,0 @@ -{{/* -Expand the name of the chart. -*/}} -{{- define "affine-cloud.name" -}} -{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} -{{- end }} - -{{/* -Create a default fully qualified app name. -We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). -If release name contains chart name it will be used as a full name. -*/}} -{{- define "affine-cloud.fullname" -}} -{{- if .Values.fullnameOverride }} -{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} -{{- else }} -{{- $name := default .Chart.Name .Values.nameOverride }} -{{- if contains $name .Release.Name }} -{{- .Release.Name | trunc 63 | trimSuffix "-" }} -{{- else }} -{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} -{{- end }} -{{- end }} -{{- end }} - -{{/* -Create chart name and version as used by the chart label. -*/}} -{{- define "affine-cloud.chart" -}} -{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} -{{- end }} - -{{/* -Common labels -*/}} -{{- define "affine-cloud.labels" -}} -helm.sh/chart: {{ include "affine-cloud.chart" . }} -{{ include "affine-cloud.selectorLabels" . }} -{{- if .Chart.AppVersion }} -app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} -{{- end }} -app.kubernetes.io/managed-by: {{ .Release.Service }} -{{- end }} - -{{/* -Selector labels -*/}} -{{- define "affine-cloud.selectorLabels" -}} -app.kubernetes.io/name: {{ include "affine-cloud.name" . }} -app.kubernetes.io/instance: {{ .Release.Name }} -{{- end }} diff --git a/.github/helm/affine-cloud/templates/deployment.yaml b/.github/helm/affine-cloud/templates/deployment.yaml deleted file mode 100644 index c8d8d6fbe..000000000 --- a/.github/helm/affine-cloud/templates/deployment.yaml +++ /dev/null @@ -1,51 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: "{{ include "affine-cloud.fullname" . }}" - labels: - {{- include "affine-cloud.labels" . | nindent 4 }} -spec: - replicas: 1 - selector: - matchLabels: - {{- include "affine-cloud.selectorLabels" . | nindent 6 }} - strategy: - type: RollingUpdate - rollingUpdate: - maxUnavailable: 2 - template: - metadata: - labels: - {{- include "affine-cloud.selectorLabels" . | nindent 8 }} - spec: - restartPolicy: Always - containers: - - name: affine-cloud - image: "ghcr.io/toeverything/cloud-self-hosted:{{ .Values.affineCloud.tag | default .Chart.AppVersion }}" - env: - - name: PG_USER - value: "{{ .Values.postgresql.auth.username }}" - - name: PG_PASS - value: "{{ .Values.postgresql.auth.password }}" - - name: PG_DATABASE - value: "{{ .Values.postgresql.auth.database }}" - - name: PG_HOST - value: "{{ .Values.postgresql.fullnameOverride | default (printf "%s-postgresql" .Release.Name) }}" - - name: DATABASE_URL - value: "{{ .Values.affineCloud.databaseUrl | default "postgresql://$(PG_USER):$(PG_PASS)@$(PG_HOST)/$(PG_DATABASE)" }}" - envFrom: - - secretRef: - name: affine-cloud-secret - ports: - - containerPort: 3000 - livenessProbe: - httpGet: - path: /api/healthz - port: 3000 - failureThreshold: 1 - initialDelaySeconds: 10 - periodSeconds: 10 - resources: - limits: - cpu: "{{ .Values.affineCloud.resources.cpu }}" - memory: "{{ .Values.affineCloud.resources.memory }}" diff --git a/.github/helm/affine-cloud/templates/secret.yaml b/.github/helm/affine-cloud/templates/secret.yaml deleted file mode 100644 index f6879af5e..000000000 --- a/.github/helm/affine-cloud/templates/secret.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: v1 -kind: Secret -metadata: - name: affine-cloud-secret -type: Opaque -data: - SIGN_KEY: "{{ .Values.affineCloud.signKey }}" - MAIL_ACCOUNT: "{{ .Values.affineCloud.mail.account }}" - MAIL_PASSWORD: "{{ .Values.affineCloud.mail.password }}" diff --git a/.github/helm/affine-cloud/templates/services.yaml b/.github/helm/affine-cloud/templates/services.yaml deleted file mode 100644 index 2529d4569..000000000 --- a/.github/helm/affine-cloud/templates/services.yaml +++ /dev/null @@ -1,15 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: "{{ include "affine-cloud.fullname" . }}" - labels: - {{- include "affine-cloud.labels" . | nindent 4 }} -spec: - type: "{{ .Values.affineCloud.service.type }}" - ports: - - name: http - protocol: TCP - port: {{ .Values.affineCloud.service.port }} - targetPort: 3000 - selector: - {{- include "affine-cloud.selectorLabels" . | nindent 4 }} diff --git a/.github/helm/affine-cloud/values.yaml b/.github/helm/affine-cloud/values.yaml deleted file mode 100644 index 514f3513a..000000000 --- a/.github/helm/affine-cloud/values.yaml +++ /dev/null @@ -1,30 +0,0 @@ -affineCloud: - tag: 'canary-5e0d5e0cc65ea46f326fdde12658bfac59b38c9f-0949' - # databaseUrl: 'postgresql://affine:password@affine-cloud-postgresql:5432/affine' - signKey: TUFtdFdzQTJhdGJuem01TA== - mail: - account: '' - password: '' - service: - type: ClusterIP - port: 80 - resources: - cpu: '250m' - memory: 0.5Gi -postgresql: - fullnameOverride: tcp-postgresql - auth: - # only for demo, please modify it at prod env - username: affine - password: password - database: affine - primary: - initdb: - scripts: - 01-init.sql: | - CREATE DATABASE affine_binary; - GRANT ALL PRIVILEGES ON DATABASE affine_binary TO affine; - resources: - limits: - cpu: '500m' - memory: 0.5Gi diff --git a/.github/helm/deployment_guide.md b/.github/helm/deployment_guide.md deleted file mode 100644 index 67830faab..000000000 --- a/.github/helm/deployment_guide.md +++ /dev/null @@ -1,60 +0,0 @@ -# Cluster Deployment Guide - -This document provides a step-by-step guide for developers on how to deploy services in a Kubernetes cluster. The following content assumes that the reader already has a basic understanding of Kubernetes concepts and operations. - -### 1. Configure Service Mesh (Optional) - -In the Kubernetes cluster, we optionally use Service Mesh (like Istio and Anthos Service Mesh) to manage the network interactions of microservices. If Service Mesh is already deployed on your cluster or do not need to use the service network, you can skip this step. In this step, we assume that you are using Google Kubernetes Engine (GKE) and have already installed Anthos Service Mesh on your cluster, if you wish to use another Ingress Controller, please refer to the relevant documentation. - -To configure your kubectl context to interact with your Kubernetes cluster using the gcloud tool, you need to execute the following commands: - -```sh -export CLUSTER_NAME=your_cluster_name -export REGION=your_cluster_region -export PROJECT=your_project_id -gcloud container clusters get-credentials $CLUSTER_NAME --region $REGION --project $PROJECT -``` - -In this command, you should replace `CLUSTER_NAME`, `REGION` and `PROJECT` with the actual name, region and project id of your Kubernetes cluster. This command retrieves the access credentials for your Kubernetes cluster and automatically configures kubectl to use these credentials. - -Now, to inject Service Mesh for a specific Namespace, first, set the environment variable `NAMESPACE` that should correspond to your target Kubernetes Namespace. In this example, we use `prod` as the target Namespace: - -```sh -export NAMESPACE=prod -``` - -Then, we label the Namespace which will enable Istio to automatically inject the sidecar container for all new Pods under this Namespace: - -```sh -kubectl label namespace $NAMESPACE istio-injection- istio.io/rev=asm-managed --overwrite -``` - -Finally, we trigger the Kubernetes Deployment restart mechanism to allow existing Pods to also obtain sidecar container injection: - -```sh -kubectl rollout restart deployment -n $NAMESPACE -``` - -### 2. Deploying the Application - -Next, we will deploy our application in the Kubernetes cluster through Helm. First, set relevant environment variables: - -```sh -export NAMESPACE=prod -export RELEASE=affine-cloud-prod -export PATH=.github/helm/affine-cloud -``` - -- `NAMESPACE` should be consistent with the first step, indicating your target Kubernetes Namespace. -- `RELEASE` is the name of your Helm release. -- `PATH` is the location of your Helm chart in your file system. - -Finally, use the `helm upgrade --install` command to deploy or upgrade your application: - -```sh -helm upgrade --namespace $NAMESPACE --create-namespace --install $RELEASE $PATH -``` - -This command creates (if it doesn't already exist) and deploys your Helm chart in the specified Namespace. If the release already exists, it will be upgraded. - -The above are the complete steps for deploying an application in a Kubernetes cluster. Make sure all prerequisites are met before deploying, and also ensure that you have the correct permissions for operations in Kubernetes.