在k8s集群上安装dapr
1.安装dapr cliwget -q https://raw.githubusercontent.com/dapr/cli/master/install/install.sh -O - | /bin/bash如果raw.githubusercontent.com不能解析,需要改hostsecho "185.199.108.133 raw.githubusercontent.com" >&g
·
1.安装dapr cli
wget -q https://raw.githubusercontent.com/dapr/cli/master/install/install.sh -O - | /bin/bash
如果raw.githubusercontent.com不能解析,需要改hosts
echo "185.199.108.133 raw.githubusercontent.com" >> /etc/hosts
官方文档——在k8s集群上初始化dapr
2. 初始化dapr
dapr init -k
#改namespace
dapr init -k -n mynamespace
#高可用,3副本
dapr init -k --enable-ha=true
如果使用–enable-ha=true选项,可能产生3个dapr-placement-server一直pending状态的情况,describe如果发现是因为pvc找不到可用的pv,创建一下
静态pv的示例如下(本地文件系统或nfs):
apiVersion: v1
kind: PersistentVolume
metadata:
name: dapr-system-placement-server-pv-1
labels:
type: nfs
app: dapr-placement-server
spec:
capacity:
storage: 1024Mi
volumeMode: Filesystem
accessModes:
- ReadWriteOnce
persistentVolumeReclaimPolicy: Recycle
storageClassName:
# hostPath:
# path: "/home/dapr-placement-pv"
mountOptions:
- hard
- nfsvers=4.1
nfs:
path: /home/k8s-pv-root/dapr-system-placement-server-pv-1
server: 172.18.66.204
更多推荐
已为社区贡献2条内容
所有评论(0)