diff --git a/.gitignore b/.gitignore index f33fcd7154..fa1818e2ba 100644 --- a/.gitignore +++ b/.gitignore @@ -29,6 +29,7 @@ tmp/ bin/ output/ _output/ +deployments/charts/generated-configs/ ### OpenIM Config ### config/config.yaml diff --git a/deployments/README.md b/deployments/README.md index 14781b4ec9..d1c2507de5 100644 --- a/deployments/README.md +++ b/deployments/README.md @@ -81,6 +81,13 @@ $ sudo sealos run labring/kubernetes:v1.25.0 labring/helm:v3.8.2 labring/calico: > $ sealos reset > ``` +If you are local, you can also use Kind and Minikube to test, for example, using Kind: + +```bash +$ sGO111MODULE="on" go get sigs.k8s.io/kind@v0.11.1 +$ skind create cluster +``` + ### Installing helm Helm simplifies the deployment and management of Kubernetes applications to a large extent by offering version control and release management through packaging. @@ -112,3 +119,10 @@ $ make image ## Installation Explore our Helm-Charts repository and read through: [Helm-Charts Repository](https://github.com/openimsdk/helm-charts) + + +```bash +../scripts/genconfig.sh ../scripts/install/environment.sh ./templates/openim.yaml > ./charts/generated-configs/config.yaml +cp ../config/notification.yaml ./charts/generated-configs/notification.yaml +../scripts/genconfig.sh ../scripts/install/environment.sh ./templates/helm-image.yaml > ./charts/generated-configs/helm-image.yaml +``` \ No newline at end of file diff --git a/deployments/charts/Chart.yaml b/deployments/charts/Chart.yaml deleted file mode 100644 index a2eee886a0..0000000000 --- a/deployments/charts/Chart.yaml +++ /dev/null @@ -1,74 +0,0 @@ -# Copyright © 2023 OpenIM. All rights reserved. -# -# Licensed 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: v2 -name: openim-api -description: A Helm chart for Kubernetes - -# A chart can be either an 'application' or a 'library' chart. -# -# Application charts are a collection of templates that can be packaged into versioned archives -# to be deployed. -# -# Library charts provide useful utilities or functions for the chart developer. They're included as -# a dependency of application charts to inject those utilities and functions into the rendering -# pipeline. Library charts do not define any templates and therefore cannot be deployed. -type: application - -# This is the chart version. This version number should be incremented each time you make changes -# to the chart and its templates, including the app version. -# Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.1.0 - -# This is the version number of the application being deployed. This version number should be -# incremented each time you make changes to the application. Versions are not expected to -# follow Semantic Versioning. They should reflect the version the application is using. -# It is recommended to use it with quotes. -appVersion: "1.16.0" - -icon: https://raw.githubusercontent.com/openimsdk/open-im-server/main/assets/openim-logo-gradient.svg - -maintainers: - - name: "OpenIM" - url: "https://github.com/openimsdk" - -keywords: - - openim - - im - - chat - -sources: - - "https://github.com/openimsdk/open-im-server" - - "https://github.com/openimsdk/openim-sdk-core" - - "https://github.com/openimsdk/openim-docker" - -dependencies: - - name: mysql - version: 8.0.25 - repository: https://charts.bitnami.com/bitnami - - name: redis - version: 14.6.1 - repository: https://charts.bitnami.com/bitnami - - name: mongodb - version: 10.1.0 - repository: https://charts.bitnami.com/bitnami - - name: kafka - version: 14.1.0 - repository: https://charts.bitnami.com/bitnami - - name: minio - version: 8.1.2 - repository: https://charts.bitnami.com/bitnami - - name: zookeeper - version: 5.17.0 - repository: https://charts.bitnami.com/bitnami \ No newline at end of file diff --git a/deployments/charts/helmfile.yaml b/deployments/charts/helmfile.yaml new file mode 100644 index 0000000000..0b744cd44b --- /dev/null +++ b/deployments/charts/helmfile.yaml @@ -0,0 +1,92 @@ +repositories: + - name: stable + url: https://charts.helm.sh/stable + +releases: + - name: openim-api + namespace: default + chart: ./openim-api + values: + - openim-api/values.yaml + - generated-configs/helm-image.yaml + - generated-configs/config.yaml + - generated-configs/notification.yaml + - name: openim-msggateway + namespace: default + chart: ./openim-msggateway + values: + - openim-msggateway/values.yaml + - generated-configs/helm-image.yaml + - generated-configs/config.yaml + - generated-configs/notification.yaml + - name: openim-msgtransfer + namespace: default + chart: ./openim-msgtransfer + values: + - openim-msgtransfer/values.yaml + - generated-configs/helm-image.yaml + - generated-configs/config.yaml + - generated-configs/notification.yaml + - name: openim-push + namespace: default + chart: ./openim-push + values: + - openim-push/values.yaml + - generated-configs/helm-image.yaml + - generated-configs/config.yaml + - generated-configs/notification.yaml + + - name: openim-rpc-auth + namespace: default + chart: ./openim-rpc-auth + values: + - openim-rpc-auth/values.yaml + - generated-configs/helm-image.yaml + - generated-configs/config.yaml + - generated-configs/notification.yaml + - name: openim-rpc-conversation + namespace: default + chart: ./openim-rpc-conversation + values: + - openim-rpc-conversation/values.yaml + - generated-configs/helm-image.yaml + - generated-configs/config.yaml + - generated-configs/notification.yaml + - name: openim-rpc-friend + namespace: default + chart: ./openim-rpc-friend + values: + - openim-rpc-friend/values.yaml + - generated-configs/helm-image.yaml + - generated-configs/config.yaml + - generated-configs/notification.yaml + - name: openim-rpc-group + namespace: default + chart: ./openim-rpc-group + values: + - openim-rpc-group/values.yaml + - generated-configs/helm-image.yaml + - generated-configs/config.yaml + - generated-configs/notification.yaml + - name: openim-rpc-msg + namespace: default + chart: ./openim-rpc-msg + values: + - openim-rpc-msg/values.yaml + - generated-configs/helm-image.yaml + - generated-configs/config.yaml + - generated-configs/notification.yaml + - name: openim-rpc-third + namespace: default + chart: ./openim-rpc-third + values: + - openim-rpc-third/values.yaml + - generated-configs/helm-image.yaml + - generated-configs/config.yaml + - generated-configs/notification.yaml + - name: openim-rpc-user + namespace: default + chart: ./openim-rpc-user + values: + - openim-rpc-user/values.yaml + - generated-configs/helm-image.yaml \ No newline at end of file diff --git a/deployments/charts/openim-api/Chart.yaml b/deployments/charts/openim-api/Chart.yaml index 89eac7f695..74779b64a8 100644 --- a/deployments/charts/openim-api/Chart.yaml +++ b/deployments/charts/openim-api/Chart.yaml @@ -22,3 +22,18 @@ version: 0.1.0 # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. appVersion: "1.16.0" + +icon: https://raw.githubusercontent.com/openimsdk/open-im-server/main/assets/openim-logo-gradient.svg + +maintainers: + - name: "OpenIM" + url: "https://github.com/openimsdk" + +keywords: + - openim + - im + - chat + +sources: + - "https://github.com/openimsdk/open-im-server" + - "https://github.com/openimsdk/helm-charts" \ No newline at end of file diff --git a/deployments/charts/openim-msggateway/Chart.yaml b/deployments/charts/openim-msggateway/Chart.yaml index 1af6f69dd0..c8c380bf9f 100644 --- a/deployments/charts/openim-msggateway/Chart.yaml +++ b/deployments/charts/openim-msggateway/Chart.yaml @@ -22,3 +22,18 @@ version: 0.1.0 # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. appVersion: "1.16.0" + +icon: https://raw.githubusercontent.com/openimsdk/open-im-server/main/assets/openim-logo-gradient.svg + +maintainers: + - name: "OpenIM" + url: "https://github.com/openimsdk" + +keywords: + - openim + - im + - chat + +sources: + - "https://github.com/openimsdk/open-im-server" + - "https://github.com/openimsdk/helm-charts" \ No newline at end of file diff --git a/deployments/charts/openim-msgtransfer/Chart.yaml b/deployments/charts/openim-msgtransfer/Chart.yaml index 4b4ea20ba8..bba7a047fe 100644 --- a/deployments/charts/openim-msgtransfer/Chart.yaml +++ b/deployments/charts/openim-msgtransfer/Chart.yaml @@ -22,3 +22,18 @@ version: 0.1.0 # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. appVersion: "1.16.0" + +icon: https://raw.githubusercontent.com/openimsdk/open-im-server/main/assets/openim-logo-gradient.svg + +maintainers: + - name: "OpenIM" + url: "https://github.com/openimsdk" + +keywords: + - openim + - im + - chat + +sources: + - "https://github.com/openimsdk/open-im-server" + - "https://github.com/openimsdk/helm-charts" \ No newline at end of file diff --git a/deployments/charts/openim-push/Chart.yaml b/deployments/charts/openim-push/Chart.yaml index d4596d324b..93e134879f 100644 --- a/deployments/charts/openim-push/Chart.yaml +++ b/deployments/charts/openim-push/Chart.yaml @@ -22,3 +22,18 @@ version: 0.1.0 # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. appVersion: "1.16.0" + +icon: https://raw.githubusercontent.com/openimsdk/open-im-server/main/assets/openim-logo-gradient.svg + +maintainers: + - name: "OpenIM" + url: "https://github.com/openimsdk" + +keywords: + - openim + - im + - chat + +sources: + - "https://github.com/openimsdk/open-im-server" + - "https://github.com/openimsdk/helm-charts" diff --git a/deployments/charts/openim-rpc-auth/Chart.yaml b/deployments/charts/openim-rpc-auth/Chart.yaml index 177cb8fa83..97848dbf23 100644 --- a/deployments/charts/openim-rpc-auth/Chart.yaml +++ b/deployments/charts/openim-rpc-auth/Chart.yaml @@ -22,3 +22,18 @@ version: 0.1.0 # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. appVersion: "1.16.0" + +icon: https://raw.githubusercontent.com/openimsdk/open-im-server/main/assets/openim-logo-gradient.svg + +maintainers: + - name: "OpenIM" + url: "https://github.com/openimsdk" + +keywords: + - openim + - im + - chat + +sources: + - "https://github.com/openimsdk/open-im-server" + - "https://github.com/openimsdk/helm-charts" \ No newline at end of file diff --git a/deployments/charts/openim-rpc-conversation/Chart.yaml b/deployments/charts/openim-rpc-conversation/Chart.yaml index 4de5f4d82f..090d631279 100644 --- a/deployments/charts/openim-rpc-conversation/Chart.yaml +++ b/deployments/charts/openim-rpc-conversation/Chart.yaml @@ -22,3 +22,18 @@ version: 0.1.0 # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. appVersion: "1.16.0" + +icon: https://raw.githubusercontent.com/openimsdk/open-im-server/main/assets/openim-logo-gradient.svg + +maintainers: + - name: "OpenIM" + url: "https://github.com/openimsdk" + +keywords: + - openim + - im + - chat + +sources: + - "https://github.com/openimsdk/open-im-server" + - "https://github.com/openimsdk/helm-charts" diff --git a/deployments/charts/openim-rpc-friend/Chart.yaml b/deployments/charts/openim-rpc-friend/Chart.yaml index ae070fcb56..d7e4a9fef0 100644 --- a/deployments/charts/openim-rpc-friend/Chart.yaml +++ b/deployments/charts/openim-rpc-friend/Chart.yaml @@ -22,3 +22,18 @@ version: 0.1.0 # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. appVersion: "1.16.0" + +icon: https://raw.githubusercontent.com/openimsdk/open-im-server/main/assets/openim-logo-gradient.svg + +maintainers: + - name: "OpenIM" + url: "https://github.com/openimsdk" + +keywords: + - openim + - im + - chat + +sources: + - "https://github.com/openimsdk/open-im-server" + - "https://github.com/openimsdk/helm-charts" diff --git a/deployments/charts/openim-rpc-group/Chart.yaml b/deployments/charts/openim-rpc-group/Chart.yaml index 8dd5515d81..8e037caea7 100644 --- a/deployments/charts/openim-rpc-group/Chart.yaml +++ b/deployments/charts/openim-rpc-group/Chart.yaml @@ -22,3 +22,18 @@ version: 0.1.0 # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. appVersion: "1.16.0" + +icon: https://raw.githubusercontent.com/openimsdk/open-im-server/main/assets/openim-logo-gradient.svg + +maintainers: + - name: "OpenIM" + url: "https://github.com/openimsdk" + +keywords: + - openim + - im + - chat + +sources: + - "https://github.com/openimsdk/open-im-server" + - "https://github.com/openimsdk/helm-charts" \ No newline at end of file diff --git a/deployments/charts/openim-rpc-msg/Chart.yaml b/deployments/charts/openim-rpc-msg/Chart.yaml index e5ad356c36..6597674842 100644 --- a/deployments/charts/openim-rpc-msg/Chart.yaml +++ b/deployments/charts/openim-rpc-msg/Chart.yaml @@ -22,3 +22,18 @@ version: 0.1.0 # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. appVersion: "1.16.0" + +icon: https://raw.githubusercontent.com/openimsdk/open-im-server/main/assets/openim-logo-gradient.svg + +maintainers: + - name: "OpenIM" + url: "https://github.com/openimsdk" + +keywords: + - openim + - im + - chat + +sources: + - "https://github.com/openimsdk/open-im-server" + - "https://github.com/openimsdk/helm-charts" \ No newline at end of file diff --git a/deployments/charts/openim-rpc-third/Chart.yaml b/deployments/charts/openim-rpc-third/Chart.yaml index 99993464ec..d7763d70af 100644 --- a/deployments/charts/openim-rpc-third/Chart.yaml +++ b/deployments/charts/openim-rpc-third/Chart.yaml @@ -22,3 +22,18 @@ version: 0.1.0 # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. appVersion: "1.16.0" + +icon: https://raw.githubusercontent.com/openimsdk/open-im-server/main/assets/openim-logo-gradient.svg + +maintainers: + - name: "OpenIM" + url: "https://github.com/openimsdk" + +keywords: + - openim + - im + - chat + +sources: + - "https://github.com/openimsdk/open-im-server" + - "https://github.com/openimsdk/helm-charts" \ No newline at end of file diff --git a/deployments/charts/openim-rpc-user/Chart.yaml b/deployments/charts/openim-rpc-user/Chart.yaml index b64529c247..7a2118e465 100644 --- a/deployments/charts/openim-rpc-user/Chart.yaml +++ b/deployments/charts/openim-rpc-user/Chart.yaml @@ -22,3 +22,18 @@ version: 0.1.0 # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. appVersion: "1.16.0" + +icon: https://raw.githubusercontent.com/openimsdk/open-im-server/main/assets/openim-logo-gradient.svg + +maintainers: + - name: "OpenIM" + url: "https://github.com/openimsdk" + +keywords: + - openim + - im + - chat + +sources: + - "https://github.com/openimsdk/open-im-server" + - "https://github.com/openimsdk/helm-charts" \ No newline at end of file diff --git a/deployments/templates/helm-image.yaml b/deployments/templates/helm-image.yaml index e69de29bb2..317bc34acb 100644 --- a/deployments/templates/helm-image.yaml +++ b/deployments/templates/helm-image.yaml @@ -0,0 +1,89 @@ +#This configuration file is used to override the use of the value.yaml variable. +#Currently, only the configuration with ingressName as nginx is provided. +#If it is another gateway such as istio or treafik, please modify the corresponding gateway requirements +image: + repository: ${IMAGE_REGISTRY}/openim-api + pullPolicy: Always + tag: "${SERVER_IMAGE_TAG}" +ingress: + enabled: true + className: "nginx" + annotations: + nginx.ingress.kubernetes.io/use-regex: "true" + nginx.ingress.kubernetes.io/rewrite-target: /$2 + hosts: + - host: openim.server.com # your hostname + paths: + - path: /api(/|$)(.*) + pathType: ImplementationSpecific + tls: + - secretName: webapitls #your hostname tls + hosts: + - openim.server.com + +openim-msggateway: + image: + repository: ${IMAGE_REGISTRY}/openim-msggateway + tag: "${SERVER_IMAGE_TAG}" + pullPolicy: Always + ingress: + enabled: true + className: "nginx" + annotations: + nginx.ingress.kubernetes.io/use-regex: "true" + nginx.ingress.kubernetes.io/rewrite-target: /$2 + hosts: + - host: openim.server.com # your hostname + paths: + - path: /msg_gateway(/|$)(.*) + pathType: ImplementationSpecific + tls: + - secretName: webapitls #your hostname tls + hosts: + - openim.server.com + +openim-msgtransfer: + image: + repository: ${IMAGE_REGISTRY}/openim-msgtransfer + tag: "${SERVER_IMAGE_TAG}" + pullPolicy: Always +openim-push: + image: + repository: ${IMAGE_REGISTRY}/openim-push + tag: "${SERVER_IMAGE_TAG}" + pullPolicy: Always +openim-rpc-auth: + image: + repository: ${IMAGE_REGISTRY}/openim-rpc-auth + tag: "${SERVER_IMAGE_TAG}" + pullPolicy: Always +openim-rpc-conversation: + image: + repository: ${IMAGE_REGISTRY}/openim-rpc-conversation + tag: "${SERVER_IMAGE_TAG}" + pullPolicy: Always +openim-rpc-friend: + image: + repository: ${IMAGE_REGISTRY}/openim-rpc-friend + tag: "${SERVER_IMAGE_TAG}" + pullPolicy: Always +openim-rpc-group: + image: + repository: ${IMAGE_REGISTRY}/openim-rpc-group + tag: "${SERVER_IMAGE_TAG}" + pullPolicy: Always +openim-rpc-msg: + image: + repository: ${IMAGE_REGISTRY}/openim-rpc-msg + tag: "${SERVER_IMAGE_TAG}" + pullPolicy: Always +openim-rpc-third: + image: + repository: ${IMAGE_REGISTRY}/openim-rpc-third + tag: "${SERVER_IMAGE_TAG}" + pullPolicy: Always +openim-rpc-user: + image: + repository: ${IMAGE_REGISTRY}/openim-rpc-user + tag: "${SERVER_IMAGE_TAG}" + pullPolicy: Always \ No newline at end of file diff --git a/scripts/install/environment.sh b/scripts/install/environment.sh index 6bf0e389bb..8fc88686a4 100755 --- a/scripts/install/environment.sh +++ b/scripts/install/environment.sh @@ -78,6 +78,9 @@ def "IMAGE_REGISTRY" "ghcr.io/openimsdk" # def "IMAGE_REGISTRY" "openim" # def "IMAGE_REGISTRY" "registry.cn-hangzhou.aliyuncs.com/openimsdk" +# Choose the appropriate image tag, the default is the latest version +def "SERVER_IMAGE_TAG" "latest" + ###################### OpenIM Docker Network ###################### # 设置 Docker 网络的网段 readonly DOCKER_BRIDGE_SUBNET=${DOCKER_BRIDGE_SUBNET:-'172.28.0.0/16'}