helm support

pull/291/head
nxn 3 years ago
parent b300734a70
commit 69c0bee479

@ -0,0 +1,21 @@
#### 配置
```
请根据需要配置 values.yaml
#创建 k8s namespace
kubectl create namespace openim-ns
```
#### 安装
```
cd helm
helm install my-openim -f openim/values.yaml -n openim-ns openim
```
#### 更新
```
cd helm
helm upgrade my-openim -f openim/values.yaml -n openim-ns openim
```
#### 卸载
```
cd helm
helm uninstall my-openim -n openim
```

@ -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/

@ -0,0 +1,24 @@
apiVersion: v2
name: openim
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"

@ -0,0 +1,62 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "openim.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.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.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}
{{/*
Common labels
*/}}
{{- define "openim.labels" -}}
helm.sh/chart: {{ include "openim.chart" . }}
{{ include "openim.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}
{{/*
Selector labels
*/}}
{{- define "openim.selectorLabels" -}}
app.kubernetes.io/name: {{ include "openim.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}
{{/*
Create the name of the service account to use
*/}}
{{- define "openim.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "openim.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}

@ -0,0 +1,35 @@
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: admin-cms-deployment
spec:
selector:
matchLabels:
app: admin-cms # 选择这个指定标签执行
replicas: 1 # 运行pod数量
template:
metadata:
labels:
app: admin-cms # 标签
spec:
containers:
- name: admin-cms
image: {{ .Values.admin_csm.image }}
# imagePullPolicy: Always #每次启动都重新拉取镜像
ports:
- containerPort: {{ .Values.admin_csm.port }}
volumeMounts:
- name: config
mountPath: /Open-IM-Server/config
readOnly: true
env:
- name: CONFIG_NAME
value: "/Open-IM-Server"
volumes:
- name: config
configMap:
name: openim-config
strategy: #更新策略
type: RollingUpdate # 滚动更新

@ -0,0 +1,48 @@
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: api-deployment
spec:
selector:
matchLabels:
app: api # 选择这个指定标签执行
replicas: 1 # 运行pod数量
template:
metadata:
labels:
app: api # 标签
spec:
containers:
- name: api
image: {{ .Values.api.image }}
# imagePullPolicy: Always
ports:
- containerPort: {{ .Values.api.port }}
volumeMounts:
- name: config
mountPath: /Open-IM-Server/config
readOnly: true
env:
- name: CONFIG_NAME
value: "/Open-IM-Server"
volumes:
- name: config
configMap:
name: openim-config
strategy: #更新策略
type: RollingUpdate # 滚动更新
---
apiVersion: v1
kind: Service
metadata:
name: api
spec:
ports:
- name: api-port
protocol: TCP
port: 10002
targetPort: 10002
selector:
app: api
type: NodePort

@ -0,0 +1,34 @@
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: auth-deployment
spec:
selector:
matchLabels:
app: auth # 选择这个指定标签执行
replicas: 1 # 运行pod数量
template:
metadata:
labels:
app: auth # 标签
spec:
containers:
- name: auth
image: {{ .Values.auth.image }}
# imagePullPolicy: Always
ports:
- containerPort: {{ .Values.auth.port }}
volumeMounts:
- name: config
mountPath: /Open-IM-Server/config
readOnly: true
env:
- name: CONFIG_NAME
value: "/Open-IM-Server"
volumes:
- name: config
configMap:
name: openim-config
strategy: #更新策略
type: RollingUpdate # 滚动更新

@ -0,0 +1,34 @@
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: cache-deployment
spec:
selector:
matchLabels:
app: cache # 选择这个指定标签执行
replicas: 1 # 运行pod数量
template:
metadata:
labels:
app: cache # 标签
spec:
containers:
- name: cache
image: {{ .Values.cache.image }}
# imagePullPolicy: Always
ports:
- containerPort: {{ .Values.cache.port }}
volumeMounts:
- name: config
mountPath: /Open-IM-Server/config
readOnly: true
env:
- name: CONFIG_NAME
value: "/Open-IM-Server"
volumes:
- name: config
configMap:
name: openim-config
strategy: #更新策略
type: RollingUpdate # 滚动更新

@ -0,0 +1,48 @@
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: cms-api-deployment
spec:
selector:
matchLabels:
app: cms-api # 选择这个指定标签执行
replicas: 1 # 运行pod数量
template:
metadata:
labels:
app: cms-api # 标签
spec:
containers:
- name: cms-api
image: {{ .Values.cms_api.image }}
imagePullPolicy: Always
ports:
- containerPort: {{ .Values.cms_api.port }}
volumeMounts:
- name: config
mountPath: /Open-IM-Server/config
readOnly: true
env:
- name: CONFIG_NAME
value: "/Open-IM-Server"
volumes:
- name: config
configMap:
name: openim-config
strategy: #更新策略
type: RollingUpdate # 滚动更新
---
apiVersion: v1
kind: Service
metadata:
name: cms-api
spec:
ports:
- name: cms-api-port
protocol: TCP
port: 10006
targetPort: 10006
selector:
app: cms-api
type: NodePort

@ -0,0 +1,36 @@
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: conversation-deployment
spec:
selector:
matchLabels:
app: conversation # 选择这个指定标签执行
replicas: 2 # 运行pod数量
template:
metadata:
labels:
app: conversation # 标签
spec:
containers:
- name: conversation
image: {{ .Values.conversation.image }}
# imagePullPolicy: Always
ports:
- containerPort: {{ .Values.conversation.port }}
volumeMounts:
- name: config
mountPath: /Open-IM-Server/config
readOnly: true
env:
- name: CONFIG_NAME
value: "/Open-IM-Server"
volumes:
- name: config
configMap:
name: openim-config
strategy: #更新策略
type: RollingUpdate # 滚动更新

@ -0,0 +1,48 @@
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: demo-deployment
spec:
selector:
matchLabels:
app: demo # 选择这个指定标签执行
replicas: 1 # 运行pod数量
template:
metadata:
labels:
app: demo # 标签
spec:
containers:
- name: demo
image: {{ .Values.demo.image }}
imagePullPolicy: Always
ports:
- containerPort: {{ .Values.demo.port }}
volumeMounts:
- name: config
mountPath: /Open-IM-Server/config
readOnly: true
env:
- name: CONFIG_NAME
value: "/Open-IM-Server"
volumes:
- name: config
configMap:
name: openim-config
strategy: #更新策略
type: RollingUpdate # 滚动更新
---
apiVersion: v1
kind: Service
metadata:
name: demo
spec:
ports:
- name: demo
protocol: TCP
port: 10004
targetPort: 10004
selector:
app: demo
type: NodePort

@ -0,0 +1,35 @@
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: friend-deployment
spec:
selector:
matchLabels:
app: friend # 选择这个指定标签执行
replicas: 1 # 运行pod数量
template:
metadata:
labels:
app: friend # 标签
spec:
containers:
- name: friend
image: {{ .Values.friend.image }}
# imagePullPolicy: Always
ports:
- containerPort: {{ .Values.friend.port }}
volumeMounts:
- name: config
mountPath: /Open-IM-Server/config
readOnly: true
env:
- name: CONFIG_NAME
value: "/Open-IM-Server"
volumes:
- name: config
configMap:
name: openim-config
strategy: #更新策略
type: RollingUpdate # 滚动更新

@ -0,0 +1,34 @@
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: group-deployment
spec:
selector:
matchLabels:
app: group # 选择这个指定标签执行
replicas: 1 # 运行pod数量
template:
metadata:
labels:
app: group # 标签
spec:
containers:
- name: group
image: {{ .Values.group.image }}
# imagePullPolicy: Always
ports:
- containerPort: {{ .Values.group.port }}
volumeMounts:
- name: config
mountPath: /Open-IM-Server/config
readOnly: true
env:
- name: CONFIG_NAME
value: "/Open-IM-Server"
volumes:
- name: config
configMap:
name: openim-config
strategy: #更新策略
type: RollingUpdate # 滚动更新

@ -0,0 +1,34 @@
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: msg-deployment
spec:
selector:
matchLabels:
app: msg # 选择这个指定标签执行
replicas: 1 # 运行pod数量
template:
metadata:
labels:
app: msg # 标签
spec:
containers:
- name: msg
image: {{ .Values.msg.image }}
# imagePullPolicy: Always
ports:
- containerPort: {{ .Values.msg.port }}
volumeMounts:
- name: config
mountPath: /Open-IM-Server/config
readOnly: true
env:
- name: CONFIG_NAME
value: "/Open-IM-Server"
volumes:
- name: config
configMap:
name: openim-config
strategy: #更新策略
type: RollingUpdate # 滚动更新

@ -0,0 +1,53 @@
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: msg-gateway-deployment
spec:
selector:
matchLabels:
app: msg-gateway # 选择这个指定标签执行
replicas: 1 # 运行pod数量
template:
metadata:
labels:
app: msg-gateway # 标签
spec:
containers:
- name: msg-gateway
image: {{ .Values.msg_gateway.image }}
# imagePullPolicy: Always
ports:
- name: rpc-port
containerPort: {{ .Values.msg_gateway.rpcport }}
- name: ws-port
containerPort: {{ .Values.msg_gateway.wsport }}
volumeMounts:
- name: config
mountPath: /Open-IM-Server/config
readOnly: true
env:
- name: CONFIG_NAME
value: "/Open-IM-Server"
volumes:
- name: config
configMap:
name: openim-config
strategy: #更新策略
type: RollingUpdate # 滚动更新
---
apiVersion: v1
kind: Service
metadata:
name: msg-gateway
spec:
ports:
- name: msg-gateway-port
protocol: TCP
port: 10001
targetPort: ws-port
selector:
app: msg-gateway
type: NodePort

@ -0,0 +1,32 @@
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: msg-transfer-deployment
spec:
selector:
matchLabels:
app: msg-transfer # 选择这个指定标签执行
replicas: 1 # 运行pod数量
template:
metadata:
labels:
app: msg-transfer # 标签
spec:
containers:
- name: msg-transfer
image: {{ .Values.msg_transfer.image }}
# imagePullPolicy: Always
volumeMounts:
- name: config
mountPath: /Open-IM-Server/config
readOnly: true
env:
- name: CONFIG_NAME
value: "/Open-IM-Server"
volumes:
- name: config
configMap:
name: openim-config
strategy: #更新策略
type: RollingUpdate # 滚动更新

@ -0,0 +1,33 @@
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: office-deployment
spec:
selector:
matchLabels:
app: office # 选择这个指定标签执行
replicas: 1 # 运行pod数量
template:
metadata:
labels:
app: office # 标签
spec:
containers:
- name: office
image: {{ .Values.office.image }}
ports:
- containerPort: {{ .Values.office.port }}
volumeMounts:
- name: config
mountPath: /Open-IM-Server/config
readOnly: true
env:
- name: CONFIG_NAME
value: "/Open-IM-Server"
volumes:
- name: config
configMap:
name: openim-config
strategy: #更新策略
type: RollingUpdate # 滚动更新

@ -0,0 +1,33 @@
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: organization-deployment
spec:
selector:
matchLabels:
app: organization # 选择这个指定标签执行
replicas: 1 # 运行pod数量
template:
metadata:
labels:
app: organization # 标签
spec:
containers:
- name: organization
image: {{ .Values.organization.image }}
ports:
- containerPort: {{ .Values.organization.port }}
volumeMounts:
- name: config
mountPath: /Open-IM-Server/config
readOnly: true
env:
- name: CONFIG_NAME
value: "/Open-IM-Server"
volumes:
- name: config
configMap:
name: openim-config
strategy: #更新策略
type: RollingUpdate # 滚动更新

@ -0,0 +1,33 @@
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: push-deployment
spec:
selector:
matchLabels:
app: push # 选择这个指定标签执行
replicas: 1 # 运行pod数量
template:
metadata:
labels:
app: push # 标签
spec:
containers:
- name: push
image: {{ .Values.push.image }}
ports:
- containerPort: {{ .Values.push.port }}
volumeMounts:
- name: config
mountPath: /Open-IM-Server/config
readOnly: true
env:
- name: CONFIG_NAME
value: "/Open-IM-Server"
volumes:
- name: config
configMap:
name: openim-config
strategy: #更新策略
type: RollingUpdate # 滚动更新

@ -0,0 +1,56 @@
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: sdk-server-deployment
spec:
selector:
matchLabels:
app: sdk-server # 选择这个指定标签执行
replicas: 1 # 运行pod数量
template:
metadata:
labels:
app: sdk-server # 标签
spec:
containers:
- name: sdk-server
image: {{ .Values.sdk_server.image }}
ports:
- containerPort: {{ .Values.sdk_server.port }}
volumeMounts:
- name: config
mountPath: /Open-IM-Server/config
readOnly: true
- name: local-db
mountPath: /db/sdk
env:
- name: CONFIG_NAME
value: "/Open-IM-Server"
command: ["/Open-IM-Server/main"]
args: ["-openIM_ws_address", "ws_addr", "-sdk_ws_port", "10001", "-openIM_api_address", "api_address", "-openIM_log_level", "6"]
volumes:
- name: config
configMap:
name: openim-config
- name: local-db
hostPath:
path: /db/sdk
strategy: #更新策略
type: RollingUpdate # 滚动更新
---
apiVersion: v1
kind: Service
metadata:
name: sdk-server
spec:
ports:
- name: sdk-server-port
protocol: TCP
port: 10003
targetPort: 10003
selector:
app: sdk-server
type: NodePort

@ -0,0 +1,34 @@
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: user-deployment
spec:
selector:
matchLabels:
app: user # 选择这个指定标签执行
replicas: 1 # 运行pod数量
template:
metadata:
labels:
app: user # 标签
spec:
containers:
- name: user
image: {{ .Values.user.image }}
ports:
- containerPort: {{ .Values.user.port }}
# imagePullPolicy: Always
volumeMounts:
- name: config
mountPath: /Open-IM-Server/config
readOnly: true
env:
- name: CONFIG_NAME
value: "/Open-IM-Server"
volumes:
- name: config
configMap:
name: openim-config
strategy: #更新策略
type: RollingUpdate # 滚动更新

@ -0,0 +1,76 @@
# Default values for openim.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.
admin_csm:
image: openim/admin_cms:v2.3.0release
port: 10200
api:
image: openim/api:v2.3.0release
port: 10002
auth:
image: openim/auth:v2.3.0release
port: 10160
cache:
image: openim/cache:v2.3.0release
port: 10240
cms_api:
image: openim/cms_api:v2.3.0release
port: 10006
conversation:
image: openim/conversation:v2.3.0release
port: 10230
demo:
image: openim/demo:v2.3.0release
port: 10004
friend:
image: openim/friend:v2.3.0release
port: 10120
group:
image: openim/group:v2.3.0release
port: 10150
msg:
image: openim/msg:v2.3.0release
port: 10130
msg_gateway:
image: openim/msg_gateway:v2.3.0release
rpcport: 10140
wsport: 10001
msg_transfer:
image: openim/msg_transfer:v2.3.0release
office:
image: openim/office:v2.3.0release
port: 10210
organization:
image: openim/organization:v2.3.0release
port: 10220
push:
image: openim/push:v2.3.0release
port: 10170
sdk_server:
image: openim/sdk_server:v2.3.0release
port: 10003
user:
image: openim/user:v2.3.0release
port: 10110
Loading…
Cancel
Save