From 59ac38a6bffe943fa634b124b8ec2a907f95a006 Mon Sep 17 00:00:00 2001 From: Christian Rolland Date: Tue, 18 Jul 2023 17:29:49 -0400 Subject: [PATCH] docs: add docs for installing azure ccm and csi Add docs for installing Azure ccm and csi on Talos. Signed-off-by: Christian Rolland --- docs/.DS_Store | Bin 0 -> 6148 bytes website/.DS_Store | Bin 0 -> 6148 bytes .../configuration/azure-ccm-csi.md | 227 ++++++++++++++++++ 3 files changed, 227 insertions(+) create mode 100644 docs/.DS_Store create mode 100644 website/.DS_Store create mode 100644 website/content/v1.4/kubernetes-guides/configuration/azure-ccm-csi.md diff --git a/docs/.DS_Store b/docs/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..7599072413d3296c9522e2c6c4e663de2f8551d5 GIT binary patch literal 6148 zcmeH~Jx;?w5QX1Dil8(pDfbH8z>2~NaseP#B&2{NoD_8KxHfNofJ8Pe1$q*gc7%7|(4Jx+MVGmd!QwWI9mfYsh$iw-aRoz?f- zr>@&`TP`2)#)JdC$0PRWckR#e^uCIUfCz|y2#A0POcSu?N}Df2HHv@;h`=`i`#w~< zX_GpH`lo|~Uje8yhTZt=cL{2>0JTXSLK&fzD5XYe$ty;Qa>i@sHK{{rl%x2`+$T>i zc|$3FI^)&TQJPSVA|L{n1g>McwEllj|K$R2s sK>sr4dO8Ph#Z+&_oLDQqJ(uq0)Ii^69WqzNB{r; literal 0 HcmV?d00001 diff --git a/website/.DS_Store b/website/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..2fe9223d99261cacb0e396cd6a92324fccb77bed GIT binary patch literal 6148 zcmeHKF-`+P475q4M50MaxnJN1t0=sH4%UOXYB36j&Hle_H~$KUk;GFu&oVb{^Squ z+>%KFDIf);fE17dS5}}3?DGD~=ju2qAO&t;0e&AEoY)J;#Q1bzh!y}iM>q`g=p}%S z0bnm26A^)VQh`bJYB4 **NOTE:** This will vary depending on what the CCM is being used for, but **Virtual Machine Contributor** is enough for the purposes if this installation guide. + +### Collect additional information + +In the Azure Portal, collected the following values to be used in the configuration file, **specific to the cluster the CCM is being installed on**: + +- **Resource Group** +- **Location** +- **Virtual Network name** +- **Route Table name** + +### Create the configuration file + +Create a configuration file named **azure.cfg** + +```shell +vim cloud.conf +``` + +Add the following to the **azure.cfg** file, but **replace the values with the values gathered at the beginning of this guide**. + +```shell +{ + "cloud":"AzurePublicCloud", + "tenantId": "${TENANT_ID}$", + "subscriptionId": "${SUBSCRIPTION_ID}$", + "aadClientId": "${CLIENT_ID}$", + "aadClientSecret": "${CLIENT_SECRET}$", + "resourceGroup": "${RESOURCE_GROUP}$", + "location": "${LOCATION}", + "loadBalancerSku": "standard", + "securityGroupName": "${SECURITY_GROUP_NAME}", + "vnetName": "${VIRTUAL_NETWORK_NAME}", + "routeTableName": "${ROUTE_TABLE_NAME}" +} + +``` + +Additional configurations can be found in the CCM docs here: [Cloud Provider Azure configs](https://github.com/kubernetes-sigs/cloud-provider-azure/blob/documentation/content/en/install/configs.md). + +A secret can be created in Kubernetes using the following command: + +> **NOTE**: This secret is created in the **kube-system** namespace because that is where the CCM and CSI components will be installed. + +```bash +kubectl create secret generic azure-cloud-provider --from-file=cloud-config=./cloud.conf -n kube-system +``` + +## Install the Azure Cloud Controller Manager + +Find the version compatible with the Kubernetes version installed with the Talos cluster https://github.com/kubernetes-sigs/cloud-provider-azure/blob/master/README.md + +To use the latest release add the following helm repo: + +> **NOTE**: To use a release specific to the Kubernetes version other than the latest version, replace **master** with the branch name specified in the version matrix above. + +```bash +helm repo add cloud-provider-azure https://raw.githubusercontent.com/kubernetes-sigs/cloud-provider-azure/master/helm/repo +``` + +Update helm repositories: + +```bash +helm repo update +``` + +Install the helm chart for `cloud-provider-azure`: + +```bash +helm install azure-ccm cloud-provider-azure/cloud-provider-azure \ +--set cloud-provider-azure.infra.clusterName="christian-tf" \ +--set cloud-provider-azure.cloudControllerManager.cloudConfig='' \ +--set cloud-provider-azure.cloudControllerManager.cloudConfigSecretName="azure-cloud-provider" \ +--set cloud-provider-azure.cloudControllerManager.enableDynamicReloading="true" \ +--set cloud-provider-azure.cloudControllerManager.configureCloudRoutes="true" \ +--set cloud-provider-azure.cloudControllerManager.allocateNodeCidrs="true" \ +--set cloud-provider-azure.cloudControllerManager.imageRepository="mcr.microsoft.com/oss/kubernetes" +``` + +## Install the Azure CSI Driver + +dependencies: + +- name: azuredisk-csi-driver + repository: https://raw.githubusercontent.com/kubernetes-sigs/azuredisk-csi-driver/master/charts + version: v1.27.1 + +Add the Azure CSI helm repo: + +```bash +helm repo add azuredisk-csi-driver https://raw.githubusercontent.com/kubernetes-sigs/azuredisk-csi-driver/master/charts +``` + +Update helm repositories + +```bash +helm repo update +``` + +```bash +helm install azure-csi azuredisk-csi-driver/azuredisk-csi-driver -n kube-system +``` + +Lastly, create a file for a StorageClass to use the CSI: + +```bash +vim azure-ssd-lrs.yaml +``` + +Add the following contents to the file: + +```yaml +apiVersion: storage.k8s.io/v1 +kind: StorageClass +metadata: + name: azuredisk-standard-ssd-lrs +provisioner: disk.csi.azure.com +parameters: + skuName: StandardSSD_LRS +reclaimPolicy: Delete +volumeBindingMode: Immediate +allowVolumeExpansion: true +``` + +Create the storageclass: + +```bash +kubectl apply -f azure-ssd-lrs.yaml +``` + +Persistent Volume Claims can now be created for workloads in the cluster using the StorageClass created.