如何使用头盔和Azure托管身份安装Velero?

时间:2020-10-13 02:14:34

标签: azure kubernetes

因此,我遵循以下文档:

  1. https://github.com/vmware-tanzu/velero-plugin-for-microsoft-azure#option-2-use-aad-pod-identity
  2. https://velero.io/docs/v1.5/basic-install/

我仍然不知道如何使用https://github.com/vmware-tanzu/helm-charts上的头盔图来安装Velero,因为我无法将基于头盔图的安装与在 https://github.com/vmware-tanzu/velero-plugin-for-microsoft-azure

这是我到目前为止所做的:

  1. 已安装https://github.com/Azure/aad-pod-identity。验证它是否有效。
  2. 在用于备份的专用存储帐户中创建了Azure存储容器
  3. 按照https://github.com/vmware-tanzu/velero-plugin-for-microsoft-azure#option-2-use-aad-pod-identity
  4. 中的说明创建了供Velero使用的MSI。

现在,我需要更新values.yaml文件,但是我被困在凭据部分。我无法使https://github.com/vmware-tanzu/velero-plugin-for-microsoft-azure上的velero install指令与values.yaml文件中看到的一致。

例如我已经创建了credentials-velero文件:

AZURE_SUBSCRIPTION_ID=...
AZURE_RESOURCE_GROUP=...
AZURE_CLOUD_NAME=AzurePublicCloud

当然,它不包含MSI凭据,并且MSI名称将使用专用标签进行关联。 doc清楚地说:

如果您使用的是AAD Pod Identity,则现在需要添加 aadpodidbinding = $ IDENTITY_NAME贴在Velero吊舱上,最好 通过部署的pod模板。

但是当我使用头盔图安装Velero时该怎么做?

2 个答案:

答案 0 :(得分:0)

按照文档中所述将AzureIdentity和AzureIdentityBinding角色添加到群集中。

# Under AzureIdentityBinding
apiVersion: "aadpodidentity.k8s.io/v1"
kind: AzureIdentityBinding
metadata:
  name: <name> #replace name
spec:
AzureIdentity: <identity> #replace with the name of the identity resource created.
Selector: <label>

完成后,在部署舵图时使用选择器定义的AzureIdentityBinding作为标签。

podLabels: {aadpodidbinding: <selector>} # selector you defined above in AzureIdentityBinding 

在helm install命令中使用--set检查podLabel的实际语法。或者,您可以克隆图表并在下面对values.yaml进行更改,然后从本地图表进行安装。

https://github.com/vmware-tanzu/helm-charts/blob/04615803a7d976ce15a6eeb4b1bd6a1cfb9a02c5/charts/velero/values.yaml#L27

仅需帮助: https://medium.com/@kimvisscher/using-aad-pod-identity-in-an-aks-cluster-117c08565692

答案 1 :(得分:0)

您似乎在为如何格式化 values.yaml 文件的 secretContents 部分而苦苦挣扎。如果是这样,请查看文档的最新更新。它详细说明并记录了如何对其进行格式化:

https://github.com/vmware-tanzu/helm-charts/blob/1ea07c7fb9c7ba910ba52801c536a6f8dcee096d/charts/velero/values.yaml#L219-L232