-
添加helm仓库
helm repo add cortex-helm https://cortexproject.github.io/cortex-helm-chart
-
下载helm包的values.yaml
-
修改values.yaml为cortex-values.yam
-
修改配置(必须改,不然会报错)
在cortex-values.yaml修改存储配置,将你所用的对象存储的secretId和secretkey写入
4.创建secret和两个pv
secret用作访问对象存储
apiVersion: v1
kind: Secret
type: Opaque
metadata:
name: oos-secret
# Replaced by your secret namespace.
namespace: kube-system
data:
# Replaced by your temporary secret file content. You can generate a temporary secret key with these docs:
# Note: The value must be encoded by base64.
SecretId:
SecretKey:
创建compactor所需的pv
apiVersion: v1
kind: PersistentVolume
metadata:
name: storage-cortex-compactor-0
spec:
accessModes:
- ReadWriteOnce
capacity:
storage: 10Gi
csi:
driver: <k8s-csi驱动>
# Specify a unique volumeHandle like pv name or bucket name
volumeHandle: storage-cortex-compactor-0
volumeAttributes:
# Replaced by the url of your region.
url: <buctet-url>
# Replaced by the bucket name you want to use.
bucket: <buctetName>
# cos bucket mount path
path: "/"
# cosfs log level, will use node syslog, support [dbg|info|warn|err|crit]
dbglevel: "err"
# You can specify any other options used by the cosfs command in here.
additional_args: "-oensure_diskfree=20480"
nodePublishSecretRef:
# Replaced by the name and namespace of your secret.
name: cos-secret
namespace: kube-system
创建gateway所需的pv
apiVersion: v1
kind: PersistentVolume
metadata:
name: storage-cortex-gateway-0
spec:
accessModes:
- ReadWriteOnce
capacity:
storage: 10Gi
csi:
driver: <k8s-csi驱动>
# Specify a unique volumeHandle like pv name or bucket name
volumeHandle: storage-cortex-gateway-0
volumeAttributes:
# Replaced by the url of your region.
url: <bucket-url>
# Replaced by the bucket name you want to use.
bucket: <bucketName>
# cos bucket mount path
path: "/"
# cosfs log level, will use node syslog, support [dbg|info|warn|err|crit]
dbglevel: "err"
# You can specify any other options used by the cosfs command in here.
additional_args: "-oensure_diskfree=20480"
nodePublishSecretRef:
# Replaced by the name and namespace of your secret.
name: cos-secret
namespace: kube-system
5.部署
helm install cortex -n cortex -f cortex-values.yaml cortex-helm/cortex