关于choerodon:Gitlab猪齿鱼-实现自动化部署
Choerodon猪齿鱼V0.23版本中的部署 > 利用部署 > 流水线性能在猪齿鱼中停用,须要切换为开发 > 利用流水线性能,相比于老版的流水线,新版本的利用流水线加强了猪齿鱼的治理性能,提供了更多的扩大。通过 Gitlab 和 猪齿鱼的 DevOps 实现提交代码后自动更新服务的流程。 前置条件猪齿鱼 DevOps开发标准开发人员在个性分支(feature-*)进行性能开发,实现性能开发之后将个性分支合并到环境分支develop进行部署。 自动化部署配置在猪齿鱼中配置 K8s Config Map性能门路:利用部署 > 资源 > 资源视图 > 抉择环境 > 配置映射在配置映射中须要定义CM的名称,这里以hzero-dev为例,在配置映射中保护公共的环境变量,例如注册核心地址等. 调整 Chart 中的配置文件创立实现配置映射之后,须要在k8s部署时读取cm配置,这一步须要调整我的项目下的helm配置。 留神配置的缩进,间接拷贝(Ctrl + V)IDEA会主动调整缩进,请应用Paste as Plain Text保障缩进不会被主动调整。 charts/hzero-platform/templates/_helpers.tpl{{/* vim: set filetype=mustache: */}}{{- /*service.labels.standard prints the standard service Helm labels.The standard labels are frequently used in metadata.*/ -}}{{- define "service.image" -}}{{- printf "%s:%s" .Values.image.repository (default (.Chart.Version) .Values.image.tag) -}}{{- end -}}{{- define "service.microservice.labels" -}}choerodon.io/version: {{ default (.Chart.Version) .Values.image.tag }}choerodon.io/service: {{ .Chart.Name | quote }}choerodon.io/metrics-port: {{ .Values.deployment.managementPort | quote }}{{- end -}}{{- define "service.labels.standard" -}}choerodon.io/release: {{ .Release.Name | quote }}{{- end -}}{{- define "service.match.labels" -}}choerodon.io/release: {{ .Release.Name | quote }}{{- end -}}{{- define "service.logging.deployment.label" -}}choerodon.io/logs-parser: {{ .Values.logs.parser | quote }}{{- end -}}{{- define "service.monitoring.pod.annotations" -}}choerodon.io/metrics-group: {{ .Values.metrics.group | quote }}choerodon.io/metrics-path: {{ .Values.metrics.path | quote }}{{- end -}}{{/*Return the appropriate apiVersion for deployment.*/}}{{- define "app.deployment.apiVersion" -}}{{- if semverCompare "<1.9-0" .Capabilities.KubeVersion.GitVersion -}}{{- print "apps/v1beta2" -}}{{- else -}}{{- print "apps/v1" -}}{{- end -}}{{- end -}}{{/*Return the appropriate apiVersion for statefulset.*/}}{{- define "app.statefulset.apiVersion" -}}{{- if semverCompare "<1.9-0" .Capabilities.KubeVersion.GitVersion -}}{{- print "apps/v1beta2" -}}{{- else -}}{{- print "apps/v1" -}}{{- end -}}{{- end -}}{{/*Return the appropriate apiVersion for ingress.*/}}{{- define "app.ingress.apiVersion" -}}{{- if semverCompare "<1.14-0" .Capabilities.KubeVersion.GitVersion -}}{{- print "extensions/v1beta1" -}}{{- else -}}{{- print "networking.k8s.io/v1beta1" -}}{{- end -}}{{- end -}}charts/hzero-platform/templates/deployment.yaml26~28行定义读取CM,CM的名称来自于values.yaml。 ...