dapr runtime:v1.11.1
如果我们新增了自定义的组件或者修改了源码,这时需要重新将源码编译成一系列的可执行文件
第一步从github上拉取dapr项目
目录列表:
- /opt/dapr/components-contrib:dapr 组件的目录
- /opt/dapr/dapr:dapr runtime目录
执行编译指令:
#!/usr/bin/env bash
cd /opt/dapr/dapr
# 编译
make build
# 构建docker镜像
read -rp "输入版本号(v1.11.1-x):" NEW_DAPR_TAG
export DAPR_TAG=$NEW_DAPR_TAG
export DAPR_REGISTRY=<镜像仓库地址>
make docker-build
# 上传镜像
docker push $DAPR_REGISTRY/injector:$NEW_DAPR_TAG-linux-amd64
docker push $DAPR_REGISTRY/operator:$NEW_DAPR_TAG-linux-amd64
docker push $DAPR_REGISTRY/sentry:$NEW_DAPR_TAG-linux-amd64
docker push $DAPR_REGISTRY/placement:$NEW_DAPR_TAG-linux-amd64
docker push $DAPR_REGISTRY/daprd:$NEW_DAPR_TAG-linux-amd64
docker push $DAPR_REGISTRY/dapr:$NEW_DAPR_TAG-linux-amd64
同时修改配置(/opt/dapr/dapr/charts/dapr/values.yaml)
global:
registry: <镜像仓库>
tag: 'v1.11.1-0-linux-amd64'
dnsSuffix: ".cluster.local"
logAsJson: false
imagePullPolicy: IfNotPresent
imagePullSecrets: ""
nodeSelector: {}
tolerations: []
rbac:
namespaced: false
ha:
enabled: false
prometheus:
enabled: false
mtls:
enabled: false
workloadCertTTL: 24h
allowedClockSkew: 15m
daprControlPlaneOs: linux
labels: {}
k8sLabels:
app.kubernetes.io/name: "{{ .Release.Name }}"
app.kubernetes.io/version: "{{ .Values.global.tag }}"
app.kubernetes.io/part-of: "dapr"
app.kubernetes.io/managed-by: "helm"
app.kubernetes.io/component: "{{ .Values.component }}" # Should be set in each subchart
issuerFilenames: {}
argoRolloutServiceReconciler:
enabled: false
actors:
enabled: false
operator:
watchdogCanPatchPodLabels: false
更新dapr
cd /opt/dapr/dapr
helm upgrade dapr ./charts/dapr --namespace dapr --wait
当对Dapr组件或源码进行定制后,需要重新编译并构建Docker镜像。首先从GitHub获取Dapr项目,然后在指定目录下执行编译和构建命令,如`makebuild`和`makedocker-build`。接着,使用指定的镜像仓库地址推送包括injector、operator等组件的镜像,并更新配置文件charts/dapr/values.yaml。最后,使用Helm升级Dapr部署。
238





