Skip to content

Latest commit

 

History

History
45 lines (35 loc) · 1.82 KB

read-from-secret.md

File metadata and controls

45 lines (35 loc) · 1.82 KB

Read cloud config from Kubernetes secrets

  • available driver version: v0.7.0 or above

This driver also supports reading the cloud config from Kubernetes secrets. The secret is a serialized version of azure.json file with key cloud-config. The secret should be put in kube-system namespace and its name should be azure-cloud-provider.

How to convert cloud config to a Kubernetes secret

  1. create azure.json file and fill in all necessary fields, refer to Cloud provider config, and here is an example
  2. serialize azure.json by following command:
cat azure.json | base64 | awk '{printf $0}'; echo
  1. create a secret file(azure-cloud-provider.yaml) with following values and fill in cloud-config value produced in step#2
apiVersion: v1
data:
  cloud-config: [fill-in-here]
kind: Secret
metadata:
  name: azure-cloud-provider
  namespace: kube-system
type: Opaque
  1. Create a azure-cloud-provider secret in k8s cluster
kubectl create -f azure-cloud-provider.yaml

specify different cloud config secret in driver deployment

  • available driver version: v1.5.0 or above
  • set cloudConfigSecretName, cloudConfigSecretNamesapce in driver deployment, follow helm chart guide
        - name: azuredisk
          ...
          args:
            ...
            - "--cloud-config-secret-name={{cloudConfigSecretName}}"
            - "--cloud-config-secret-namespace={{cloudConfigSecretNamespace}}"