From 36da94a4e531d19be073ef7029b605ebb58517d0 Mon Sep 17 00:00:00 2001 From: xuexihuang <1339326187@qq.com> Date: Wed, 27 Sep 2023 08:15:51 +0800 Subject: [PATCH] change helm chart codes --- manifest/helm-charts/services/Chart.yaml | 10 +- .../charts/openim-msggateway/.helmignore | 23 ++++ .../charts/openim-msggateway/Chart.yaml | 24 ++++ .../openim-msggateway/templates/NOTES.txt | 22 ++++ .../openim-msggateway/templates/_helpers.tpl | 62 ++++++++++ .../templates/deployment.yaml | 61 ++++++++++ .../openim-msggateway/templates/hpa.yaml | 28 +++++ .../openim-msggateway/templates/ingress.yaml | 61 ++++++++++ .../openim-msggateway/templates/service.yaml | 15 +++ .../templates/serviceaccount.yaml | 12 ++ .../charts/openim-msggateway/values.yaml | 82 ++++++++++++++ .../charts/openim-msgtransfer/.helmignore | 23 ++++ .../charts/openim-msgtransfer/Chart.yaml | 24 ++++ .../openim-msgtransfer/templates/NOTES.txt | 22 ++++ .../openim-msgtransfer/templates/_helpers.tpl | 62 ++++++++++ .../templates/deployment.yaml | 61 ++++++++++ .../openim-msgtransfer/templates/hpa.yaml | 28 +++++ .../openim-msgtransfer/templates/ingress.yaml | 61 ++++++++++ .../openim-msgtransfer/templates/service.yaml | 15 +++ .../templates/serviceaccount.yaml | 12 ++ .../charts/openim-msgtransfer/values.yaml | 82 ++++++++++++++ .../services/charts/openim-push/.helmignore | 23 ++++ .../services/charts/openim-push/Chart.yaml | 24 ++++ .../charts/openim-push/templates/NOTES.txt | 22 ++++ .../charts/openim-push/templates/_helpers.tpl | 62 ++++++++++ .../openim-push/templates/deployment.yaml | 61 ++++++++++ .../charts/openim-push/templates/hpa.yaml | 28 +++++ .../charts/openim-push/templates/ingress.yaml | 61 ++++++++++ .../charts/openim-push/templates/service.yaml | 15 +++ .../openim-push/templates/serviceaccount.yaml | 12 ++ .../services/charts/openim-push/values.yaml | 82 ++++++++++++++ .../charts/openim-rpc-auth/.helmignore | 23 ++++ .../charts/openim-rpc-auth/Chart.yaml | 24 ++++ .../openim-rpc-auth/templates/NOTES.txt | 22 ++++ .../openim-rpc-auth/templates/_helpers.tpl | 62 ++++++++++ .../openim-rpc-auth/templates/deployment.yaml | 61 ++++++++++ .../charts/openim-rpc-auth/templates/hpa.yaml | 28 +++++ .../openim-rpc-auth/templates/ingress.yaml | 61 ++++++++++ .../openim-rpc-auth/templates/service.yaml | 15 +++ .../templates/serviceaccount.yaml | 12 ++ .../charts/openim-rpc-auth/values.yaml | 82 ++++++++++++++ .../openim-rpc-conversation/.helmignore | 23 ++++ .../charts/openim-rpc-conversation/Chart.yaml | 24 ++++ .../templates/NOTES.txt | 22 ++++ .../templates/_helpers.tpl | 62 ++++++++++ .../templates/deployment.yaml | 61 ++++++++++ .../templates/hpa.yaml | 28 +++++ .../templates/ingress.yaml | 61 ++++++++++ .../templates/service.yaml | 15 +++ .../templates/serviceaccount.yaml | 12 ++ .../openim-rpc-conversation/values.yaml | 82 ++++++++++++++ .../charts/openim-rpc-friend/.helmignore | 23 ++++ .../charts/openim-rpc-friend/Chart.yaml | 24 ++++ .../openim-rpc-friend/templates/NOTES.txt | 22 ++++ .../openim-rpc-friend/templates/_helpers.tpl | 62 ++++++++++ .../templates/deployment.yaml | 61 ++++++++++ .../openim-rpc-friend/templates/hpa.yaml | 28 +++++ .../openim-rpc-friend/templates/ingress.yaml | 61 ++++++++++ .../openim-rpc-friend/templates/service.yaml | 15 +++ .../templates/serviceaccount.yaml | 12 ++ .../charts/openim-rpc-friend/values.yaml | 82 ++++++++++++++ .../charts/openim-rpc-group/.helmignore | 23 ++++ .../charts/openim-rpc-group/Chart.yaml | 24 ++++ .../openim-rpc-group/templates/NOTES.txt | 22 ++++ .../openim-rpc-group/templates/_helpers.tpl | 62 ++++++++++ .../templates/deployment.yaml | 61 ++++++++++ .../openim-rpc-group/templates/hpa.yaml | 28 +++++ .../openim-rpc-group/templates/ingress.yaml | 61 ++++++++++ .../openim-rpc-group/templates/service.yaml | 15 +++ .../templates/serviceaccount.yaml | 12 ++ .../charts/openim-rpc-group/values.yaml | 82 ++++++++++++++ .../charts/openim-rpc-msg/.helmignore | 23 ++++ .../services/charts/openim-rpc-msg/Chart.yaml | 24 ++++ .../charts/openim-rpc-msg/templates/NOTES.txt | 22 ++++ .../openim-rpc-msg/templates/_helpers.tpl | 62 ++++++++++ .../openim-rpc-msg/templates/deployment.yaml | 61 ++++++++++ .../charts/openim-rpc-msg/templates/hpa.yaml | 28 +++++ .../openim-rpc-msg/templates/ingress.yaml | 61 ++++++++++ .../openim-rpc-msg/templates/service.yaml | 15 +++ .../templates/serviceaccount.yaml | 12 ++ .../charts/openim-rpc-msg/values.yaml | 82 ++++++++++++++ .../charts/openim-rpc-third/.helmignore | 23 ++++ .../charts/openim-rpc-third/Chart.yaml | 24 ++++ .../openim-rpc-third/templates/NOTES.txt | 22 ++++ .../openim-rpc-third/templates/_helpers.tpl | 62 ++++++++++ .../templates/deployment.yaml | 61 ++++++++++ .../openim-rpc-third/templates/hpa.yaml | 28 +++++ .../openim-rpc-third/templates/ingress.yaml | 61 ++++++++++ .../openim-rpc-third/templates/service.yaml | 15 +++ .../templates/serviceaccount.yaml | 12 ++ .../charts/openim-rpc-third/values.yaml | 82 ++++++++++++++ .../charts/openim-rpc-user/.helmignore | 23 ++++ .../charts/openim-rpc-user/Chart.yaml | 24 ++++ .../openim-rpc-user/templates/NOTES.txt | 22 ++++ .../openim-rpc-user/templates/_helpers.tpl | 62 ++++++++++ .../openim-rpc-user/templates/deployment.yaml | 61 ++++++++++ .../charts/openim-rpc-user/templates/hpa.yaml | 28 +++++ .../openim-rpc-user/templates/ingress.yaml | 61 ++++++++++ .../openim-rpc-user/templates/service.yaml | 15 +++ .../templates/serviceaccount.yaml | 12 ++ .../charts/openim-rpc-user/values.yaml | 82 ++++++++++++++ manifest/helm-charts/services/config.yaml | 12 +- .../services/templates/_helpers.tpl | 6 - .../services/templates/app-cm.yaml | 11 +- .../services/templates/app-data-pv.yaml | 47 -------- .../services/templates/deployment.yaml | 19 +++- .../services/templates/ingress.yaml | 61 ++++++++-- .../services/templates/service.yaml | 3 +- .../services/templates/serviceaccount.yaml | 12 ++ manifest/helm-charts/services/values.yaml | 106 +++++++----------- 110 files changed, 4042 insertions(+), 145 deletions(-) create mode 100644 manifest/helm-charts/services/charts/openim-msggateway/.helmignore create mode 100644 manifest/helm-charts/services/charts/openim-msggateway/Chart.yaml create mode 100644 manifest/helm-charts/services/charts/openim-msggateway/templates/NOTES.txt create mode 100644 manifest/helm-charts/services/charts/openim-msggateway/templates/_helpers.tpl create mode 100644 manifest/helm-charts/services/charts/openim-msggateway/templates/deployment.yaml create mode 100644 manifest/helm-charts/services/charts/openim-msggateway/templates/hpa.yaml create mode 100644 manifest/helm-charts/services/charts/openim-msggateway/templates/ingress.yaml create mode 100644 manifest/helm-charts/services/charts/openim-msggateway/templates/service.yaml create mode 100644 manifest/helm-charts/services/charts/openim-msggateway/templates/serviceaccount.yaml create mode 100644 manifest/helm-charts/services/charts/openim-msggateway/values.yaml create mode 100644 manifest/helm-charts/services/charts/openim-msgtransfer/.helmignore create mode 100644 manifest/helm-charts/services/charts/openim-msgtransfer/Chart.yaml create mode 100644 manifest/helm-charts/services/charts/openim-msgtransfer/templates/NOTES.txt create mode 100644 manifest/helm-charts/services/charts/openim-msgtransfer/templates/_helpers.tpl create mode 100644 manifest/helm-charts/services/charts/openim-msgtransfer/templates/deployment.yaml create mode 100644 manifest/helm-charts/services/charts/openim-msgtransfer/templates/hpa.yaml create mode 100644 manifest/helm-charts/services/charts/openim-msgtransfer/templates/ingress.yaml create mode 100644 manifest/helm-charts/services/charts/openim-msgtransfer/templates/service.yaml create mode 100644 manifest/helm-charts/services/charts/openim-msgtransfer/templates/serviceaccount.yaml create mode 100644 manifest/helm-charts/services/charts/openim-msgtransfer/values.yaml create mode 100644 manifest/helm-charts/services/charts/openim-push/.helmignore create mode 100644 manifest/helm-charts/services/charts/openim-push/Chart.yaml create mode 100644 manifest/helm-charts/services/charts/openim-push/templates/NOTES.txt create mode 100644 manifest/helm-charts/services/charts/openim-push/templates/_helpers.tpl create mode 100644 manifest/helm-charts/services/charts/openim-push/templates/deployment.yaml create mode 100644 manifest/helm-charts/services/charts/openim-push/templates/hpa.yaml create mode 100644 manifest/helm-charts/services/charts/openim-push/templates/ingress.yaml create mode 100644 manifest/helm-charts/services/charts/openim-push/templates/service.yaml create mode 100644 manifest/helm-charts/services/charts/openim-push/templates/serviceaccount.yaml create mode 100644 manifest/helm-charts/services/charts/openim-push/values.yaml create mode 100644 manifest/helm-charts/services/charts/openim-rpc-auth/.helmignore create mode 100644 manifest/helm-charts/services/charts/openim-rpc-auth/Chart.yaml create mode 100644 manifest/helm-charts/services/charts/openim-rpc-auth/templates/NOTES.txt create mode 100644 manifest/helm-charts/services/charts/openim-rpc-auth/templates/_helpers.tpl create mode 100644 manifest/helm-charts/services/charts/openim-rpc-auth/templates/deployment.yaml create mode 100644 manifest/helm-charts/services/charts/openim-rpc-auth/templates/hpa.yaml create mode 100644 manifest/helm-charts/services/charts/openim-rpc-auth/templates/ingress.yaml create mode 100644 manifest/helm-charts/services/charts/openim-rpc-auth/templates/service.yaml create mode 100644 manifest/helm-charts/services/charts/openim-rpc-auth/templates/serviceaccount.yaml create mode 100644 manifest/helm-charts/services/charts/openim-rpc-auth/values.yaml create mode 100644 manifest/helm-charts/services/charts/openim-rpc-conversation/.helmignore create mode 100644 manifest/helm-charts/services/charts/openim-rpc-conversation/Chart.yaml create mode 100644 manifest/helm-charts/services/charts/openim-rpc-conversation/templates/NOTES.txt create mode 100644 manifest/helm-charts/services/charts/openim-rpc-conversation/templates/_helpers.tpl create mode 100644 manifest/helm-charts/services/charts/openim-rpc-conversation/templates/deployment.yaml create mode 100644 manifest/helm-charts/services/charts/openim-rpc-conversation/templates/hpa.yaml create mode 100644 manifest/helm-charts/services/charts/openim-rpc-conversation/templates/ingress.yaml create mode 100644 manifest/helm-charts/services/charts/openim-rpc-conversation/templates/service.yaml create mode 100644 manifest/helm-charts/services/charts/openim-rpc-conversation/templates/serviceaccount.yaml create mode 100644 manifest/helm-charts/services/charts/openim-rpc-conversation/values.yaml create mode 100644 manifest/helm-charts/services/charts/openim-rpc-friend/.helmignore create mode 100644 manifest/helm-charts/services/charts/openim-rpc-friend/Chart.yaml create mode 100644 manifest/helm-charts/services/charts/openim-rpc-friend/templates/NOTES.txt create mode 100644 manifest/helm-charts/services/charts/openim-rpc-friend/templates/_helpers.tpl create mode 100644 manifest/helm-charts/services/charts/openim-rpc-friend/templates/deployment.yaml create mode 100644 manifest/helm-charts/services/charts/openim-rpc-friend/templates/hpa.yaml create mode 100644 manifest/helm-charts/services/charts/openim-rpc-friend/templates/ingress.yaml create mode 100644 manifest/helm-charts/services/charts/openim-rpc-friend/templates/service.yaml create mode 100644 manifest/helm-charts/services/charts/openim-rpc-friend/templates/serviceaccount.yaml create mode 100644 manifest/helm-charts/services/charts/openim-rpc-friend/values.yaml create mode 100644 manifest/helm-charts/services/charts/openim-rpc-group/.helmignore create mode 100644 manifest/helm-charts/services/charts/openim-rpc-group/Chart.yaml create mode 100644 manifest/helm-charts/services/charts/openim-rpc-group/templates/NOTES.txt create mode 100644 manifest/helm-charts/services/charts/openim-rpc-group/templates/_helpers.tpl create mode 100644 manifest/helm-charts/services/charts/openim-rpc-group/templates/deployment.yaml create mode 100644 manifest/helm-charts/services/charts/openim-rpc-group/templates/hpa.yaml create mode 100644 manifest/helm-charts/services/charts/openim-rpc-group/templates/ingress.yaml create mode 100644 manifest/helm-charts/services/charts/openim-rpc-group/templates/service.yaml create mode 100644 manifest/helm-charts/services/charts/openim-rpc-group/templates/serviceaccount.yaml create mode 100644 manifest/helm-charts/services/charts/openim-rpc-group/values.yaml create mode 100644 manifest/helm-charts/services/charts/openim-rpc-msg/.helmignore create mode 100644 manifest/helm-charts/services/charts/openim-rpc-msg/Chart.yaml create mode 100644 manifest/helm-charts/services/charts/openim-rpc-msg/templates/NOTES.txt create mode 100644 manifest/helm-charts/services/charts/openim-rpc-msg/templates/_helpers.tpl create mode 100644 manifest/helm-charts/services/charts/openim-rpc-msg/templates/deployment.yaml create mode 100644 manifest/helm-charts/services/charts/openim-rpc-msg/templates/hpa.yaml create mode 100644 manifest/helm-charts/services/charts/openim-rpc-msg/templates/ingress.yaml create mode 100644 manifest/helm-charts/services/charts/openim-rpc-msg/templates/service.yaml create mode 100644 manifest/helm-charts/services/charts/openim-rpc-msg/templates/serviceaccount.yaml create mode 100644 manifest/helm-charts/services/charts/openim-rpc-msg/values.yaml create mode 100644 manifest/helm-charts/services/charts/openim-rpc-third/.helmignore create mode 100644 manifest/helm-charts/services/charts/openim-rpc-third/Chart.yaml create mode 100644 manifest/helm-charts/services/charts/openim-rpc-third/templates/NOTES.txt create mode 100644 manifest/helm-charts/services/charts/openim-rpc-third/templates/_helpers.tpl create mode 100644 manifest/helm-charts/services/charts/openim-rpc-third/templates/deployment.yaml create mode 100644 manifest/helm-charts/services/charts/openim-rpc-third/templates/hpa.yaml create mode 100644 manifest/helm-charts/services/charts/openim-rpc-third/templates/ingress.yaml create mode 100644 manifest/helm-charts/services/charts/openim-rpc-third/templates/service.yaml create mode 100644 manifest/helm-charts/services/charts/openim-rpc-third/templates/serviceaccount.yaml create mode 100644 manifest/helm-charts/services/charts/openim-rpc-third/values.yaml create mode 100644 manifest/helm-charts/services/charts/openim-rpc-user/.helmignore create mode 100644 manifest/helm-charts/services/charts/openim-rpc-user/Chart.yaml create mode 100644 manifest/helm-charts/services/charts/openim-rpc-user/templates/NOTES.txt create mode 100644 manifest/helm-charts/services/charts/openim-rpc-user/templates/_helpers.tpl create mode 100644 manifest/helm-charts/services/charts/openim-rpc-user/templates/deployment.yaml create mode 100644 manifest/helm-charts/services/charts/openim-rpc-user/templates/hpa.yaml create mode 100644 manifest/helm-charts/services/charts/openim-rpc-user/templates/ingress.yaml create mode 100644 manifest/helm-charts/services/charts/openim-rpc-user/templates/service.yaml create mode 100644 manifest/helm-charts/services/charts/openim-rpc-user/templates/serviceaccount.yaml create mode 100644 manifest/helm-charts/services/charts/openim-rpc-user/values.yaml delete mode 100644 manifest/helm-charts/services/templates/app-data-pv.yaml create mode 100644 manifest/helm-charts/services/templates/serviceaccount.yaml diff --git a/manifest/helm-charts/services/Chart.yaml b/manifest/helm-charts/services/Chart.yaml index a61c8c2e9..4ee264ca1 100644 --- a/manifest/helm-charts/services/Chart.yaml +++ b/manifest/helm-charts/services/Chart.yaml @@ -20,11 +20,5 @@ 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. -appVersion: 0.1.0 - -# kube version dependency -kubeVersion: 1.26.x - -# keywords use in search -keywords: - - openim-api +# It is recommended to use it with quotes. +appVersion: "1.16.0" diff --git a/manifest/helm-charts/services/charts/openim-msggateway/.helmignore b/manifest/helm-charts/services/charts/openim-msggateway/.helmignore new file mode 100644 index 000000000..0e8a0eb36 --- /dev/null +++ b/manifest/helm-charts/services/charts/openim-msggateway/.helmignore @@ -0,0 +1,23 @@ +# 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/manifest/helm-charts/services/charts/openim-msggateway/Chart.yaml b/manifest/helm-charts/services/charts/openim-msggateway/Chart.yaml new file mode 100644 index 000000000..1af6f69dd --- /dev/null +++ b/manifest/helm-charts/services/charts/openim-msggateway/Chart.yaml @@ -0,0 +1,24 @@ +apiVersion: v2 +name: openim-msggateway +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" diff --git a/manifest/helm-charts/services/charts/openim-msggateway/templates/NOTES.txt b/manifest/helm-charts/services/charts/openim-msggateway/templates/NOTES.txt new file mode 100644 index 000000000..c1f032586 --- /dev/null +++ b/manifest/helm-charts/services/charts/openim-msggateway/templates/NOTES.txt @@ -0,0 +1,22 @@ +1. Get the application URL by running these commands: +{{- if .Values.ingress.enabled }} +{{- range $host := .Values.ingress.hosts }} + {{- range .paths }} + http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }} + {{- end }} +{{- end }} +{{- else if contains "NodePort" .Values.service.type }} + export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "openim-msggateway.fullname" . }}) + export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") + echo http://$NODE_IP:$NODE_PORT +{{- else if contains "LoadBalancer" .Values.service.type }} + NOTE: It may take a few minutes for the LoadBalancer IP to be available. + You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "openim-msggateway.fullname" . }}' + export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "openim-msggateway.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") + echo http://$SERVICE_IP:{{ .Values.service.port }} +{{- else if contains "ClusterIP" .Values.service.type }} + export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "openim-msggateway.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") + export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}") + echo "Visit http://127.0.0.1:8080 to use your application" + kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT +{{- end }} diff --git a/manifest/helm-charts/services/charts/openim-msggateway/templates/_helpers.tpl b/manifest/helm-charts/services/charts/openim-msggateway/templates/_helpers.tpl new file mode 100644 index 000000000..c902a1b30 --- /dev/null +++ b/manifest/helm-charts/services/charts/openim-msggateway/templates/_helpers.tpl @@ -0,0 +1,62 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "openim-msggateway.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 "openim-msggateway.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 "openim-msggateway.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "openim-msggateway.labels" -}} +helm.sh/chart: {{ include "openim-msggateway.chart" . }} +{{ include "openim-msggateway.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "openim-msggateway.selectorLabels" -}} +app.kubernetes.io/name: {{ include "openim-msggateway.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Create the name of the service account to use +*/}} +{{- define "openim-msggateway.serviceAccountName" -}} +{{- if .Values.serviceAccount.create }} +{{- default (include "openim-msggateway.fullname" .) .Values.serviceAccount.name }} +{{- else }} +{{- default "default" .Values.serviceAccount.name }} +{{- end }} +{{- end }} diff --git a/manifest/helm-charts/services/charts/openim-msggateway/templates/deployment.yaml b/manifest/helm-charts/services/charts/openim-msggateway/templates/deployment.yaml new file mode 100644 index 000000000..ca167caec --- /dev/null +++ b/manifest/helm-charts/services/charts/openim-msggateway/templates/deployment.yaml @@ -0,0 +1,61 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "openim-msggateway.fullname" . }} + labels: + {{- include "openim-msggateway.labels" . | nindent 4 }} +spec: + {{- if not .Values.autoscaling.enabled }} + replicas: {{ .Values.replicaCount }} + {{- end }} + selector: + matchLabels: + {{- include "openim-msggateway.selectorLabels" . | nindent 6 }} + template: + metadata: + {{- with .Values.podAnnotations }} + annotations: + {{- toYaml . | nindent 8 }} + {{- end }} + labels: + {{- include "openim-msggateway.selectorLabels" . | nindent 8 }} + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + serviceAccountName: {{ include "openim-msggateway.serviceAccountName" . }} + securityContext: + {{- toYaml .Values.podSecurityContext | nindent 8 }} + containers: + - name: {{ .Chart.Name }} + securityContext: + {{- toYaml .Values.securityContext | nindent 12 }} + image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + ports: + - name: http + containerPort: 80 + protocol: TCP + livenessProbe: + httpGet: + path: / + port: http + readinessProbe: + httpGet: + path: / + port: http + resources: + {{- toYaml .Values.resources | nindent 12 }} + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} diff --git a/manifest/helm-charts/services/charts/openim-msggateway/templates/hpa.yaml b/manifest/helm-charts/services/charts/openim-msggateway/templates/hpa.yaml new file mode 100644 index 000000000..e1fbe50a6 --- /dev/null +++ b/manifest/helm-charts/services/charts/openim-msggateway/templates/hpa.yaml @@ -0,0 +1,28 @@ +{{- if .Values.autoscaling.enabled }} +apiVersion: autoscaling/v2beta1 +kind: HorizontalPodAutoscaler +metadata: + name: {{ include "openim-msggateway.fullname" . }} + labels: + {{- include "openim-msggateway.labels" . | nindent 4 }} +spec: + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: {{ include "openim-msggateway.fullname" . }} + minReplicas: {{ .Values.autoscaling.minReplicas }} + maxReplicas: {{ .Values.autoscaling.maxReplicas }} + metrics: + {{- if .Values.autoscaling.targetCPUUtilizationPercentage }} + - type: Resource + resource: + name: cpu + targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} + {{- end }} + {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }} + - type: Resource + resource: + name: memory + targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} + {{- end }} +{{- end }} diff --git a/manifest/helm-charts/services/charts/openim-msggateway/templates/ingress.yaml b/manifest/helm-charts/services/charts/openim-msggateway/templates/ingress.yaml new file mode 100644 index 000000000..5c1c24078 --- /dev/null +++ b/manifest/helm-charts/services/charts/openim-msggateway/templates/ingress.yaml @@ -0,0 +1,61 @@ +{{- if .Values.ingress.enabled -}} +{{- $fullName := include "openim-msggateway.fullname" . -}} +{{- $svcPort := .Values.service.port -}} +{{- if and .Values.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }} + {{- if not (hasKey .Values.ingress.annotations "kubernetes.io/ingress.class") }} + {{- $_ := set .Values.ingress.annotations "kubernetes.io/ingress.class" .Values.ingress.className}} + {{- end }} +{{- end }} +{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}} +apiVersion: networking.k8s.io/v1 +{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} +apiVersion: networking.k8s.io/v1beta1 +{{- else -}} +apiVersion: extensions/v1beta1 +{{- end }} +kind: Ingress +metadata: + name: {{ $fullName }} + labels: + {{- include "openim-msggateway.labels" . | nindent 4 }} + {{- with .Values.ingress.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + {{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }} + ingressClassName: {{ .Values.ingress.className }} + {{- end }} + {{- if .Values.ingress.tls }} + tls: + {{- range .Values.ingress.tls }} + - hosts: + {{- range .hosts }} + - {{ . | quote }} + {{- end }} + secretName: {{ .secretName }} + {{- end }} + {{- end }} + rules: + {{- range .Values.ingress.hosts }} + - host: {{ .host | quote }} + http: + paths: + {{- range .paths }} + - path: {{ .path }} + {{- if and .pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }} + pathType: {{ .pathType }} + {{- end }} + backend: + {{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }} + service: + name: {{ $fullName }} + port: + number: {{ $svcPort }} + {{- else }} + serviceName: {{ $fullName }} + servicePort: {{ $svcPort }} + {{- end }} + {{- end }} + {{- end }} +{{- end }} diff --git a/manifest/helm-charts/services/charts/openim-msggateway/templates/service.yaml b/manifest/helm-charts/services/charts/openim-msggateway/templates/service.yaml new file mode 100644 index 000000000..0afc0d96d --- /dev/null +++ b/manifest/helm-charts/services/charts/openim-msggateway/templates/service.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "openim-msggateway.fullname" . }} + labels: + {{- include "openim-msggateway.labels" . | nindent 4 }} +spec: + type: {{ .Values.service.type }} + ports: + - port: {{ .Values.service.port }} + targetPort: http + protocol: TCP + name: http + selector: + {{- include "openim-msggateway.selectorLabels" . | nindent 4 }} diff --git a/manifest/helm-charts/services/charts/openim-msggateway/templates/serviceaccount.yaml b/manifest/helm-charts/services/charts/openim-msggateway/templates/serviceaccount.yaml new file mode 100644 index 000000000..6b47c12c5 --- /dev/null +++ b/manifest/helm-charts/services/charts/openim-msggateway/templates/serviceaccount.yaml @@ -0,0 +1,12 @@ +{{- if .Values.serviceAccount.create -}} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "openim-msggateway.serviceAccountName" . }} + labels: + {{- include "openim-msggateway.labels" . | nindent 4 }} + {{- with .Values.serviceAccount.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +{{- end }} diff --git a/manifest/helm-charts/services/charts/openim-msggateway/values.yaml b/manifest/helm-charts/services/charts/openim-msggateway/values.yaml new file mode 100644 index 000000000..52b6dc4b5 --- /dev/null +++ b/manifest/helm-charts/services/charts/openim-msggateway/values.yaml @@ -0,0 +1,82 @@ +# Default values for openim-msggateway. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +replicaCount: 1 + +image: + repository: nginx + pullPolicy: IfNotPresent + # Overrides the image tag whose default is the chart appVersion. + tag: "" + +imagePullSecrets: [] +nameOverride: "" +fullnameOverride: "" + +serviceAccount: + # Specifies whether a service account should be created + create: true + # Annotations to add to the service account + annotations: {} + # The name of the service account to use. + # If not set and create is true, a name is generated using the fullname template + name: "" + +podAnnotations: {} + +podSecurityContext: {} + # fsGroup: 2000 + +securityContext: {} + # capabilities: + # drop: + # - ALL + # readOnlyRootFilesystem: true + # runAsNonRoot: true + # runAsUser: 1000 + +service: + type: ClusterIP + port: 80 + +ingress: + enabled: false + className: "" + annotations: {} + # kubernetes.io/ingress.class: nginx + # kubernetes.io/tls-acme: "true" + hosts: + - host: chart-example.local + paths: + - path: / + pathType: ImplementationSpecific + tls: [] + # - secretName: chart-example-tls + # hosts: + # - chart-example.local + +resources: {} + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 128Mi + +autoscaling: + enabled: false + minReplicas: 1 + maxReplicas: 100 + targetCPUUtilizationPercentage: 80 + # targetMemoryUtilizationPercentage: 80 + +nodeSelector: {} + +tolerations: [] + +affinity: {} diff --git a/manifest/helm-charts/services/charts/openim-msgtransfer/.helmignore b/manifest/helm-charts/services/charts/openim-msgtransfer/.helmignore new file mode 100644 index 000000000..0e8a0eb36 --- /dev/null +++ b/manifest/helm-charts/services/charts/openim-msgtransfer/.helmignore @@ -0,0 +1,23 @@ +# 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/manifest/helm-charts/services/charts/openim-msgtransfer/Chart.yaml b/manifest/helm-charts/services/charts/openim-msgtransfer/Chart.yaml new file mode 100644 index 000000000..4b4ea20ba --- /dev/null +++ b/manifest/helm-charts/services/charts/openim-msgtransfer/Chart.yaml @@ -0,0 +1,24 @@ +apiVersion: v2 +name: openim-msgtransfer +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" diff --git a/manifest/helm-charts/services/charts/openim-msgtransfer/templates/NOTES.txt b/manifest/helm-charts/services/charts/openim-msgtransfer/templates/NOTES.txt new file mode 100644 index 000000000..a9876065d --- /dev/null +++ b/manifest/helm-charts/services/charts/openim-msgtransfer/templates/NOTES.txt @@ -0,0 +1,22 @@ +1. Get the application URL by running these commands: +{{- if .Values.ingress.enabled }} +{{- range $host := .Values.ingress.hosts }} + {{- range .paths }} + http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }} + {{- end }} +{{- end }} +{{- else if contains "NodePort" .Values.service.type }} + export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "openim-msgtransfer.fullname" . }}) + export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") + echo http://$NODE_IP:$NODE_PORT +{{- else if contains "LoadBalancer" .Values.service.type }} + NOTE: It may take a few minutes for the LoadBalancer IP to be available. + You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "openim-msgtransfer.fullname" . }}' + export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "openim-msgtransfer.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") + echo http://$SERVICE_IP:{{ .Values.service.port }} +{{- else if contains "ClusterIP" .Values.service.type }} + export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "openim-msgtransfer.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") + export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}") + echo "Visit http://127.0.0.1:8080 to use your application" + kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT +{{- end }} diff --git a/manifest/helm-charts/services/charts/openim-msgtransfer/templates/_helpers.tpl b/manifest/helm-charts/services/charts/openim-msgtransfer/templates/_helpers.tpl new file mode 100644 index 000000000..39f7a9acf --- /dev/null +++ b/manifest/helm-charts/services/charts/openim-msgtransfer/templates/_helpers.tpl @@ -0,0 +1,62 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "openim-msgtransfer.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 "openim-msgtransfer.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 "openim-msgtransfer.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "openim-msgtransfer.labels" -}} +helm.sh/chart: {{ include "openim-msgtransfer.chart" . }} +{{ include "openim-msgtransfer.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "openim-msgtransfer.selectorLabels" -}} +app.kubernetes.io/name: {{ include "openim-msgtransfer.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Create the name of the service account to use +*/}} +{{- define "openim-msgtransfer.serviceAccountName" -}} +{{- if .Values.serviceAccount.create }} +{{- default (include "openim-msgtransfer.fullname" .) .Values.serviceAccount.name }} +{{- else }} +{{- default "default" .Values.serviceAccount.name }} +{{- end }} +{{- end }} diff --git a/manifest/helm-charts/services/charts/openim-msgtransfer/templates/deployment.yaml b/manifest/helm-charts/services/charts/openim-msgtransfer/templates/deployment.yaml new file mode 100644 index 000000000..da2575b51 --- /dev/null +++ b/manifest/helm-charts/services/charts/openim-msgtransfer/templates/deployment.yaml @@ -0,0 +1,61 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "openim-msgtransfer.fullname" . }} + labels: + {{- include "openim-msgtransfer.labels" . | nindent 4 }} +spec: + {{- if not .Values.autoscaling.enabled }} + replicas: {{ .Values.replicaCount }} + {{- end }} + selector: + matchLabels: + {{- include "openim-msgtransfer.selectorLabels" . | nindent 6 }} + template: + metadata: + {{- with .Values.podAnnotations }} + annotations: + {{- toYaml . | nindent 8 }} + {{- end }} + labels: + {{- include "openim-msgtransfer.selectorLabels" . | nindent 8 }} + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + serviceAccountName: {{ include "openim-msgtransfer.serviceAccountName" . }} + securityContext: + {{- toYaml .Values.podSecurityContext | nindent 8 }} + containers: + - name: {{ .Chart.Name }} + securityContext: + {{- toYaml .Values.securityContext | nindent 12 }} + image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + ports: + - name: http + containerPort: 80 + protocol: TCP + livenessProbe: + httpGet: + path: / + port: http + readinessProbe: + httpGet: + path: / + port: http + resources: + {{- toYaml .Values.resources | nindent 12 }} + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} diff --git a/manifest/helm-charts/services/charts/openim-msgtransfer/templates/hpa.yaml b/manifest/helm-charts/services/charts/openim-msgtransfer/templates/hpa.yaml new file mode 100644 index 000000000..75c7d4fef --- /dev/null +++ b/manifest/helm-charts/services/charts/openim-msgtransfer/templates/hpa.yaml @@ -0,0 +1,28 @@ +{{- if .Values.autoscaling.enabled }} +apiVersion: autoscaling/v2beta1 +kind: HorizontalPodAutoscaler +metadata: + name: {{ include "openim-msgtransfer.fullname" . }} + labels: + {{- include "openim-msgtransfer.labels" . | nindent 4 }} +spec: + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: {{ include "openim-msgtransfer.fullname" . }} + minReplicas: {{ .Values.autoscaling.minReplicas }} + maxReplicas: {{ .Values.autoscaling.maxReplicas }} + metrics: + {{- if .Values.autoscaling.targetCPUUtilizationPercentage }} + - type: Resource + resource: + name: cpu + targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} + {{- end }} + {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }} + - type: Resource + resource: + name: memory + targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} + {{- end }} +{{- end }} diff --git a/manifest/helm-charts/services/charts/openim-msgtransfer/templates/ingress.yaml b/manifest/helm-charts/services/charts/openim-msgtransfer/templates/ingress.yaml new file mode 100644 index 000000000..c9968a438 --- /dev/null +++ b/manifest/helm-charts/services/charts/openim-msgtransfer/templates/ingress.yaml @@ -0,0 +1,61 @@ +{{- if .Values.ingress.enabled -}} +{{- $fullName := include "openim-msgtransfer.fullname" . -}} +{{- $svcPort := .Values.service.port -}} +{{- if and .Values.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }} + {{- if not (hasKey .Values.ingress.annotations "kubernetes.io/ingress.class") }} + {{- $_ := set .Values.ingress.annotations "kubernetes.io/ingress.class" .Values.ingress.className}} + {{- end }} +{{- end }} +{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}} +apiVersion: networking.k8s.io/v1 +{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} +apiVersion: networking.k8s.io/v1beta1 +{{- else -}} +apiVersion: extensions/v1beta1 +{{- end }} +kind: Ingress +metadata: + name: {{ $fullName }} + labels: + {{- include "openim-msgtransfer.labels" . | nindent 4 }} + {{- with .Values.ingress.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + {{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }} + ingressClassName: {{ .Values.ingress.className }} + {{- end }} + {{- if .Values.ingress.tls }} + tls: + {{- range .Values.ingress.tls }} + - hosts: + {{- range .hosts }} + - {{ . | quote }} + {{- end }} + secretName: {{ .secretName }} + {{- end }} + {{- end }} + rules: + {{- range .Values.ingress.hosts }} + - host: {{ .host | quote }} + http: + paths: + {{- range .paths }} + - path: {{ .path }} + {{- if and .pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }} + pathType: {{ .pathType }} + {{- end }} + backend: + {{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }} + service: + name: {{ $fullName }} + port: + number: {{ $svcPort }} + {{- else }} + serviceName: {{ $fullName }} + servicePort: {{ $svcPort }} + {{- end }} + {{- end }} + {{- end }} +{{- end }} diff --git a/manifest/helm-charts/services/charts/openim-msgtransfer/templates/service.yaml b/manifest/helm-charts/services/charts/openim-msgtransfer/templates/service.yaml new file mode 100644 index 000000000..839e520e5 --- /dev/null +++ b/manifest/helm-charts/services/charts/openim-msgtransfer/templates/service.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "openim-msgtransfer.fullname" . }} + labels: + {{- include "openim-msgtransfer.labels" . | nindent 4 }} +spec: + type: {{ .Values.service.type }} + ports: + - port: {{ .Values.service.port }} + targetPort: http + protocol: TCP + name: http + selector: + {{- include "openim-msgtransfer.selectorLabels" . | nindent 4 }} diff --git a/manifest/helm-charts/services/charts/openim-msgtransfer/templates/serviceaccount.yaml b/manifest/helm-charts/services/charts/openim-msgtransfer/templates/serviceaccount.yaml new file mode 100644 index 000000000..2e3ca4ee7 --- /dev/null +++ b/manifest/helm-charts/services/charts/openim-msgtransfer/templates/serviceaccount.yaml @@ -0,0 +1,12 @@ +{{- if .Values.serviceAccount.create -}} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "openim-msgtransfer.serviceAccountName" . }} + labels: + {{- include "openim-msgtransfer.labels" . | nindent 4 }} + {{- with .Values.serviceAccount.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +{{- end }} diff --git a/manifest/helm-charts/services/charts/openim-msgtransfer/values.yaml b/manifest/helm-charts/services/charts/openim-msgtransfer/values.yaml new file mode 100644 index 000000000..9bd7c65bf --- /dev/null +++ b/manifest/helm-charts/services/charts/openim-msgtransfer/values.yaml @@ -0,0 +1,82 @@ +# Default values for openim-msgtransfer. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +replicaCount: 1 + +image: + repository: nginx + pullPolicy: IfNotPresent + # Overrides the image tag whose default is the chart appVersion. + tag: "" + +imagePullSecrets: [] +nameOverride: "" +fullnameOverride: "" + +serviceAccount: + # Specifies whether a service account should be created + create: true + # Annotations to add to the service account + annotations: {} + # The name of the service account to use. + # If not set and create is true, a name is generated using the fullname template + name: "" + +podAnnotations: {} + +podSecurityContext: {} + # fsGroup: 2000 + +securityContext: {} + # capabilities: + # drop: + # - ALL + # readOnlyRootFilesystem: true + # runAsNonRoot: true + # runAsUser: 1000 + +service: + type: ClusterIP + port: 80 + +ingress: + enabled: false + className: "" + annotations: {} + # kubernetes.io/ingress.class: nginx + # kubernetes.io/tls-acme: "true" + hosts: + - host: chart-example.local + paths: + - path: / + pathType: ImplementationSpecific + tls: [] + # - secretName: chart-example-tls + # hosts: + # - chart-example.local + +resources: {} + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 128Mi + +autoscaling: + enabled: false + minReplicas: 1 + maxReplicas: 100 + targetCPUUtilizationPercentage: 80 + # targetMemoryUtilizationPercentage: 80 + +nodeSelector: {} + +tolerations: [] + +affinity: {} diff --git a/manifest/helm-charts/services/charts/openim-push/.helmignore b/manifest/helm-charts/services/charts/openim-push/.helmignore new file mode 100644 index 000000000..0e8a0eb36 --- /dev/null +++ b/manifest/helm-charts/services/charts/openim-push/.helmignore @@ -0,0 +1,23 @@ +# 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/manifest/helm-charts/services/charts/openim-push/Chart.yaml b/manifest/helm-charts/services/charts/openim-push/Chart.yaml new file mode 100644 index 000000000..d4596d324 --- /dev/null +++ b/manifest/helm-charts/services/charts/openim-push/Chart.yaml @@ -0,0 +1,24 @@ +apiVersion: v2 +name: openim-push +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" diff --git a/manifest/helm-charts/services/charts/openim-push/templates/NOTES.txt b/manifest/helm-charts/services/charts/openim-push/templates/NOTES.txt new file mode 100644 index 000000000..625c39050 --- /dev/null +++ b/manifest/helm-charts/services/charts/openim-push/templates/NOTES.txt @@ -0,0 +1,22 @@ +1. Get the application URL by running these commands: +{{- if .Values.ingress.enabled }} +{{- range $host := .Values.ingress.hosts }} + {{- range .paths }} + http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }} + {{- end }} +{{- end }} +{{- else if contains "NodePort" .Values.service.type }} + export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "openim-push.fullname" . }}) + export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") + echo http://$NODE_IP:$NODE_PORT +{{- else if contains "LoadBalancer" .Values.service.type }} + NOTE: It may take a few minutes for the LoadBalancer IP to be available. + You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "openim-push.fullname" . }}' + export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "openim-push.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") + echo http://$SERVICE_IP:{{ .Values.service.port }} +{{- else if contains "ClusterIP" .Values.service.type }} + export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "openim-push.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") + export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}") + echo "Visit http://127.0.0.1:8080 to use your application" + kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT +{{- end }} diff --git a/manifest/helm-charts/services/charts/openim-push/templates/_helpers.tpl b/manifest/helm-charts/services/charts/openim-push/templates/_helpers.tpl new file mode 100644 index 000000000..050428471 --- /dev/null +++ b/manifest/helm-charts/services/charts/openim-push/templates/_helpers.tpl @@ -0,0 +1,62 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "openim-push.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 "openim-push.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 "openim-push.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "openim-push.labels" -}} +helm.sh/chart: {{ include "openim-push.chart" . }} +{{ include "openim-push.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "openim-push.selectorLabels" -}} +app.kubernetes.io/name: {{ include "openim-push.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Create the name of the service account to use +*/}} +{{- define "openim-push.serviceAccountName" -}} +{{- if .Values.serviceAccount.create }} +{{- default (include "openim-push.fullname" .) .Values.serviceAccount.name }} +{{- else }} +{{- default "default" .Values.serviceAccount.name }} +{{- end }} +{{- end }} diff --git a/manifest/helm-charts/services/charts/openim-push/templates/deployment.yaml b/manifest/helm-charts/services/charts/openim-push/templates/deployment.yaml new file mode 100644 index 000000000..e29e5d0f3 --- /dev/null +++ b/manifest/helm-charts/services/charts/openim-push/templates/deployment.yaml @@ -0,0 +1,61 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "openim-push.fullname" . }} + labels: + {{- include "openim-push.labels" . | nindent 4 }} +spec: + {{- if not .Values.autoscaling.enabled }} + replicas: {{ .Values.replicaCount }} + {{- end }} + selector: + matchLabels: + {{- include "openim-push.selectorLabels" . | nindent 6 }} + template: + metadata: + {{- with .Values.podAnnotations }} + annotations: + {{- toYaml . | nindent 8 }} + {{- end }} + labels: + {{- include "openim-push.selectorLabels" . | nindent 8 }} + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + serviceAccountName: {{ include "openim-push.serviceAccountName" . }} + securityContext: + {{- toYaml .Values.podSecurityContext | nindent 8 }} + containers: + - name: {{ .Chart.Name }} + securityContext: + {{- toYaml .Values.securityContext | nindent 12 }} + image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + ports: + - name: http + containerPort: 80 + protocol: TCP + livenessProbe: + httpGet: + path: / + port: http + readinessProbe: + httpGet: + path: / + port: http + resources: + {{- toYaml .Values.resources | nindent 12 }} + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} diff --git a/manifest/helm-charts/services/charts/openim-push/templates/hpa.yaml b/manifest/helm-charts/services/charts/openim-push/templates/hpa.yaml new file mode 100644 index 000000000..89c89c041 --- /dev/null +++ b/manifest/helm-charts/services/charts/openim-push/templates/hpa.yaml @@ -0,0 +1,28 @@ +{{- if .Values.autoscaling.enabled }} +apiVersion: autoscaling/v2beta1 +kind: HorizontalPodAutoscaler +metadata: + name: {{ include "openim-push.fullname" . }} + labels: + {{- include "openim-push.labels" . | nindent 4 }} +spec: + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: {{ include "openim-push.fullname" . }} + minReplicas: {{ .Values.autoscaling.minReplicas }} + maxReplicas: {{ .Values.autoscaling.maxReplicas }} + metrics: + {{- if .Values.autoscaling.targetCPUUtilizationPercentage }} + - type: Resource + resource: + name: cpu + targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} + {{- end }} + {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }} + - type: Resource + resource: + name: memory + targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} + {{- end }} +{{- end }} diff --git a/manifest/helm-charts/services/charts/openim-push/templates/ingress.yaml b/manifest/helm-charts/services/charts/openim-push/templates/ingress.yaml new file mode 100644 index 000000000..b00fda3d3 --- /dev/null +++ b/manifest/helm-charts/services/charts/openim-push/templates/ingress.yaml @@ -0,0 +1,61 @@ +{{- if .Values.ingress.enabled -}} +{{- $fullName := include "openim-push.fullname" . -}} +{{- $svcPort := .Values.service.port -}} +{{- if and .Values.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }} + {{- if not (hasKey .Values.ingress.annotations "kubernetes.io/ingress.class") }} + {{- $_ := set .Values.ingress.annotations "kubernetes.io/ingress.class" .Values.ingress.className}} + {{- end }} +{{- end }} +{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}} +apiVersion: networking.k8s.io/v1 +{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} +apiVersion: networking.k8s.io/v1beta1 +{{- else -}} +apiVersion: extensions/v1beta1 +{{- end }} +kind: Ingress +metadata: + name: {{ $fullName }} + labels: + {{- include "openim-push.labels" . | nindent 4 }} + {{- with .Values.ingress.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + {{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }} + ingressClassName: {{ .Values.ingress.className }} + {{- end }} + {{- if .Values.ingress.tls }} + tls: + {{- range .Values.ingress.tls }} + - hosts: + {{- range .hosts }} + - {{ . | quote }} + {{- end }} + secretName: {{ .secretName }} + {{- end }} + {{- end }} + rules: + {{- range .Values.ingress.hosts }} + - host: {{ .host | quote }} + http: + paths: + {{- range .paths }} + - path: {{ .path }} + {{- if and .pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }} + pathType: {{ .pathType }} + {{- end }} + backend: + {{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }} + service: + name: {{ $fullName }} + port: + number: {{ $svcPort }} + {{- else }} + serviceName: {{ $fullName }} + servicePort: {{ $svcPort }} + {{- end }} + {{- end }} + {{- end }} +{{- end }} diff --git a/manifest/helm-charts/services/charts/openim-push/templates/service.yaml b/manifest/helm-charts/services/charts/openim-push/templates/service.yaml new file mode 100644 index 000000000..4d8bb0457 --- /dev/null +++ b/manifest/helm-charts/services/charts/openim-push/templates/service.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "openim-push.fullname" . }} + labels: + {{- include "openim-push.labels" . | nindent 4 }} +spec: + type: {{ .Values.service.type }} + ports: + - port: {{ .Values.service.port }} + targetPort: http + protocol: TCP + name: http + selector: + {{- include "openim-push.selectorLabels" . | nindent 4 }} diff --git a/manifest/helm-charts/services/charts/openim-push/templates/serviceaccount.yaml b/manifest/helm-charts/services/charts/openim-push/templates/serviceaccount.yaml new file mode 100644 index 000000000..e22115724 --- /dev/null +++ b/manifest/helm-charts/services/charts/openim-push/templates/serviceaccount.yaml @@ -0,0 +1,12 @@ +{{- if .Values.serviceAccount.create -}} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "openim-push.serviceAccountName" . }} + labels: + {{- include "openim-push.labels" . | nindent 4 }} + {{- with .Values.serviceAccount.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +{{- end }} diff --git a/manifest/helm-charts/services/charts/openim-push/values.yaml b/manifest/helm-charts/services/charts/openim-push/values.yaml new file mode 100644 index 000000000..31aa62c71 --- /dev/null +++ b/manifest/helm-charts/services/charts/openim-push/values.yaml @@ -0,0 +1,82 @@ +# Default values for openim-push. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +replicaCount: 1 + +image: + repository: nginx + pullPolicy: IfNotPresent + # Overrides the image tag whose default is the chart appVersion. + tag: "" + +imagePullSecrets: [] +nameOverride: "" +fullnameOverride: "" + +serviceAccount: + # Specifies whether a service account should be created + create: true + # Annotations to add to the service account + annotations: {} + # The name of the service account to use. + # If not set and create is true, a name is generated using the fullname template + name: "" + +podAnnotations: {} + +podSecurityContext: {} + # fsGroup: 2000 + +securityContext: {} + # capabilities: + # drop: + # - ALL + # readOnlyRootFilesystem: true + # runAsNonRoot: true + # runAsUser: 1000 + +service: + type: ClusterIP + port: 80 + +ingress: + enabled: false + className: "" + annotations: {} + # kubernetes.io/ingress.class: nginx + # kubernetes.io/tls-acme: "true" + hosts: + - host: chart-example.local + paths: + - path: / + pathType: ImplementationSpecific + tls: [] + # - secretName: chart-example-tls + # hosts: + # - chart-example.local + +resources: {} + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 128Mi + +autoscaling: + enabled: false + minReplicas: 1 + maxReplicas: 100 + targetCPUUtilizationPercentage: 80 + # targetMemoryUtilizationPercentage: 80 + +nodeSelector: {} + +tolerations: [] + +affinity: {} diff --git a/manifest/helm-charts/services/charts/openim-rpc-auth/.helmignore b/manifest/helm-charts/services/charts/openim-rpc-auth/.helmignore new file mode 100644 index 000000000..0e8a0eb36 --- /dev/null +++ b/manifest/helm-charts/services/charts/openim-rpc-auth/.helmignore @@ -0,0 +1,23 @@ +# 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/manifest/helm-charts/services/charts/openim-rpc-auth/Chart.yaml b/manifest/helm-charts/services/charts/openim-rpc-auth/Chart.yaml new file mode 100644 index 000000000..177cb8fa8 --- /dev/null +++ b/manifest/helm-charts/services/charts/openim-rpc-auth/Chart.yaml @@ -0,0 +1,24 @@ +apiVersion: v2 +name: openim-rpc-auth +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" diff --git a/manifest/helm-charts/services/charts/openim-rpc-auth/templates/NOTES.txt b/manifest/helm-charts/services/charts/openim-rpc-auth/templates/NOTES.txt new file mode 100644 index 000000000..220602077 --- /dev/null +++ b/manifest/helm-charts/services/charts/openim-rpc-auth/templates/NOTES.txt @@ -0,0 +1,22 @@ +1. Get the application URL by running these commands: +{{- if .Values.ingress.enabled }} +{{- range $host := .Values.ingress.hosts }} + {{- range .paths }} + http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }} + {{- end }} +{{- end }} +{{- else if contains "NodePort" .Values.service.type }} + export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "openim-rpc-auth.fullname" . }}) + export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") + echo http://$NODE_IP:$NODE_PORT +{{- else if contains "LoadBalancer" .Values.service.type }} + NOTE: It may take a few minutes for the LoadBalancer IP to be available. + You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "openim-rpc-auth.fullname" . }}' + export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "openim-rpc-auth.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") + echo http://$SERVICE_IP:{{ .Values.service.port }} +{{- else if contains "ClusterIP" .Values.service.type }} + export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "openim-rpc-auth.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") + export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}") + echo "Visit http://127.0.0.1:8080 to use your application" + kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT +{{- end }} diff --git a/manifest/helm-charts/services/charts/openim-rpc-auth/templates/_helpers.tpl b/manifest/helm-charts/services/charts/openim-rpc-auth/templates/_helpers.tpl new file mode 100644 index 000000000..cb6575872 --- /dev/null +++ b/manifest/helm-charts/services/charts/openim-rpc-auth/templates/_helpers.tpl @@ -0,0 +1,62 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "openim-rpc-auth.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 "openim-rpc-auth.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 "openim-rpc-auth.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "openim-rpc-auth.labels" -}} +helm.sh/chart: {{ include "openim-rpc-auth.chart" . }} +{{ include "openim-rpc-auth.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "openim-rpc-auth.selectorLabels" -}} +app.kubernetes.io/name: {{ include "openim-rpc-auth.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Create the name of the service account to use +*/}} +{{- define "openim-rpc-auth.serviceAccountName" -}} +{{- if .Values.serviceAccount.create }} +{{- default (include "openim-rpc-auth.fullname" .) .Values.serviceAccount.name }} +{{- else }} +{{- default "default" .Values.serviceAccount.name }} +{{- end }} +{{- end }} diff --git a/manifest/helm-charts/services/charts/openim-rpc-auth/templates/deployment.yaml b/manifest/helm-charts/services/charts/openim-rpc-auth/templates/deployment.yaml new file mode 100644 index 000000000..996548949 --- /dev/null +++ b/manifest/helm-charts/services/charts/openim-rpc-auth/templates/deployment.yaml @@ -0,0 +1,61 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "openim-rpc-auth.fullname" . }} + labels: + {{- include "openim-rpc-auth.labels" . | nindent 4 }} +spec: + {{- if not .Values.autoscaling.enabled }} + replicas: {{ .Values.replicaCount }} + {{- end }} + selector: + matchLabels: + {{- include "openim-rpc-auth.selectorLabels" . | nindent 6 }} + template: + metadata: + {{- with .Values.podAnnotations }} + annotations: + {{- toYaml . | nindent 8 }} + {{- end }} + labels: + {{- include "openim-rpc-auth.selectorLabels" . | nindent 8 }} + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + serviceAccountName: {{ include "openim-rpc-auth.serviceAccountName" . }} + securityContext: + {{- toYaml .Values.podSecurityContext | nindent 8 }} + containers: + - name: {{ .Chart.Name }} + securityContext: + {{- toYaml .Values.securityContext | nindent 12 }} + image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + ports: + - name: http + containerPort: 80 + protocol: TCP + livenessProbe: + httpGet: + path: / + port: http + readinessProbe: + httpGet: + path: / + port: http + resources: + {{- toYaml .Values.resources | nindent 12 }} + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} diff --git a/manifest/helm-charts/services/charts/openim-rpc-auth/templates/hpa.yaml b/manifest/helm-charts/services/charts/openim-rpc-auth/templates/hpa.yaml new file mode 100644 index 000000000..20108afbf --- /dev/null +++ b/manifest/helm-charts/services/charts/openim-rpc-auth/templates/hpa.yaml @@ -0,0 +1,28 @@ +{{- if .Values.autoscaling.enabled }} +apiVersion: autoscaling/v2beta1 +kind: HorizontalPodAutoscaler +metadata: + name: {{ include "openim-rpc-auth.fullname" . }} + labels: + {{- include "openim-rpc-auth.labels" . | nindent 4 }} +spec: + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: {{ include "openim-rpc-auth.fullname" . }} + minReplicas: {{ .Values.autoscaling.minReplicas }} + maxReplicas: {{ .Values.autoscaling.maxReplicas }} + metrics: + {{- if .Values.autoscaling.targetCPUUtilizationPercentage }} + - type: Resource + resource: + name: cpu + targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} + {{- end }} + {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }} + - type: Resource + resource: + name: memory + targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} + {{- end }} +{{- end }} diff --git a/manifest/helm-charts/services/charts/openim-rpc-auth/templates/ingress.yaml b/manifest/helm-charts/services/charts/openim-rpc-auth/templates/ingress.yaml new file mode 100644 index 000000000..f14458c52 --- /dev/null +++ b/manifest/helm-charts/services/charts/openim-rpc-auth/templates/ingress.yaml @@ -0,0 +1,61 @@ +{{- if .Values.ingress.enabled -}} +{{- $fullName := include "openim-rpc-auth.fullname" . -}} +{{- $svcPort := .Values.service.port -}} +{{- if and .Values.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }} + {{- if not (hasKey .Values.ingress.annotations "kubernetes.io/ingress.class") }} + {{- $_ := set .Values.ingress.annotations "kubernetes.io/ingress.class" .Values.ingress.className}} + {{- end }} +{{- end }} +{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}} +apiVersion: networking.k8s.io/v1 +{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} +apiVersion: networking.k8s.io/v1beta1 +{{- else -}} +apiVersion: extensions/v1beta1 +{{- end }} +kind: Ingress +metadata: + name: {{ $fullName }} + labels: + {{- include "openim-rpc-auth.labels" . | nindent 4 }} + {{- with .Values.ingress.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + {{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }} + ingressClassName: {{ .Values.ingress.className }} + {{- end }} + {{- if .Values.ingress.tls }} + tls: + {{- range .Values.ingress.tls }} + - hosts: + {{- range .hosts }} + - {{ . | quote }} + {{- end }} + secretName: {{ .secretName }} + {{- end }} + {{- end }} + rules: + {{- range .Values.ingress.hosts }} + - host: {{ .host | quote }} + http: + paths: + {{- range .paths }} + - path: {{ .path }} + {{- if and .pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }} + pathType: {{ .pathType }} + {{- end }} + backend: + {{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }} + service: + name: {{ $fullName }} + port: + number: {{ $svcPort }} + {{- else }} + serviceName: {{ $fullName }} + servicePort: {{ $svcPort }} + {{- end }} + {{- end }} + {{- end }} +{{- end }} diff --git a/manifest/helm-charts/services/charts/openim-rpc-auth/templates/service.yaml b/manifest/helm-charts/services/charts/openim-rpc-auth/templates/service.yaml new file mode 100644 index 000000000..ef7b00b86 --- /dev/null +++ b/manifest/helm-charts/services/charts/openim-rpc-auth/templates/service.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "openim-rpc-auth.fullname" . }} + labels: + {{- include "openim-rpc-auth.labels" . | nindent 4 }} +spec: + type: {{ .Values.service.type }} + ports: + - port: {{ .Values.service.port }} + targetPort: http + protocol: TCP + name: http + selector: + {{- include "openim-rpc-auth.selectorLabels" . | nindent 4 }} diff --git a/manifest/helm-charts/services/charts/openim-rpc-auth/templates/serviceaccount.yaml b/manifest/helm-charts/services/charts/openim-rpc-auth/templates/serviceaccount.yaml new file mode 100644 index 000000000..f13dcca81 --- /dev/null +++ b/manifest/helm-charts/services/charts/openim-rpc-auth/templates/serviceaccount.yaml @@ -0,0 +1,12 @@ +{{- if .Values.serviceAccount.create -}} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "openim-rpc-auth.serviceAccountName" . }} + labels: + {{- include "openim-rpc-auth.labels" . | nindent 4 }} + {{- with .Values.serviceAccount.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +{{- end }} diff --git a/manifest/helm-charts/services/charts/openim-rpc-auth/values.yaml b/manifest/helm-charts/services/charts/openim-rpc-auth/values.yaml new file mode 100644 index 000000000..c5dbb0a3f --- /dev/null +++ b/manifest/helm-charts/services/charts/openim-rpc-auth/values.yaml @@ -0,0 +1,82 @@ +# Default values for openim-rpc-auth. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +replicaCount: 1 + +image: + repository: nginx + pullPolicy: IfNotPresent + # Overrides the image tag whose default is the chart appVersion. + tag: "" + +imagePullSecrets: [] +nameOverride: "" +fullnameOverride: "" + +serviceAccount: + # Specifies whether a service account should be created + create: true + # Annotations to add to the service account + annotations: {} + # The name of the service account to use. + # If not set and create is true, a name is generated using the fullname template + name: "" + +podAnnotations: {} + +podSecurityContext: {} + # fsGroup: 2000 + +securityContext: {} + # capabilities: + # drop: + # - ALL + # readOnlyRootFilesystem: true + # runAsNonRoot: true + # runAsUser: 1000 + +service: + type: ClusterIP + port: 80 + +ingress: + enabled: false + className: "" + annotations: {} + # kubernetes.io/ingress.class: nginx + # kubernetes.io/tls-acme: "true" + hosts: + - host: chart-example.local + paths: + - path: / + pathType: ImplementationSpecific + tls: [] + # - secretName: chart-example-tls + # hosts: + # - chart-example.local + +resources: {} + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 128Mi + +autoscaling: + enabled: false + minReplicas: 1 + maxReplicas: 100 + targetCPUUtilizationPercentage: 80 + # targetMemoryUtilizationPercentage: 80 + +nodeSelector: {} + +tolerations: [] + +affinity: {} diff --git a/manifest/helm-charts/services/charts/openim-rpc-conversation/.helmignore b/manifest/helm-charts/services/charts/openim-rpc-conversation/.helmignore new file mode 100644 index 000000000..0e8a0eb36 --- /dev/null +++ b/manifest/helm-charts/services/charts/openim-rpc-conversation/.helmignore @@ -0,0 +1,23 @@ +# 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/manifest/helm-charts/services/charts/openim-rpc-conversation/Chart.yaml b/manifest/helm-charts/services/charts/openim-rpc-conversation/Chart.yaml new file mode 100644 index 000000000..4de5f4d82 --- /dev/null +++ b/manifest/helm-charts/services/charts/openim-rpc-conversation/Chart.yaml @@ -0,0 +1,24 @@ +apiVersion: v2 +name: openim-rpc-conversation +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" diff --git a/manifest/helm-charts/services/charts/openim-rpc-conversation/templates/NOTES.txt b/manifest/helm-charts/services/charts/openim-rpc-conversation/templates/NOTES.txt new file mode 100644 index 000000000..287f2fd64 --- /dev/null +++ b/manifest/helm-charts/services/charts/openim-rpc-conversation/templates/NOTES.txt @@ -0,0 +1,22 @@ +1. Get the application URL by running these commands: +{{- if .Values.ingress.enabled }} +{{- range $host := .Values.ingress.hosts }} + {{- range .paths }} + http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }} + {{- end }} +{{- end }} +{{- else if contains "NodePort" .Values.service.type }} + export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "openim-rpc-conversation.fullname" . }}) + export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") + echo http://$NODE_IP:$NODE_PORT +{{- else if contains "LoadBalancer" .Values.service.type }} + NOTE: It may take a few minutes for the LoadBalancer IP to be available. + You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "openim-rpc-conversation.fullname" . }}' + export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "openim-rpc-conversation.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") + echo http://$SERVICE_IP:{{ .Values.service.port }} +{{- else if contains "ClusterIP" .Values.service.type }} + export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "openim-rpc-conversation.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") + export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}") + echo "Visit http://127.0.0.1:8080 to use your application" + kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT +{{- end }} diff --git a/manifest/helm-charts/services/charts/openim-rpc-conversation/templates/_helpers.tpl b/manifest/helm-charts/services/charts/openim-rpc-conversation/templates/_helpers.tpl new file mode 100644 index 000000000..184271057 --- /dev/null +++ b/manifest/helm-charts/services/charts/openim-rpc-conversation/templates/_helpers.tpl @@ -0,0 +1,62 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "openim-rpc-conversation.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 "openim-rpc-conversation.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 "openim-rpc-conversation.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "openim-rpc-conversation.labels" -}} +helm.sh/chart: {{ include "openim-rpc-conversation.chart" . }} +{{ include "openim-rpc-conversation.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "openim-rpc-conversation.selectorLabels" -}} +app.kubernetes.io/name: {{ include "openim-rpc-conversation.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Create the name of the service account to use +*/}} +{{- define "openim-rpc-conversation.serviceAccountName" -}} +{{- if .Values.serviceAccount.create }} +{{- default (include "openim-rpc-conversation.fullname" .) .Values.serviceAccount.name }} +{{- else }} +{{- default "default" .Values.serviceAccount.name }} +{{- end }} +{{- end }} diff --git a/manifest/helm-charts/services/charts/openim-rpc-conversation/templates/deployment.yaml b/manifest/helm-charts/services/charts/openim-rpc-conversation/templates/deployment.yaml new file mode 100644 index 000000000..d142f6026 --- /dev/null +++ b/manifest/helm-charts/services/charts/openim-rpc-conversation/templates/deployment.yaml @@ -0,0 +1,61 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "openim-rpc-conversation.fullname" . }} + labels: + {{- include "openim-rpc-conversation.labels" . | nindent 4 }} +spec: + {{- if not .Values.autoscaling.enabled }} + replicas: {{ .Values.replicaCount }} + {{- end }} + selector: + matchLabels: + {{- include "openim-rpc-conversation.selectorLabels" . | nindent 6 }} + template: + metadata: + {{- with .Values.podAnnotations }} + annotations: + {{- toYaml . | nindent 8 }} + {{- end }} + labels: + {{- include "openim-rpc-conversation.selectorLabels" . | nindent 8 }} + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + serviceAccountName: {{ include "openim-rpc-conversation.serviceAccountName" . }} + securityContext: + {{- toYaml .Values.podSecurityContext | nindent 8 }} + containers: + - name: {{ .Chart.Name }} + securityContext: + {{- toYaml .Values.securityContext | nindent 12 }} + image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + ports: + - name: http + containerPort: 80 + protocol: TCP + livenessProbe: + httpGet: + path: / + port: http + readinessProbe: + httpGet: + path: / + port: http + resources: + {{- toYaml .Values.resources | nindent 12 }} + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} diff --git a/manifest/helm-charts/services/charts/openim-rpc-conversation/templates/hpa.yaml b/manifest/helm-charts/services/charts/openim-rpc-conversation/templates/hpa.yaml new file mode 100644 index 000000000..a2378bfa0 --- /dev/null +++ b/manifest/helm-charts/services/charts/openim-rpc-conversation/templates/hpa.yaml @@ -0,0 +1,28 @@ +{{- if .Values.autoscaling.enabled }} +apiVersion: autoscaling/v2beta1 +kind: HorizontalPodAutoscaler +metadata: + name: {{ include "openim-rpc-conversation.fullname" . }} + labels: + {{- include "openim-rpc-conversation.labels" . | nindent 4 }} +spec: + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: {{ include "openim-rpc-conversation.fullname" . }} + minReplicas: {{ .Values.autoscaling.minReplicas }} + maxReplicas: {{ .Values.autoscaling.maxReplicas }} + metrics: + {{- if .Values.autoscaling.targetCPUUtilizationPercentage }} + - type: Resource + resource: + name: cpu + targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} + {{- end }} + {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }} + - type: Resource + resource: + name: memory + targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} + {{- end }} +{{- end }} diff --git a/manifest/helm-charts/services/charts/openim-rpc-conversation/templates/ingress.yaml b/manifest/helm-charts/services/charts/openim-rpc-conversation/templates/ingress.yaml new file mode 100644 index 000000000..224591f67 --- /dev/null +++ b/manifest/helm-charts/services/charts/openim-rpc-conversation/templates/ingress.yaml @@ -0,0 +1,61 @@ +{{- if .Values.ingress.enabled -}} +{{- $fullName := include "openim-rpc-conversation.fullname" . -}} +{{- $svcPort := .Values.service.port -}} +{{- if and .Values.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }} + {{- if not (hasKey .Values.ingress.annotations "kubernetes.io/ingress.class") }} + {{- $_ := set .Values.ingress.annotations "kubernetes.io/ingress.class" .Values.ingress.className}} + {{- end }} +{{- end }} +{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}} +apiVersion: networking.k8s.io/v1 +{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} +apiVersion: networking.k8s.io/v1beta1 +{{- else -}} +apiVersion: extensions/v1beta1 +{{- end }} +kind: Ingress +metadata: + name: {{ $fullName }} + labels: + {{- include "openim-rpc-conversation.labels" . | nindent 4 }} + {{- with .Values.ingress.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + {{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }} + ingressClassName: {{ .Values.ingress.className }} + {{- end }} + {{- if .Values.ingress.tls }} + tls: + {{- range .Values.ingress.tls }} + - hosts: + {{- range .hosts }} + - {{ . | quote }} + {{- end }} + secretName: {{ .secretName }} + {{- end }} + {{- end }} + rules: + {{- range .Values.ingress.hosts }} + - host: {{ .host | quote }} + http: + paths: + {{- range .paths }} + - path: {{ .path }} + {{- if and .pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }} + pathType: {{ .pathType }} + {{- end }} + backend: + {{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }} + service: + name: {{ $fullName }} + port: + number: {{ $svcPort }} + {{- else }} + serviceName: {{ $fullName }} + servicePort: {{ $svcPort }} + {{- end }} + {{- end }} + {{- end }} +{{- end }} diff --git a/manifest/helm-charts/services/charts/openim-rpc-conversation/templates/service.yaml b/manifest/helm-charts/services/charts/openim-rpc-conversation/templates/service.yaml new file mode 100644 index 000000000..be8355154 --- /dev/null +++ b/manifest/helm-charts/services/charts/openim-rpc-conversation/templates/service.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "openim-rpc-conversation.fullname" . }} + labels: + {{- include "openim-rpc-conversation.labels" . | nindent 4 }} +spec: + type: {{ .Values.service.type }} + ports: + - port: {{ .Values.service.port }} + targetPort: http + protocol: TCP + name: http + selector: + {{- include "openim-rpc-conversation.selectorLabels" . | nindent 4 }} diff --git a/manifest/helm-charts/services/charts/openim-rpc-conversation/templates/serviceaccount.yaml b/manifest/helm-charts/services/charts/openim-rpc-conversation/templates/serviceaccount.yaml new file mode 100644 index 000000000..4e2d0e29f --- /dev/null +++ b/manifest/helm-charts/services/charts/openim-rpc-conversation/templates/serviceaccount.yaml @@ -0,0 +1,12 @@ +{{- if .Values.serviceAccount.create -}} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "openim-rpc-conversation.serviceAccountName" . }} + labels: + {{- include "openim-rpc-conversation.labels" . | nindent 4 }} + {{- with .Values.serviceAccount.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +{{- end }} diff --git a/manifest/helm-charts/services/charts/openim-rpc-conversation/values.yaml b/manifest/helm-charts/services/charts/openim-rpc-conversation/values.yaml new file mode 100644 index 000000000..6c8cba886 --- /dev/null +++ b/manifest/helm-charts/services/charts/openim-rpc-conversation/values.yaml @@ -0,0 +1,82 @@ +# Default values for openim-rpc-conversation. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +replicaCount: 1 + +image: + repository: nginx + pullPolicy: IfNotPresent + # Overrides the image tag whose default is the chart appVersion. + tag: "" + +imagePullSecrets: [] +nameOverride: "" +fullnameOverride: "" + +serviceAccount: + # Specifies whether a service account should be created + create: true + # Annotations to add to the service account + annotations: {} + # The name of the service account to use. + # If not set and create is true, a name is generated using the fullname template + name: "" + +podAnnotations: {} + +podSecurityContext: {} + # fsGroup: 2000 + +securityContext: {} + # capabilities: + # drop: + # - ALL + # readOnlyRootFilesystem: true + # runAsNonRoot: true + # runAsUser: 1000 + +service: + type: ClusterIP + port: 80 + +ingress: + enabled: false + className: "" + annotations: {} + # kubernetes.io/ingress.class: nginx + # kubernetes.io/tls-acme: "true" + hosts: + - host: chart-example.local + paths: + - path: / + pathType: ImplementationSpecific + tls: [] + # - secretName: chart-example-tls + # hosts: + # - chart-example.local + +resources: {} + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 128Mi + +autoscaling: + enabled: false + minReplicas: 1 + maxReplicas: 100 + targetCPUUtilizationPercentage: 80 + # targetMemoryUtilizationPercentage: 80 + +nodeSelector: {} + +tolerations: [] + +affinity: {} diff --git a/manifest/helm-charts/services/charts/openim-rpc-friend/.helmignore b/manifest/helm-charts/services/charts/openim-rpc-friend/.helmignore new file mode 100644 index 000000000..0e8a0eb36 --- /dev/null +++ b/manifest/helm-charts/services/charts/openim-rpc-friend/.helmignore @@ -0,0 +1,23 @@ +# 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/manifest/helm-charts/services/charts/openim-rpc-friend/Chart.yaml b/manifest/helm-charts/services/charts/openim-rpc-friend/Chart.yaml new file mode 100644 index 000000000..ae070fcb5 --- /dev/null +++ b/manifest/helm-charts/services/charts/openim-rpc-friend/Chart.yaml @@ -0,0 +1,24 @@ +apiVersion: v2 +name: openim-rpc-friend +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" diff --git a/manifest/helm-charts/services/charts/openim-rpc-friend/templates/NOTES.txt b/manifest/helm-charts/services/charts/openim-rpc-friend/templates/NOTES.txt new file mode 100644 index 000000000..004ee5c5e --- /dev/null +++ b/manifest/helm-charts/services/charts/openim-rpc-friend/templates/NOTES.txt @@ -0,0 +1,22 @@ +1. Get the application URL by running these commands: +{{- if .Values.ingress.enabled }} +{{- range $host := .Values.ingress.hosts }} + {{- range .paths }} + http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }} + {{- end }} +{{- end }} +{{- else if contains "NodePort" .Values.service.type }} + export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "openim-rpc-friend.fullname" . }}) + export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") + echo http://$NODE_IP:$NODE_PORT +{{- else if contains "LoadBalancer" .Values.service.type }} + NOTE: It may take a few minutes for the LoadBalancer IP to be available. + You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "openim-rpc-friend.fullname" . }}' + export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "openim-rpc-friend.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") + echo http://$SERVICE_IP:{{ .Values.service.port }} +{{- else if contains "ClusterIP" .Values.service.type }} + export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "openim-rpc-friend.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") + export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}") + echo "Visit http://127.0.0.1:8080 to use your application" + kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT +{{- end }} diff --git a/manifest/helm-charts/services/charts/openim-rpc-friend/templates/_helpers.tpl b/manifest/helm-charts/services/charts/openim-rpc-friend/templates/_helpers.tpl new file mode 100644 index 000000000..83719fb31 --- /dev/null +++ b/manifest/helm-charts/services/charts/openim-rpc-friend/templates/_helpers.tpl @@ -0,0 +1,62 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "openim-rpc-friend.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 "openim-rpc-friend.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 "openim-rpc-friend.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "openim-rpc-friend.labels" -}} +helm.sh/chart: {{ include "openim-rpc-friend.chart" . }} +{{ include "openim-rpc-friend.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "openim-rpc-friend.selectorLabels" -}} +app.kubernetes.io/name: {{ include "openim-rpc-friend.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Create the name of the service account to use +*/}} +{{- define "openim-rpc-friend.serviceAccountName" -}} +{{- if .Values.serviceAccount.create }} +{{- default (include "openim-rpc-friend.fullname" .) .Values.serviceAccount.name }} +{{- else }} +{{- default "default" .Values.serviceAccount.name }} +{{- end }} +{{- end }} diff --git a/manifest/helm-charts/services/charts/openim-rpc-friend/templates/deployment.yaml b/manifest/helm-charts/services/charts/openim-rpc-friend/templates/deployment.yaml new file mode 100644 index 000000000..916313dc5 --- /dev/null +++ b/manifest/helm-charts/services/charts/openim-rpc-friend/templates/deployment.yaml @@ -0,0 +1,61 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "openim-rpc-friend.fullname" . }} + labels: + {{- include "openim-rpc-friend.labels" . | nindent 4 }} +spec: + {{- if not .Values.autoscaling.enabled }} + replicas: {{ .Values.replicaCount }} + {{- end }} + selector: + matchLabels: + {{- include "openim-rpc-friend.selectorLabels" . | nindent 6 }} + template: + metadata: + {{- with .Values.podAnnotations }} + annotations: + {{- toYaml . | nindent 8 }} + {{- end }} + labels: + {{- include "openim-rpc-friend.selectorLabels" . | nindent 8 }} + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + serviceAccountName: {{ include "openim-rpc-friend.serviceAccountName" . }} + securityContext: + {{- toYaml .Values.podSecurityContext | nindent 8 }} + containers: + - name: {{ .Chart.Name }} + securityContext: + {{- toYaml .Values.securityContext | nindent 12 }} + image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + ports: + - name: http + containerPort: 80 + protocol: TCP + livenessProbe: + httpGet: + path: / + port: http + readinessProbe: + httpGet: + path: / + port: http + resources: + {{- toYaml .Values.resources | nindent 12 }} + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} diff --git a/manifest/helm-charts/services/charts/openim-rpc-friend/templates/hpa.yaml b/manifest/helm-charts/services/charts/openim-rpc-friend/templates/hpa.yaml new file mode 100644 index 000000000..7c4f14b7c --- /dev/null +++ b/manifest/helm-charts/services/charts/openim-rpc-friend/templates/hpa.yaml @@ -0,0 +1,28 @@ +{{- if .Values.autoscaling.enabled }} +apiVersion: autoscaling/v2beta1 +kind: HorizontalPodAutoscaler +metadata: + name: {{ include "openim-rpc-friend.fullname" . }} + labels: + {{- include "openim-rpc-friend.labels" . | nindent 4 }} +spec: + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: {{ include "openim-rpc-friend.fullname" . }} + minReplicas: {{ .Values.autoscaling.minReplicas }} + maxReplicas: {{ .Values.autoscaling.maxReplicas }} + metrics: + {{- if .Values.autoscaling.targetCPUUtilizationPercentage }} + - type: Resource + resource: + name: cpu + targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} + {{- end }} + {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }} + - type: Resource + resource: + name: memory + targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} + {{- end }} +{{- end }} diff --git a/manifest/helm-charts/services/charts/openim-rpc-friend/templates/ingress.yaml b/manifest/helm-charts/services/charts/openim-rpc-friend/templates/ingress.yaml new file mode 100644 index 000000000..b5d411743 --- /dev/null +++ b/manifest/helm-charts/services/charts/openim-rpc-friend/templates/ingress.yaml @@ -0,0 +1,61 @@ +{{- if .Values.ingress.enabled -}} +{{- $fullName := include "openim-rpc-friend.fullname" . -}} +{{- $svcPort := .Values.service.port -}} +{{- if and .Values.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }} + {{- if not (hasKey .Values.ingress.annotations "kubernetes.io/ingress.class") }} + {{- $_ := set .Values.ingress.annotations "kubernetes.io/ingress.class" .Values.ingress.className}} + {{- end }} +{{- end }} +{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}} +apiVersion: networking.k8s.io/v1 +{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} +apiVersion: networking.k8s.io/v1beta1 +{{- else -}} +apiVersion: extensions/v1beta1 +{{- end }} +kind: Ingress +metadata: + name: {{ $fullName }} + labels: + {{- include "openim-rpc-friend.labels" . | nindent 4 }} + {{- with .Values.ingress.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + {{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }} + ingressClassName: {{ .Values.ingress.className }} + {{- end }} + {{- if .Values.ingress.tls }} + tls: + {{- range .Values.ingress.tls }} + - hosts: + {{- range .hosts }} + - {{ . | quote }} + {{- end }} + secretName: {{ .secretName }} + {{- end }} + {{- end }} + rules: + {{- range .Values.ingress.hosts }} + - host: {{ .host | quote }} + http: + paths: + {{- range .paths }} + - path: {{ .path }} + {{- if and .pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }} + pathType: {{ .pathType }} + {{- end }} + backend: + {{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }} + service: + name: {{ $fullName }} + port: + number: {{ $svcPort }} + {{- else }} + serviceName: {{ $fullName }} + servicePort: {{ $svcPort }} + {{- end }} + {{- end }} + {{- end }} +{{- end }} diff --git a/manifest/helm-charts/services/charts/openim-rpc-friend/templates/service.yaml b/manifest/helm-charts/services/charts/openim-rpc-friend/templates/service.yaml new file mode 100644 index 000000000..792592d87 --- /dev/null +++ b/manifest/helm-charts/services/charts/openim-rpc-friend/templates/service.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "openim-rpc-friend.fullname" . }} + labels: + {{- include "openim-rpc-friend.labels" . | nindent 4 }} +spec: + type: {{ .Values.service.type }} + ports: + - port: {{ .Values.service.port }} + targetPort: http + protocol: TCP + name: http + selector: + {{- include "openim-rpc-friend.selectorLabels" . | nindent 4 }} diff --git a/manifest/helm-charts/services/charts/openim-rpc-friend/templates/serviceaccount.yaml b/manifest/helm-charts/services/charts/openim-rpc-friend/templates/serviceaccount.yaml new file mode 100644 index 000000000..c81343f6b --- /dev/null +++ b/manifest/helm-charts/services/charts/openim-rpc-friend/templates/serviceaccount.yaml @@ -0,0 +1,12 @@ +{{- if .Values.serviceAccount.create -}} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "openim-rpc-friend.serviceAccountName" . }} + labels: + {{- include "openim-rpc-friend.labels" . | nindent 4 }} + {{- with .Values.serviceAccount.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +{{- end }} diff --git a/manifest/helm-charts/services/charts/openim-rpc-friend/values.yaml b/manifest/helm-charts/services/charts/openim-rpc-friend/values.yaml new file mode 100644 index 000000000..b1b81b149 --- /dev/null +++ b/manifest/helm-charts/services/charts/openim-rpc-friend/values.yaml @@ -0,0 +1,82 @@ +# Default values for openim-rpc-friend. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +replicaCount: 1 + +image: + repository: nginx + pullPolicy: IfNotPresent + # Overrides the image tag whose default is the chart appVersion. + tag: "" + +imagePullSecrets: [] +nameOverride: "" +fullnameOverride: "" + +serviceAccount: + # Specifies whether a service account should be created + create: true + # Annotations to add to the service account + annotations: {} + # The name of the service account to use. + # If not set and create is true, a name is generated using the fullname template + name: "" + +podAnnotations: {} + +podSecurityContext: {} + # fsGroup: 2000 + +securityContext: {} + # capabilities: + # drop: + # - ALL + # readOnlyRootFilesystem: true + # runAsNonRoot: true + # runAsUser: 1000 + +service: + type: ClusterIP + port: 80 + +ingress: + enabled: false + className: "" + annotations: {} + # kubernetes.io/ingress.class: nginx + # kubernetes.io/tls-acme: "true" + hosts: + - host: chart-example.local + paths: + - path: / + pathType: ImplementationSpecific + tls: [] + # - secretName: chart-example-tls + # hosts: + # - chart-example.local + +resources: {} + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 128Mi + +autoscaling: + enabled: false + minReplicas: 1 + maxReplicas: 100 + targetCPUUtilizationPercentage: 80 + # targetMemoryUtilizationPercentage: 80 + +nodeSelector: {} + +tolerations: [] + +affinity: {} diff --git a/manifest/helm-charts/services/charts/openim-rpc-group/.helmignore b/manifest/helm-charts/services/charts/openim-rpc-group/.helmignore new file mode 100644 index 000000000..0e8a0eb36 --- /dev/null +++ b/manifest/helm-charts/services/charts/openim-rpc-group/.helmignore @@ -0,0 +1,23 @@ +# 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/manifest/helm-charts/services/charts/openim-rpc-group/Chart.yaml b/manifest/helm-charts/services/charts/openim-rpc-group/Chart.yaml new file mode 100644 index 000000000..8dd5515d8 --- /dev/null +++ b/manifest/helm-charts/services/charts/openim-rpc-group/Chart.yaml @@ -0,0 +1,24 @@ +apiVersion: v2 +name: openim-rpc-group +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" diff --git a/manifest/helm-charts/services/charts/openim-rpc-group/templates/NOTES.txt b/manifest/helm-charts/services/charts/openim-rpc-group/templates/NOTES.txt new file mode 100644 index 000000000..0cc117a49 --- /dev/null +++ b/manifest/helm-charts/services/charts/openim-rpc-group/templates/NOTES.txt @@ -0,0 +1,22 @@ +1. Get the application URL by running these commands: +{{- if .Values.ingress.enabled }} +{{- range $host := .Values.ingress.hosts }} + {{- range .paths }} + http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }} + {{- end }} +{{- end }} +{{- else if contains "NodePort" .Values.service.type }} + export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "openim-rpc-group.fullname" . }}) + export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") + echo http://$NODE_IP:$NODE_PORT +{{- else if contains "LoadBalancer" .Values.service.type }} + NOTE: It may take a few minutes for the LoadBalancer IP to be available. + You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "openim-rpc-group.fullname" . }}' + export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "openim-rpc-group.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") + echo http://$SERVICE_IP:{{ .Values.service.port }} +{{- else if contains "ClusterIP" .Values.service.type }} + export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "openim-rpc-group.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") + export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}") + echo "Visit http://127.0.0.1:8080 to use your application" + kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT +{{- end }} diff --git a/manifest/helm-charts/services/charts/openim-rpc-group/templates/_helpers.tpl b/manifest/helm-charts/services/charts/openim-rpc-group/templates/_helpers.tpl new file mode 100644 index 000000000..7835b84e1 --- /dev/null +++ b/manifest/helm-charts/services/charts/openim-rpc-group/templates/_helpers.tpl @@ -0,0 +1,62 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "openim-rpc-group.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 "openim-rpc-group.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 "openim-rpc-group.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "openim-rpc-group.labels" -}} +helm.sh/chart: {{ include "openim-rpc-group.chart" . }} +{{ include "openim-rpc-group.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "openim-rpc-group.selectorLabels" -}} +app.kubernetes.io/name: {{ include "openim-rpc-group.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Create the name of the service account to use +*/}} +{{- define "openim-rpc-group.serviceAccountName" -}} +{{- if .Values.serviceAccount.create }} +{{- default (include "openim-rpc-group.fullname" .) .Values.serviceAccount.name }} +{{- else }} +{{- default "default" .Values.serviceAccount.name }} +{{- end }} +{{- end }} diff --git a/manifest/helm-charts/services/charts/openim-rpc-group/templates/deployment.yaml b/manifest/helm-charts/services/charts/openim-rpc-group/templates/deployment.yaml new file mode 100644 index 000000000..156aaff3a --- /dev/null +++ b/manifest/helm-charts/services/charts/openim-rpc-group/templates/deployment.yaml @@ -0,0 +1,61 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "openim-rpc-group.fullname" . }} + labels: + {{- include "openim-rpc-group.labels" . | nindent 4 }} +spec: + {{- if not .Values.autoscaling.enabled }} + replicas: {{ .Values.replicaCount }} + {{- end }} + selector: + matchLabels: + {{- include "openim-rpc-group.selectorLabels" . | nindent 6 }} + template: + metadata: + {{- with .Values.podAnnotations }} + annotations: + {{- toYaml . | nindent 8 }} + {{- end }} + labels: + {{- include "openim-rpc-group.selectorLabels" . | nindent 8 }} + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + serviceAccountName: {{ include "openim-rpc-group.serviceAccountName" . }} + securityContext: + {{- toYaml .Values.podSecurityContext | nindent 8 }} + containers: + - name: {{ .Chart.Name }} + securityContext: + {{- toYaml .Values.securityContext | nindent 12 }} + image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + ports: + - name: http + containerPort: 80 + protocol: TCP + livenessProbe: + httpGet: + path: / + port: http + readinessProbe: + httpGet: + path: / + port: http + resources: + {{- toYaml .Values.resources | nindent 12 }} + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} diff --git a/manifest/helm-charts/services/charts/openim-rpc-group/templates/hpa.yaml b/manifest/helm-charts/services/charts/openim-rpc-group/templates/hpa.yaml new file mode 100644 index 000000000..0ba0e8283 --- /dev/null +++ b/manifest/helm-charts/services/charts/openim-rpc-group/templates/hpa.yaml @@ -0,0 +1,28 @@ +{{- if .Values.autoscaling.enabled }} +apiVersion: autoscaling/v2beta1 +kind: HorizontalPodAutoscaler +metadata: + name: {{ include "openim-rpc-group.fullname" . }} + labels: + {{- include "openim-rpc-group.labels" . | nindent 4 }} +spec: + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: {{ include "openim-rpc-group.fullname" . }} + minReplicas: {{ .Values.autoscaling.minReplicas }} + maxReplicas: {{ .Values.autoscaling.maxReplicas }} + metrics: + {{- if .Values.autoscaling.targetCPUUtilizationPercentage }} + - type: Resource + resource: + name: cpu + targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} + {{- end }} + {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }} + - type: Resource + resource: + name: memory + targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} + {{- end }} +{{- end }} diff --git a/manifest/helm-charts/services/charts/openim-rpc-group/templates/ingress.yaml b/manifest/helm-charts/services/charts/openim-rpc-group/templates/ingress.yaml new file mode 100644 index 000000000..6a744f914 --- /dev/null +++ b/manifest/helm-charts/services/charts/openim-rpc-group/templates/ingress.yaml @@ -0,0 +1,61 @@ +{{- if .Values.ingress.enabled -}} +{{- $fullName := include "openim-rpc-group.fullname" . -}} +{{- $svcPort := .Values.service.port -}} +{{- if and .Values.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }} + {{- if not (hasKey .Values.ingress.annotations "kubernetes.io/ingress.class") }} + {{- $_ := set .Values.ingress.annotations "kubernetes.io/ingress.class" .Values.ingress.className}} + {{- end }} +{{- end }} +{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}} +apiVersion: networking.k8s.io/v1 +{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} +apiVersion: networking.k8s.io/v1beta1 +{{- else -}} +apiVersion: extensions/v1beta1 +{{- end }} +kind: Ingress +metadata: + name: {{ $fullName }} + labels: + {{- include "openim-rpc-group.labels" . | nindent 4 }} + {{- with .Values.ingress.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + {{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }} + ingressClassName: {{ .Values.ingress.className }} + {{- end }} + {{- if .Values.ingress.tls }} + tls: + {{- range .Values.ingress.tls }} + - hosts: + {{- range .hosts }} + - {{ . | quote }} + {{- end }} + secretName: {{ .secretName }} + {{- end }} + {{- end }} + rules: + {{- range .Values.ingress.hosts }} + - host: {{ .host | quote }} + http: + paths: + {{- range .paths }} + - path: {{ .path }} + {{- if and .pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }} + pathType: {{ .pathType }} + {{- end }} + backend: + {{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }} + service: + name: {{ $fullName }} + port: + number: {{ $svcPort }} + {{- else }} + serviceName: {{ $fullName }} + servicePort: {{ $svcPort }} + {{- end }} + {{- end }} + {{- end }} +{{- end }} diff --git a/manifest/helm-charts/services/charts/openim-rpc-group/templates/service.yaml b/manifest/helm-charts/services/charts/openim-rpc-group/templates/service.yaml new file mode 100644 index 000000000..aa16f71b9 --- /dev/null +++ b/manifest/helm-charts/services/charts/openim-rpc-group/templates/service.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "openim-rpc-group.fullname" . }} + labels: + {{- include "openim-rpc-group.labels" . | nindent 4 }} +spec: + type: {{ .Values.service.type }} + ports: + - port: {{ .Values.service.port }} + targetPort: http + protocol: TCP + name: http + selector: + {{- include "openim-rpc-group.selectorLabels" . | nindent 4 }} diff --git a/manifest/helm-charts/services/charts/openim-rpc-group/templates/serviceaccount.yaml b/manifest/helm-charts/services/charts/openim-rpc-group/templates/serviceaccount.yaml new file mode 100644 index 000000000..b42dfb13b --- /dev/null +++ b/manifest/helm-charts/services/charts/openim-rpc-group/templates/serviceaccount.yaml @@ -0,0 +1,12 @@ +{{- if .Values.serviceAccount.create -}} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "openim-rpc-group.serviceAccountName" . }} + labels: + {{- include "openim-rpc-group.labels" . | nindent 4 }} + {{- with .Values.serviceAccount.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +{{- end }} diff --git a/manifest/helm-charts/services/charts/openim-rpc-group/values.yaml b/manifest/helm-charts/services/charts/openim-rpc-group/values.yaml new file mode 100644 index 000000000..7c379b334 --- /dev/null +++ b/manifest/helm-charts/services/charts/openim-rpc-group/values.yaml @@ -0,0 +1,82 @@ +# Default values for openim-rpc-group. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +replicaCount: 1 + +image: + repository: nginx + pullPolicy: IfNotPresent + # Overrides the image tag whose default is the chart appVersion. + tag: "" + +imagePullSecrets: [] +nameOverride: "" +fullnameOverride: "" + +serviceAccount: + # Specifies whether a service account should be created + create: true + # Annotations to add to the service account + annotations: {} + # The name of the service account to use. + # If not set and create is true, a name is generated using the fullname template + name: "" + +podAnnotations: {} + +podSecurityContext: {} + # fsGroup: 2000 + +securityContext: {} + # capabilities: + # drop: + # - ALL + # readOnlyRootFilesystem: true + # runAsNonRoot: true + # runAsUser: 1000 + +service: + type: ClusterIP + port: 80 + +ingress: + enabled: false + className: "" + annotations: {} + # kubernetes.io/ingress.class: nginx + # kubernetes.io/tls-acme: "true" + hosts: + - host: chart-example.local + paths: + - path: / + pathType: ImplementationSpecific + tls: [] + # - secretName: chart-example-tls + # hosts: + # - chart-example.local + +resources: {} + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 128Mi + +autoscaling: + enabled: false + minReplicas: 1 + maxReplicas: 100 + targetCPUUtilizationPercentage: 80 + # targetMemoryUtilizationPercentage: 80 + +nodeSelector: {} + +tolerations: [] + +affinity: {} diff --git a/manifest/helm-charts/services/charts/openim-rpc-msg/.helmignore b/manifest/helm-charts/services/charts/openim-rpc-msg/.helmignore new file mode 100644 index 000000000..0e8a0eb36 --- /dev/null +++ b/manifest/helm-charts/services/charts/openim-rpc-msg/.helmignore @@ -0,0 +1,23 @@ +# 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/manifest/helm-charts/services/charts/openim-rpc-msg/Chart.yaml b/manifest/helm-charts/services/charts/openim-rpc-msg/Chart.yaml new file mode 100644 index 000000000..e5ad356c3 --- /dev/null +++ b/manifest/helm-charts/services/charts/openim-rpc-msg/Chart.yaml @@ -0,0 +1,24 @@ +apiVersion: v2 +name: openim-rpc-msg +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" diff --git a/manifest/helm-charts/services/charts/openim-rpc-msg/templates/NOTES.txt b/manifest/helm-charts/services/charts/openim-rpc-msg/templates/NOTES.txt new file mode 100644 index 000000000..65033b107 --- /dev/null +++ b/manifest/helm-charts/services/charts/openim-rpc-msg/templates/NOTES.txt @@ -0,0 +1,22 @@ +1. Get the application URL by running these commands: +{{- if .Values.ingress.enabled }} +{{- range $host := .Values.ingress.hosts }} + {{- range .paths }} + http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }} + {{- end }} +{{- end }} +{{- else if contains "NodePort" .Values.service.type }} + export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "openim-rpc-msg.fullname" . }}) + export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") + echo http://$NODE_IP:$NODE_PORT +{{- else if contains "LoadBalancer" .Values.service.type }} + NOTE: It may take a few minutes for the LoadBalancer IP to be available. + You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "openim-rpc-msg.fullname" . }}' + export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "openim-rpc-msg.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") + echo http://$SERVICE_IP:{{ .Values.service.port }} +{{- else if contains "ClusterIP" .Values.service.type }} + export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "openim-rpc-msg.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") + export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}") + echo "Visit http://127.0.0.1:8080 to use your application" + kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT +{{- end }} diff --git a/manifest/helm-charts/services/charts/openim-rpc-msg/templates/_helpers.tpl b/manifest/helm-charts/services/charts/openim-rpc-msg/templates/_helpers.tpl new file mode 100644 index 000000000..da6956822 --- /dev/null +++ b/manifest/helm-charts/services/charts/openim-rpc-msg/templates/_helpers.tpl @@ -0,0 +1,62 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "openim-rpc-msg.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 "openim-rpc-msg.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 "openim-rpc-msg.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "openim-rpc-msg.labels" -}} +helm.sh/chart: {{ include "openim-rpc-msg.chart" . }} +{{ include "openim-rpc-msg.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "openim-rpc-msg.selectorLabels" -}} +app.kubernetes.io/name: {{ include "openim-rpc-msg.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Create the name of the service account to use +*/}} +{{- define "openim-rpc-msg.serviceAccountName" -}} +{{- if .Values.serviceAccount.create }} +{{- default (include "openim-rpc-msg.fullname" .) .Values.serviceAccount.name }} +{{- else }} +{{- default "default" .Values.serviceAccount.name }} +{{- end }} +{{- end }} diff --git a/manifest/helm-charts/services/charts/openim-rpc-msg/templates/deployment.yaml b/manifest/helm-charts/services/charts/openim-rpc-msg/templates/deployment.yaml new file mode 100644 index 000000000..2bd486b9c --- /dev/null +++ b/manifest/helm-charts/services/charts/openim-rpc-msg/templates/deployment.yaml @@ -0,0 +1,61 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "openim-rpc-msg.fullname" . }} + labels: + {{- include "openim-rpc-msg.labels" . | nindent 4 }} +spec: + {{- if not .Values.autoscaling.enabled }} + replicas: {{ .Values.replicaCount }} + {{- end }} + selector: + matchLabels: + {{- include "openim-rpc-msg.selectorLabels" . | nindent 6 }} + template: + metadata: + {{- with .Values.podAnnotations }} + annotations: + {{- toYaml . | nindent 8 }} + {{- end }} + labels: + {{- include "openim-rpc-msg.selectorLabels" . | nindent 8 }} + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + serviceAccountName: {{ include "openim-rpc-msg.serviceAccountName" . }} + securityContext: + {{- toYaml .Values.podSecurityContext | nindent 8 }} + containers: + - name: {{ .Chart.Name }} + securityContext: + {{- toYaml .Values.securityContext | nindent 12 }} + image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + ports: + - name: http + containerPort: 80 + protocol: TCP + livenessProbe: + httpGet: + path: / + port: http + readinessProbe: + httpGet: + path: / + port: http + resources: + {{- toYaml .Values.resources | nindent 12 }} + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} diff --git a/manifest/helm-charts/services/charts/openim-rpc-msg/templates/hpa.yaml b/manifest/helm-charts/services/charts/openim-rpc-msg/templates/hpa.yaml new file mode 100644 index 000000000..c01e07294 --- /dev/null +++ b/manifest/helm-charts/services/charts/openim-rpc-msg/templates/hpa.yaml @@ -0,0 +1,28 @@ +{{- if .Values.autoscaling.enabled }} +apiVersion: autoscaling/v2beta1 +kind: HorizontalPodAutoscaler +metadata: + name: {{ include "openim-rpc-msg.fullname" . }} + labels: + {{- include "openim-rpc-msg.labels" . | nindent 4 }} +spec: + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: {{ include "openim-rpc-msg.fullname" . }} + minReplicas: {{ .Values.autoscaling.minReplicas }} + maxReplicas: {{ .Values.autoscaling.maxReplicas }} + metrics: + {{- if .Values.autoscaling.targetCPUUtilizationPercentage }} + - type: Resource + resource: + name: cpu + targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} + {{- end }} + {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }} + - type: Resource + resource: + name: memory + targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} + {{- end }} +{{- end }} diff --git a/manifest/helm-charts/services/charts/openim-rpc-msg/templates/ingress.yaml b/manifest/helm-charts/services/charts/openim-rpc-msg/templates/ingress.yaml new file mode 100644 index 000000000..2f5ad9d15 --- /dev/null +++ b/manifest/helm-charts/services/charts/openim-rpc-msg/templates/ingress.yaml @@ -0,0 +1,61 @@ +{{- if .Values.ingress.enabled -}} +{{- $fullName := include "openim-rpc-msg.fullname" . -}} +{{- $svcPort := .Values.service.port -}} +{{- if and .Values.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }} + {{- if not (hasKey .Values.ingress.annotations "kubernetes.io/ingress.class") }} + {{- $_ := set .Values.ingress.annotations "kubernetes.io/ingress.class" .Values.ingress.className}} + {{- end }} +{{- end }} +{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}} +apiVersion: networking.k8s.io/v1 +{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} +apiVersion: networking.k8s.io/v1beta1 +{{- else -}} +apiVersion: extensions/v1beta1 +{{- end }} +kind: Ingress +metadata: + name: {{ $fullName }} + labels: + {{- include "openim-rpc-msg.labels" . | nindent 4 }} + {{- with .Values.ingress.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + {{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }} + ingressClassName: {{ .Values.ingress.className }} + {{- end }} + {{- if .Values.ingress.tls }} + tls: + {{- range .Values.ingress.tls }} + - hosts: + {{- range .hosts }} + - {{ . | quote }} + {{- end }} + secretName: {{ .secretName }} + {{- end }} + {{- end }} + rules: + {{- range .Values.ingress.hosts }} + - host: {{ .host | quote }} + http: + paths: + {{- range .paths }} + - path: {{ .path }} + {{- if and .pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }} + pathType: {{ .pathType }} + {{- end }} + backend: + {{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }} + service: + name: {{ $fullName }} + port: + number: {{ $svcPort }} + {{- else }} + serviceName: {{ $fullName }} + servicePort: {{ $svcPort }} + {{- end }} + {{- end }} + {{- end }} +{{- end }} diff --git a/manifest/helm-charts/services/charts/openim-rpc-msg/templates/service.yaml b/manifest/helm-charts/services/charts/openim-rpc-msg/templates/service.yaml new file mode 100644 index 000000000..9afd55a8c --- /dev/null +++ b/manifest/helm-charts/services/charts/openim-rpc-msg/templates/service.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "openim-rpc-msg.fullname" . }} + labels: + {{- include "openim-rpc-msg.labels" . | nindent 4 }} +spec: + type: {{ .Values.service.type }} + ports: + - port: {{ .Values.service.port }} + targetPort: http + protocol: TCP + name: http + selector: + {{- include "openim-rpc-msg.selectorLabels" . | nindent 4 }} diff --git a/manifest/helm-charts/services/charts/openim-rpc-msg/templates/serviceaccount.yaml b/manifest/helm-charts/services/charts/openim-rpc-msg/templates/serviceaccount.yaml new file mode 100644 index 000000000..da69e5ce8 --- /dev/null +++ b/manifest/helm-charts/services/charts/openim-rpc-msg/templates/serviceaccount.yaml @@ -0,0 +1,12 @@ +{{- if .Values.serviceAccount.create -}} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "openim-rpc-msg.serviceAccountName" . }} + labels: + {{- include "openim-rpc-msg.labels" . | nindent 4 }} + {{- with .Values.serviceAccount.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +{{- end }} diff --git a/manifest/helm-charts/services/charts/openim-rpc-msg/values.yaml b/manifest/helm-charts/services/charts/openim-rpc-msg/values.yaml new file mode 100644 index 000000000..a43c41eb5 --- /dev/null +++ b/manifest/helm-charts/services/charts/openim-rpc-msg/values.yaml @@ -0,0 +1,82 @@ +# Default values for openim-rpc-msg. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +replicaCount: 1 + +image: + repository: nginx + pullPolicy: IfNotPresent + # Overrides the image tag whose default is the chart appVersion. + tag: "" + +imagePullSecrets: [] +nameOverride: "" +fullnameOverride: "" + +serviceAccount: + # Specifies whether a service account should be created + create: true + # Annotations to add to the service account + annotations: {} + # The name of the service account to use. + # If not set and create is true, a name is generated using the fullname template + name: "" + +podAnnotations: {} + +podSecurityContext: {} + # fsGroup: 2000 + +securityContext: {} + # capabilities: + # drop: + # - ALL + # readOnlyRootFilesystem: true + # runAsNonRoot: true + # runAsUser: 1000 + +service: + type: ClusterIP + port: 80 + +ingress: + enabled: false + className: "" + annotations: {} + # kubernetes.io/ingress.class: nginx + # kubernetes.io/tls-acme: "true" + hosts: + - host: chart-example.local + paths: + - path: / + pathType: ImplementationSpecific + tls: [] + # - secretName: chart-example-tls + # hosts: + # - chart-example.local + +resources: {} + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 128Mi + +autoscaling: + enabled: false + minReplicas: 1 + maxReplicas: 100 + targetCPUUtilizationPercentage: 80 + # targetMemoryUtilizationPercentage: 80 + +nodeSelector: {} + +tolerations: [] + +affinity: {} diff --git a/manifest/helm-charts/services/charts/openim-rpc-third/.helmignore b/manifest/helm-charts/services/charts/openim-rpc-third/.helmignore new file mode 100644 index 000000000..0e8a0eb36 --- /dev/null +++ b/manifest/helm-charts/services/charts/openim-rpc-third/.helmignore @@ -0,0 +1,23 @@ +# 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/manifest/helm-charts/services/charts/openim-rpc-third/Chart.yaml b/manifest/helm-charts/services/charts/openim-rpc-third/Chart.yaml new file mode 100644 index 000000000..99993464e --- /dev/null +++ b/manifest/helm-charts/services/charts/openim-rpc-third/Chart.yaml @@ -0,0 +1,24 @@ +apiVersion: v2 +name: openim-rpc-third +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" diff --git a/manifest/helm-charts/services/charts/openim-rpc-third/templates/NOTES.txt b/manifest/helm-charts/services/charts/openim-rpc-third/templates/NOTES.txt new file mode 100644 index 000000000..a2228c84d --- /dev/null +++ b/manifest/helm-charts/services/charts/openim-rpc-third/templates/NOTES.txt @@ -0,0 +1,22 @@ +1. Get the application URL by running these commands: +{{- if .Values.ingress.enabled }} +{{- range $host := .Values.ingress.hosts }} + {{- range .paths }} + http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }} + {{- end }} +{{- end }} +{{- else if contains "NodePort" .Values.service.type }} + export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "openim-rpc-third.fullname" . }}) + export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") + echo http://$NODE_IP:$NODE_PORT +{{- else if contains "LoadBalancer" .Values.service.type }} + NOTE: It may take a few minutes for the LoadBalancer IP to be available. + You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "openim-rpc-third.fullname" . }}' + export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "openim-rpc-third.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") + echo http://$SERVICE_IP:{{ .Values.service.port }} +{{- else if contains "ClusterIP" .Values.service.type }} + export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "openim-rpc-third.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") + export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}") + echo "Visit http://127.0.0.1:8080 to use your application" + kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT +{{- end }} diff --git a/manifest/helm-charts/services/charts/openim-rpc-third/templates/_helpers.tpl b/manifest/helm-charts/services/charts/openim-rpc-third/templates/_helpers.tpl new file mode 100644 index 000000000..46039ce2c --- /dev/null +++ b/manifest/helm-charts/services/charts/openim-rpc-third/templates/_helpers.tpl @@ -0,0 +1,62 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "openim-rpc-third.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 "openim-rpc-third.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 "openim-rpc-third.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "openim-rpc-third.labels" -}} +helm.sh/chart: {{ include "openim-rpc-third.chart" . }} +{{ include "openim-rpc-third.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "openim-rpc-third.selectorLabels" -}} +app.kubernetes.io/name: {{ include "openim-rpc-third.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Create the name of the service account to use +*/}} +{{- define "openim-rpc-third.serviceAccountName" -}} +{{- if .Values.serviceAccount.create }} +{{- default (include "openim-rpc-third.fullname" .) .Values.serviceAccount.name }} +{{- else }} +{{- default "default" .Values.serviceAccount.name }} +{{- end }} +{{- end }} diff --git a/manifest/helm-charts/services/charts/openim-rpc-third/templates/deployment.yaml b/manifest/helm-charts/services/charts/openim-rpc-third/templates/deployment.yaml new file mode 100644 index 000000000..54f2c9e4e --- /dev/null +++ b/manifest/helm-charts/services/charts/openim-rpc-third/templates/deployment.yaml @@ -0,0 +1,61 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "openim-rpc-third.fullname" . }} + labels: + {{- include "openim-rpc-third.labels" . | nindent 4 }} +spec: + {{- if not .Values.autoscaling.enabled }} + replicas: {{ .Values.replicaCount }} + {{- end }} + selector: + matchLabels: + {{- include "openim-rpc-third.selectorLabels" . | nindent 6 }} + template: + metadata: + {{- with .Values.podAnnotations }} + annotations: + {{- toYaml . | nindent 8 }} + {{- end }} + labels: + {{- include "openim-rpc-third.selectorLabels" . | nindent 8 }} + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + serviceAccountName: {{ include "openim-rpc-third.serviceAccountName" . }} + securityContext: + {{- toYaml .Values.podSecurityContext | nindent 8 }} + containers: + - name: {{ .Chart.Name }} + securityContext: + {{- toYaml .Values.securityContext | nindent 12 }} + image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + ports: + - name: http + containerPort: 80 + protocol: TCP + livenessProbe: + httpGet: + path: / + port: http + readinessProbe: + httpGet: + path: / + port: http + resources: + {{- toYaml .Values.resources | nindent 12 }} + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} diff --git a/manifest/helm-charts/services/charts/openim-rpc-third/templates/hpa.yaml b/manifest/helm-charts/services/charts/openim-rpc-third/templates/hpa.yaml new file mode 100644 index 000000000..2197e21a5 --- /dev/null +++ b/manifest/helm-charts/services/charts/openim-rpc-third/templates/hpa.yaml @@ -0,0 +1,28 @@ +{{- if .Values.autoscaling.enabled }} +apiVersion: autoscaling/v2beta1 +kind: HorizontalPodAutoscaler +metadata: + name: {{ include "openim-rpc-third.fullname" . }} + labels: + {{- include "openim-rpc-third.labels" . | nindent 4 }} +spec: + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: {{ include "openim-rpc-third.fullname" . }} + minReplicas: {{ .Values.autoscaling.minReplicas }} + maxReplicas: {{ .Values.autoscaling.maxReplicas }} + metrics: + {{- if .Values.autoscaling.targetCPUUtilizationPercentage }} + - type: Resource + resource: + name: cpu + targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} + {{- end }} + {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }} + - type: Resource + resource: + name: memory + targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} + {{- end }} +{{- end }} diff --git a/manifest/helm-charts/services/charts/openim-rpc-third/templates/ingress.yaml b/manifest/helm-charts/services/charts/openim-rpc-third/templates/ingress.yaml new file mode 100644 index 000000000..3ba50cf33 --- /dev/null +++ b/manifest/helm-charts/services/charts/openim-rpc-third/templates/ingress.yaml @@ -0,0 +1,61 @@ +{{- if .Values.ingress.enabled -}} +{{- $fullName := include "openim-rpc-third.fullname" . -}} +{{- $svcPort := .Values.service.port -}} +{{- if and .Values.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }} + {{- if not (hasKey .Values.ingress.annotations "kubernetes.io/ingress.class") }} + {{- $_ := set .Values.ingress.annotations "kubernetes.io/ingress.class" .Values.ingress.className}} + {{- end }} +{{- end }} +{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}} +apiVersion: networking.k8s.io/v1 +{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} +apiVersion: networking.k8s.io/v1beta1 +{{- else -}} +apiVersion: extensions/v1beta1 +{{- end }} +kind: Ingress +metadata: + name: {{ $fullName }} + labels: + {{- include "openim-rpc-third.labels" . | nindent 4 }} + {{- with .Values.ingress.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + {{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }} + ingressClassName: {{ .Values.ingress.className }} + {{- end }} + {{- if .Values.ingress.tls }} + tls: + {{- range .Values.ingress.tls }} + - hosts: + {{- range .hosts }} + - {{ . | quote }} + {{- end }} + secretName: {{ .secretName }} + {{- end }} + {{- end }} + rules: + {{- range .Values.ingress.hosts }} + - host: {{ .host | quote }} + http: + paths: + {{- range .paths }} + - path: {{ .path }} + {{- if and .pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }} + pathType: {{ .pathType }} + {{- end }} + backend: + {{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }} + service: + name: {{ $fullName }} + port: + number: {{ $svcPort }} + {{- else }} + serviceName: {{ $fullName }} + servicePort: {{ $svcPort }} + {{- end }} + {{- end }} + {{- end }} +{{- end }} diff --git a/manifest/helm-charts/services/charts/openim-rpc-third/templates/service.yaml b/manifest/helm-charts/services/charts/openim-rpc-third/templates/service.yaml new file mode 100644 index 000000000..866b5cda2 --- /dev/null +++ b/manifest/helm-charts/services/charts/openim-rpc-third/templates/service.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "openim-rpc-third.fullname" . }} + labels: + {{- include "openim-rpc-third.labels" . | nindent 4 }} +spec: + type: {{ .Values.service.type }} + ports: + - port: {{ .Values.service.port }} + targetPort: http + protocol: TCP + name: http + selector: + {{- include "openim-rpc-third.selectorLabels" . | nindent 4 }} diff --git a/manifest/helm-charts/services/charts/openim-rpc-third/templates/serviceaccount.yaml b/manifest/helm-charts/services/charts/openim-rpc-third/templates/serviceaccount.yaml new file mode 100644 index 000000000..8a45872ce --- /dev/null +++ b/manifest/helm-charts/services/charts/openim-rpc-third/templates/serviceaccount.yaml @@ -0,0 +1,12 @@ +{{- if .Values.serviceAccount.create -}} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "openim-rpc-third.serviceAccountName" . }} + labels: + {{- include "openim-rpc-third.labels" . | nindent 4 }} + {{- with .Values.serviceAccount.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +{{- end }} diff --git a/manifest/helm-charts/services/charts/openim-rpc-third/values.yaml b/manifest/helm-charts/services/charts/openim-rpc-third/values.yaml new file mode 100644 index 000000000..e84b56a9d --- /dev/null +++ b/manifest/helm-charts/services/charts/openim-rpc-third/values.yaml @@ -0,0 +1,82 @@ +# Default values for openim-rpc-third. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +replicaCount: 1 + +image: + repository: nginx + pullPolicy: IfNotPresent + # Overrides the image tag whose default is the chart appVersion. + tag: "" + +imagePullSecrets: [] +nameOverride: "" +fullnameOverride: "" + +serviceAccount: + # Specifies whether a service account should be created + create: true + # Annotations to add to the service account + annotations: {} + # The name of the service account to use. + # If not set and create is true, a name is generated using the fullname template + name: "" + +podAnnotations: {} + +podSecurityContext: {} + # fsGroup: 2000 + +securityContext: {} + # capabilities: + # drop: + # - ALL + # readOnlyRootFilesystem: true + # runAsNonRoot: true + # runAsUser: 1000 + +service: + type: ClusterIP + port: 80 + +ingress: + enabled: false + className: "" + annotations: {} + # kubernetes.io/ingress.class: nginx + # kubernetes.io/tls-acme: "true" + hosts: + - host: chart-example.local + paths: + - path: / + pathType: ImplementationSpecific + tls: [] + # - secretName: chart-example-tls + # hosts: + # - chart-example.local + +resources: {} + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 128Mi + +autoscaling: + enabled: false + minReplicas: 1 + maxReplicas: 100 + targetCPUUtilizationPercentage: 80 + # targetMemoryUtilizationPercentage: 80 + +nodeSelector: {} + +tolerations: [] + +affinity: {} diff --git a/manifest/helm-charts/services/charts/openim-rpc-user/.helmignore b/manifest/helm-charts/services/charts/openim-rpc-user/.helmignore new file mode 100644 index 000000000..0e8a0eb36 --- /dev/null +++ b/manifest/helm-charts/services/charts/openim-rpc-user/.helmignore @@ -0,0 +1,23 @@ +# 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/manifest/helm-charts/services/charts/openim-rpc-user/Chart.yaml b/manifest/helm-charts/services/charts/openim-rpc-user/Chart.yaml new file mode 100644 index 000000000..b64529c24 --- /dev/null +++ b/manifest/helm-charts/services/charts/openim-rpc-user/Chart.yaml @@ -0,0 +1,24 @@ +apiVersion: v2 +name: openim-rpc-user +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" diff --git a/manifest/helm-charts/services/charts/openim-rpc-user/templates/NOTES.txt b/manifest/helm-charts/services/charts/openim-rpc-user/templates/NOTES.txt new file mode 100644 index 000000000..9928bd162 --- /dev/null +++ b/manifest/helm-charts/services/charts/openim-rpc-user/templates/NOTES.txt @@ -0,0 +1,22 @@ +1. Get the application URL by running these commands: +{{- if .Values.ingress.enabled }} +{{- range $host := .Values.ingress.hosts }} + {{- range .paths }} + http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }} + {{- end }} +{{- end }} +{{- else if contains "NodePort" .Values.service.type }} + export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "openim-rpc-user.fullname" . }}) + export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") + echo http://$NODE_IP:$NODE_PORT +{{- else if contains "LoadBalancer" .Values.service.type }} + NOTE: It may take a few minutes for the LoadBalancer IP to be available. + You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "openim-rpc-user.fullname" . }}' + export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "openim-rpc-user.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") + echo http://$SERVICE_IP:{{ .Values.service.port }} +{{- else if contains "ClusterIP" .Values.service.type }} + export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "openim-rpc-user.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") + export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}") + echo "Visit http://127.0.0.1:8080 to use your application" + kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT +{{- end }} diff --git a/manifest/helm-charts/services/charts/openim-rpc-user/templates/_helpers.tpl b/manifest/helm-charts/services/charts/openim-rpc-user/templates/_helpers.tpl new file mode 100644 index 000000000..473f66556 --- /dev/null +++ b/manifest/helm-charts/services/charts/openim-rpc-user/templates/_helpers.tpl @@ -0,0 +1,62 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "openim-rpc-user.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 "openim-rpc-user.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 "openim-rpc-user.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "openim-rpc-user.labels" -}} +helm.sh/chart: {{ include "openim-rpc-user.chart" . }} +{{ include "openim-rpc-user.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "openim-rpc-user.selectorLabels" -}} +app.kubernetes.io/name: {{ include "openim-rpc-user.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Create the name of the service account to use +*/}} +{{- define "openim-rpc-user.serviceAccountName" -}} +{{- if .Values.serviceAccount.create }} +{{- default (include "openim-rpc-user.fullname" .) .Values.serviceAccount.name }} +{{- else }} +{{- default "default" .Values.serviceAccount.name }} +{{- end }} +{{- end }} diff --git a/manifest/helm-charts/services/charts/openim-rpc-user/templates/deployment.yaml b/manifest/helm-charts/services/charts/openim-rpc-user/templates/deployment.yaml new file mode 100644 index 000000000..b839e6e93 --- /dev/null +++ b/manifest/helm-charts/services/charts/openim-rpc-user/templates/deployment.yaml @@ -0,0 +1,61 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "openim-rpc-user.fullname" . }} + labels: + {{- include "openim-rpc-user.labels" . | nindent 4 }} +spec: + {{- if not .Values.autoscaling.enabled }} + replicas: {{ .Values.replicaCount }} + {{- end }} + selector: + matchLabels: + {{- include "openim-rpc-user.selectorLabels" . | nindent 6 }} + template: + metadata: + {{- with .Values.podAnnotations }} + annotations: + {{- toYaml . | nindent 8 }} + {{- end }} + labels: + {{- include "openim-rpc-user.selectorLabels" . | nindent 8 }} + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + serviceAccountName: {{ include "openim-rpc-user.serviceAccountName" . }} + securityContext: + {{- toYaml .Values.podSecurityContext | nindent 8 }} + containers: + - name: {{ .Chart.Name }} + securityContext: + {{- toYaml .Values.securityContext | nindent 12 }} + image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + ports: + - name: http + containerPort: 80 + protocol: TCP + livenessProbe: + httpGet: + path: / + port: http + readinessProbe: + httpGet: + path: / + port: http + resources: + {{- toYaml .Values.resources | nindent 12 }} + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} diff --git a/manifest/helm-charts/services/charts/openim-rpc-user/templates/hpa.yaml b/manifest/helm-charts/services/charts/openim-rpc-user/templates/hpa.yaml new file mode 100644 index 000000000..7c00c9d64 --- /dev/null +++ b/manifest/helm-charts/services/charts/openim-rpc-user/templates/hpa.yaml @@ -0,0 +1,28 @@ +{{- if .Values.autoscaling.enabled }} +apiVersion: autoscaling/v2beta1 +kind: HorizontalPodAutoscaler +metadata: + name: {{ include "openim-rpc-user.fullname" . }} + labels: + {{- include "openim-rpc-user.labels" . | nindent 4 }} +spec: + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: {{ include "openim-rpc-user.fullname" . }} + minReplicas: {{ .Values.autoscaling.minReplicas }} + maxReplicas: {{ .Values.autoscaling.maxReplicas }} + metrics: + {{- if .Values.autoscaling.targetCPUUtilizationPercentage }} + - type: Resource + resource: + name: cpu + targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} + {{- end }} + {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }} + - type: Resource + resource: + name: memory + targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} + {{- end }} +{{- end }} diff --git a/manifest/helm-charts/services/charts/openim-rpc-user/templates/ingress.yaml b/manifest/helm-charts/services/charts/openim-rpc-user/templates/ingress.yaml new file mode 100644 index 000000000..7ed5a0328 --- /dev/null +++ b/manifest/helm-charts/services/charts/openim-rpc-user/templates/ingress.yaml @@ -0,0 +1,61 @@ +{{- if .Values.ingress.enabled -}} +{{- $fullName := include "openim-rpc-user.fullname" . -}} +{{- $svcPort := .Values.service.port -}} +{{- if and .Values.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }} + {{- if not (hasKey .Values.ingress.annotations "kubernetes.io/ingress.class") }} + {{- $_ := set .Values.ingress.annotations "kubernetes.io/ingress.class" .Values.ingress.className}} + {{- end }} +{{- end }} +{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}} +apiVersion: networking.k8s.io/v1 +{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} +apiVersion: networking.k8s.io/v1beta1 +{{- else -}} +apiVersion: extensions/v1beta1 +{{- end }} +kind: Ingress +metadata: + name: {{ $fullName }} + labels: + {{- include "openim-rpc-user.labels" . | nindent 4 }} + {{- with .Values.ingress.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + {{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }} + ingressClassName: {{ .Values.ingress.className }} + {{- end }} + {{- if .Values.ingress.tls }} + tls: + {{- range .Values.ingress.tls }} + - hosts: + {{- range .hosts }} + - {{ . | quote }} + {{- end }} + secretName: {{ .secretName }} + {{- end }} + {{- end }} + rules: + {{- range .Values.ingress.hosts }} + - host: {{ .host | quote }} + http: + paths: + {{- range .paths }} + - path: {{ .path }} + {{- if and .pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }} + pathType: {{ .pathType }} + {{- end }} + backend: + {{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }} + service: + name: {{ $fullName }} + port: + number: {{ $svcPort }} + {{- else }} + serviceName: {{ $fullName }} + servicePort: {{ $svcPort }} + {{- end }} + {{- end }} + {{- end }} +{{- end }} diff --git a/manifest/helm-charts/services/charts/openim-rpc-user/templates/service.yaml b/manifest/helm-charts/services/charts/openim-rpc-user/templates/service.yaml new file mode 100644 index 000000000..728c5de92 --- /dev/null +++ b/manifest/helm-charts/services/charts/openim-rpc-user/templates/service.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "openim-rpc-user.fullname" . }} + labels: + {{- include "openim-rpc-user.labels" . | nindent 4 }} +spec: + type: {{ .Values.service.type }} + ports: + - port: {{ .Values.service.port }} + targetPort: http + protocol: TCP + name: http + selector: + {{- include "openim-rpc-user.selectorLabels" . | nindent 4 }} diff --git a/manifest/helm-charts/services/charts/openim-rpc-user/templates/serviceaccount.yaml b/manifest/helm-charts/services/charts/openim-rpc-user/templates/serviceaccount.yaml new file mode 100644 index 000000000..d3395f00d --- /dev/null +++ b/manifest/helm-charts/services/charts/openim-rpc-user/templates/serviceaccount.yaml @@ -0,0 +1,12 @@ +{{- if .Values.serviceAccount.create -}} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "openim-rpc-user.serviceAccountName" . }} + labels: + {{- include "openim-rpc-user.labels" . | nindent 4 }} + {{- with .Values.serviceAccount.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +{{- end }} diff --git a/manifest/helm-charts/services/charts/openim-rpc-user/values.yaml b/manifest/helm-charts/services/charts/openim-rpc-user/values.yaml new file mode 100644 index 000000000..c9e15f5ba --- /dev/null +++ b/manifest/helm-charts/services/charts/openim-rpc-user/values.yaml @@ -0,0 +1,82 @@ +# Default values for openim-rpc-user. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +replicaCount: 1 + +image: + repository: nginx + pullPolicy: IfNotPresent + # Overrides the image tag whose default is the chart appVersion. + tag: "" + +imagePullSecrets: [] +nameOverride: "" +fullnameOverride: "" + +serviceAccount: + # Specifies whether a service account should be created + create: true + # Annotations to add to the service account + annotations: {} + # The name of the service account to use. + # If not set and create is true, a name is generated using the fullname template + name: "" + +podAnnotations: {} + +podSecurityContext: {} + # fsGroup: 2000 + +securityContext: {} + # capabilities: + # drop: + # - ALL + # readOnlyRootFilesystem: true + # runAsNonRoot: true + # runAsUser: 1000 + +service: + type: ClusterIP + port: 80 + +ingress: + enabled: false + className: "" + annotations: {} + # kubernetes.io/ingress.class: nginx + # kubernetes.io/tls-acme: "true" + hosts: + - host: chart-example.local + paths: + - path: / + pathType: ImplementationSpecific + tls: [] + # - secretName: chart-example-tls + # hosts: + # - chart-example.local + +resources: {} + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 128Mi + +autoscaling: + enabled: false + minReplicas: 1 + maxReplicas: 100 + targetCPUUtilizationPercentage: 80 + # targetMemoryUtilizationPercentage: 80 + +nodeSelector: {} + +tolerations: [] + +affinity: {} diff --git a/manifest/helm-charts/services/config.yaml b/manifest/helm-charts/services/config.yaml index 54be3372b..fcf0d9dd3 100644 --- a/manifest/helm-charts/services/config.yaml +++ b/manifest/helm-charts/services/config.yaml @@ -27,8 +27,16 @@ # Zookeeper username # Zookeeper password image: - pullPolicy: Always - tag: "v0.1.0" + pullPolicy: IfNotPresent + tag: "latest" +openim-msggateway: + image: + tag: "latest" + pullPolicy: IfNotPresent +openim-msgtransfer: + image: + tag: "latest" + pullPolicy: IfNotPresent envs: discovery: zookeeper #k8s diff --git a/manifest/helm-charts/services/templates/_helpers.tpl b/manifest/helm-charts/services/templates/_helpers.tpl index 3b0276d93..f137492f1 100644 --- a/manifest/helm-charts/services/templates/_helpers.tpl +++ b/manifest/helm-charts/services/templates/_helpers.tpl @@ -40,9 +40,6 @@ helm.sh/chart: {{ include "openim-api.chart" . }} app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} {{- end }} app.kubernetes.io/managed-by: {{ .Release.Service }} -{{- if .Values.extraLabels }} -{{ toYaml .Values.extraLabels }} -{{- end }} {{- end }} {{/* @@ -51,9 +48,6 @@ Selector labels {{- define "openim-api.selectorLabels" -}} app.kubernetes.io/name: {{ include "openim-api.name" . }} app.kubernetes.io/instance: {{ .Release.Name }} -{{- if .Values.extraLabels }} -{{ toYaml .Values.extraLabels }} -{{- end }} {{- end }} {{/* diff --git a/manifest/helm-charts/services/templates/app-cm.yaml b/manifest/helm-charts/services/templates/app-cm.yaml index ff9a469c5..7a6f23314 100644 --- a/manifest/helm-charts/services/templates/app-cm.yaml +++ b/manifest/helm-charts/services/templates/app-cm.yaml @@ -1,12 +1,13 @@ apiVersion: v1 kind: ConfigMap metadata: - name: {{ .Chart.Name }}-cm + name: openim-cm data: config.yaml: |+ {{- with .Values.config }} - # 服务端口 - port: {{ .port }} - grpc: {{ .grpc }} - + {{- toYaml . | nindent 4 }} + {{- end }} + notification.yaml: |+ + {{- with .Values.notification }} + {{- toYaml . | nindent 4 }} {{- end }} diff --git a/manifest/helm-charts/services/templates/app-data-pv.yaml b/manifest/helm-charts/services/templates/app-data-pv.yaml deleted file mode 100644 index e738676b9..000000000 --- a/manifest/helm-charts/services/templates/app-data-pv.yaml +++ /dev/null @@ -1,47 +0,0 @@ -{{- $pvType := .Values.storage.persistentVolumeType }} -{{- if or (eq $pvType "nfs") (eq $pvType "hostPath") }} -{{- range .Values.storage.persistentVolumes }} ---- -apiVersion: v1 -kind: PersistentVolume -metadata: - name: {{ .name }}-pv -spec: - capacity: - storage: {{ .capacity }} - accessModes: - - ReadWriteMany - storageClassName: {{ .name }}-sc - persistentVolumeReclaimPolicy: Retain -{{- if eq $pvType "nfs" }} - mountOptions: - - timeo=20 - - tcp - nfs: - {{- if not (empty $.Values.storage.nfsServer) }} - server: {{ $.Values.storage.nfsServer }} - {{- end }} - {{- if not (empty .path) }} - path: {{ .path }} - {{- end }} -{{- else }} - hostPath: - path: {{ .path }} -{{- end }} -{{- end }} -{{- range .Values.storage.persistentVolumes }} ---- -kind: PersistentVolumeClaim -apiVersion: v1 -metadata: - name: {{ .name }} -spec: - storageClassName: {{ .name }}-sc - accessModes: - - ReadWriteMany - resources: - requests: - storage: {{ .claimCapacity }} - -{{- end }} -{{- end }} diff --git a/manifest/helm-charts/services/templates/deployment.yaml b/manifest/helm-charts/services/templates/deployment.yaml index 78c39878d..ef8a63ec2 100644 --- a/manifest/helm-charts/services/templates/deployment.yaml +++ b/manifest/helm-charts/services/templates/deployment.yaml @@ -31,22 +31,33 @@ spec: - name: {{ .Chart.Name }} securityContext: {{- toYaml .Values.securityContext | nindent 12 }} - image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" + image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.image.pullPolicy }} ports: - name: http - containerPort: {{ .Values.service.port }} + containerPort: 80 protocol: TCP + livenessProbe: + httpGet: + path: / + port: http + readinessProbe: + httpGet: + path: / + port: http resources: {{- toYaml .Values.resources | nindent 12 }} volumeMounts: - - mountPath: /app/configs/config.yaml + - mountPath: /openim/openim-server/config/config.yaml name: config subPath: config.yaml + - mountPath: /openim/openim-server/config/notification.yaml + name: config + subPath: notification.yaml volumes: - name: config configMap: - name: openim-api-cm + name: openim-cm {{- with .Values.nodeSelector }} nodeSelector: {{- toYaml . | nindent 8 }} diff --git a/manifest/helm-charts/services/templates/ingress.yaml b/manifest/helm-charts/services/templates/ingress.yaml index ed591f032..62c66c135 100644 --- a/manifest/helm-charts/services/templates/ingress.yaml +++ b/manifest/helm-charts/services/templates/ingress.yaml @@ -1,18 +1,61 @@ +{{- if .Values.ingress.enabled -}} +{{- $fullName := include "openim-api.fullname" . -}} +{{- $svcPort := .Values.service.port -}} +{{- if and .Values.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }} + {{- if not (hasKey .Values.ingress.annotations "kubernetes.io/ingress.class") }} + {{- $_ := set .Values.ingress.annotations "kubernetes.io/ingress.class" .Values.ingress.className}} + {{- end }} +{{- end }} +{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}} apiVersion: networking.k8s.io/v1 +{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} +apiVersion: networking.k8s.io/v1beta1 +{{- else -}} +apiVersion: extensions/v1beta1 +{{- end }} kind: Ingress metadata: - name: ingress-{{ .Chart.Name }} - namespace: default + name: {{ $fullName }} + labels: + {{- include "openim-api.labels" . | nindent 4 }} + {{- with .Values.ingress.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} spec: - ingressClassName: nginx # 指定ingress类名称,这里是Nginx + {{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }} + ingressClassName: {{ .Values.ingress.className }} + {{- end }} + {{- if .Values.ingress.tls }} + tls: + {{- range .Values.ingress.tls }} + - hosts: + {{- range .hosts }} + - {{ . | quote }} + {{- end }} + secretName: {{ .secretName }} + {{- end }} + {{- end }} rules: - - host: 120.25.167.46 # 客户端访问的域名 + {{- range .Values.ingress.hosts }} + - host: {{ .host | quote }} http: paths: - - backend: + {{- range .paths }} + - path: {{ .path }} + {{- if and .pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }} + pathType: {{ .pathType }} + {{- end }} + backend: + {{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }} service: - name: {{ .Chart.Name }} # 转发到SVC名称 + name: {{ $fullName }} port: - number: {{ .Values.service.port }} # 转发到SVC端口 - path: /{{ .Chart.Name }}/ # 转发到/ - pathType: Prefix \ No newline at end of file + number: {{ $svcPort }} + {{- else }} + serviceName: {{ $fullName }} + servicePort: {{ $svcPort }} + {{- end }} + {{- end }} + {{- end }} +{{- end }} diff --git a/manifest/helm-charts/services/templates/service.yaml b/manifest/helm-charts/services/templates/service.yaml index fdd96cffd..eb37fa56c 100644 --- a/manifest/helm-charts/services/templates/service.yaml +++ b/manifest/helm-charts/services/templates/service.yaml @@ -8,7 +8,8 @@ spec: type: {{ .Values.service.type }} ports: - port: {{ .Values.service.port }} - targetPort: {{ .Values.service.port }} + targetPort: http protocol: TCP + name: http selector: {{- include "openim-api.selectorLabels" . | nindent 4 }} diff --git a/manifest/helm-charts/services/templates/serviceaccount.yaml b/manifest/helm-charts/services/templates/serviceaccount.yaml new file mode 100644 index 000000000..e3e7b2849 --- /dev/null +++ b/manifest/helm-charts/services/templates/serviceaccount.yaml @@ -0,0 +1,12 @@ +{{- if .Values.serviceAccount.create -}} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "openim-api.serviceAccountName" . }} + labels: + {{- include "openim-api.labels" . | nindent 4 }} + {{- with .Values.serviceAccount.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +{{- end }} diff --git a/manifest/helm-charts/services/values.yaml b/manifest/helm-charts/services/values.yaml index eaa6b21be..252ac3823 100644 --- a/manifest/helm-charts/services/values.yaml +++ b/manifest/helm-charts/services/values.yaml @@ -1,19 +1,14 @@ -images: - jobInitContainer: "" - imgaeName: "" - -otherConfigs: - url: "" - ansible_arch: "" - +# Default values for openim-api. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. replicaCount: 1 image: - repository: harbor.apulis.cn:8443/huawei630/apulistech/openim-api - pullPolicy: Always + repository: nginx + pullPolicy: IfNotPresent # Overrides the image tag whose default is the chart appVersion. - tag: "v0.1.0" + tag: "" imagePullSecrets: [] nameOverride: "" @@ -25,6 +20,7 @@ serviceAccount: # Annotations to add to the service account annotations: {} # The name of the service account to use. + # If not set and create is true, a name is generated using the fullname template name: "" podAnnotations: {} @@ -33,43 +29,44 @@ podSecurityContext: {} # fsGroup: 2000 securityContext: {} + # capabilities: + # drop: + # - ALL + # readOnlyRootFilesystem: true + # runAsNonRoot: true + # runAsUser: 1000 service: type: ClusterIP port: 80 -resources: {} +ingress: + enabled: true + className: "nginx" + annotations: {} + # kubernetes.io/ingress.class: nginx + # kubernetes.io/tls-acme: "true" + hosts: + - host: + paths: + - path: /openim-api + pathType: Prefix + tls: [] + # - secretName: chart-example-tls + # hosts: + # - chart-example.local -notification: - port: 88 -config: - port: 80 - grpc: 81 - debug: true - apiV1Prefix: /api/v1 - db: - serverType: postgres - username: postgres - password: root - host: 172.17.0.1 - port: 5432 - -storage: - persistentVolumeType: hostPath - nfsServer: 192.168.3.9 - persistentVolumes: - - name: aiplatform-app-data-pvc - capacity: 20Gi - claimCapacity: 5Gi - path: /dev-d/app/ai-app-data - mounts: #first pvc mounted as main storage - - name: aiplatform-app-data-pvc - subPath: openim-api - mountPath: /app/openim-api-data - configs: - - name: openim-api-cm - subPath: config.yaml - mountPath: /app/configs/config.yaml +resources: {} + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 128Mi autoscaling: enabled: false @@ -78,30 +75,13 @@ autoscaling: targetCPUUtilizationPercentage: 80 # targetMemoryUtilizationPercentage: 80 +nodeSelector: {} -nodeSelector: { - archType: amd64 -} tolerations: [] affinity: {} -ingress: - kind: "istio" - enabled: true - className: "" - annotations: {} - # kubernetes.io/ingress.class: nginx - # kubernetes.io/tls-acme: "true" - hosts: - - host: - paths: - - path: /openim-api - pathType: Prefix - tls: - secretName: https-tls - # hosts: - # - chart-example.local +notification: + +config: -# Custom labels to apply to Deployment, Pod, Configmap, Service, ServiceMonitor. Including autoscaler if enabled. -extraLabels: {}