|
| 1 | +# Install |
| 2 | + |
| 3 | +Proxmox Cloud Controller Manager (CCM) supports controllers: |
| 4 | +* cloud-node |
| 5 | +* cloud-node-lifecycle |
| 6 | + |
| 7 | +`cloud-node` - detects new node launched in the cluster and registers them in the cluster. |
| 8 | +Assigns labels and taints based on Proxmox VM configuration. |
| 9 | + |
| 10 | +`cloud-node-lifecycle` - detects node deletion on Proxmox side and removes them from the cluster. |
| 11 | + |
| 12 | +## Create a Proxmox token |
| 13 | + |
| 14 | +Official [documentation](https://pve.proxmox.com/wiki/User_Management) |
| 15 | + |
| 16 | +```shell |
| 17 | +# Create role CCM |
| 18 | +pveum role add CCM -privs "VM.Audit" |
| 19 | +# Create user and grant permissions |
| 20 | +pveum user add kubernetes@pve |
| 21 | +pveum aclmod / -user kubernetes@pve -role CCM |
| 22 | +pveum user token add kubernetes@pve ccm -privsep 0 |
| 23 | +``` |
| 24 | + |
| 25 | +## Deploy CCM |
| 26 | + |
| 27 | +Create the proxmox credentials config file: |
| 28 | + |
| 29 | +```yaml |
| 30 | +clusters: |
| 31 | + # List of Proxmox clusters, region mast be unique |
| 32 | + - url: https://cluster-api-1.exmple.com:8006/api2/json |
| 33 | + insecure: false |
| 34 | + token_id: "kubernetes@pve!ccm" |
| 35 | + # Token from the previous step |
| 36 | + token_secret: "secret" |
| 37 | + # Region name, can be any string, it will use as for kubernetes topology.kubernetes.io/region label |
| 38 | + region: cluster-1 |
| 39 | +``` |
| 40 | +
|
| 41 | +### Method 1: kubectl |
| 42 | +
|
| 43 | +Upload it to the kubernetes: |
| 44 | +
|
| 45 | +```shell |
| 46 | +kubectl -n kube-system create secret generic proxmox-cloud-controller-manager --from-file=config.yaml |
| 47 | +``` |
| 48 | + |
| 49 | +Deploy Proxmox CCM with `cloud-node,cloud-node-lifecycle` controllers |
| 50 | + |
| 51 | +```shell |
| 52 | +kubectl apply -f https://raw.githubusercontent.com/sergelogvinov/proxmox-cloud-controller-manager/main/docs/deploy/cloud-controller-manager.yml |
| 53 | +``` |
| 54 | + |
| 55 | +Deploy Proxmox CCM with `cloud-node-lifecycle` controller (for Talos) |
| 56 | + |
| 57 | +```shell |
| 58 | +kubectl apply -f https://raw.githubusercontent.com/sergelogvinov/proxmox-cloud-controller-manager/main/docs/deploy/cloud-controller-manager-talos.yml |
| 59 | +``` |
| 60 | + |
| 61 | +### Method 2: helm chart |
| 62 | + |
| 63 | +Create the config file |
| 64 | + |
| 65 | +```yaml |
| 66 | +# proxmox-ccm.yaml |
| 67 | +config: |
| 68 | + clusters: |
| 69 | + - url: https://cluster-api-1.exmple.com:8006/api2/json |
| 70 | + insecure: false |
| 71 | + token_id: "kubernetes@pve!ccm" |
| 72 | + token_secret: "secret" |
| 73 | + region: cluster-1 |
| 74 | +``` |
| 75 | +
|
| 76 | +Deploy Proxmox CCM (deployment mode) |
| 77 | +
|
| 78 | +```shell |
| 79 | +helm upgrade -i --namespace=kube-system -f proxmox-ccm.yaml \ |
| 80 | + proxmox-cloud-controller-manager \ |
| 81 | + oci://ghcr.io/sergelogvinov/charts/proxmox-cloud-controller-manager |
| 82 | +``` |
| 83 | + |
| 84 | +Deploy Proxmox CCM (daemonset mode) |
| 85 | + |
| 86 | +It makes sense to deploy on all control-plane nodes. Do not forget to set the nodeSelector. |
| 87 | + |
| 88 | +```shell |
| 89 | +helm upgrade -i --namespace=kube-system -f proxmox-ccm.yaml \ |
| 90 | + --set useDaemonSet=true \ |
| 91 | + proxmox-cloud-controller-manager \ |
| 92 | + oci://ghcr.io/sergelogvinov/charts/proxmox-cloud-controller-manager |
| 93 | +``` |
| 94 | + |
| 95 | +More options you can find [here](charts/proxmox-cloud-controller-manager) |
| 96 | + |
| 97 | +## Deploy CCM (Rancher) |
| 98 | + |
| 99 | +Official [documentation](https://ranchermanager.docs.rancher.com/how-to-guides/new-user-guides/kubernetes-clusters-in-rancher-setup/node-requirements-for-rancher-managed-clusters) |
| 100 | + |
| 101 | +Rancher RKE2 configuration: |
| 102 | + |
| 103 | +```yaml |
| 104 | +machineGlobalConfig: |
| 105 | + # Kubelet predefined value --cloud-provider=external |
| 106 | + cloud-provider-name: external |
| 107 | + # Disable Rancher CCM |
| 108 | + disable-cloud-controller: true |
| 109 | +``` |
| 110 | +
|
| 111 | +Create the helm values file: |
| 112 | +
|
| 113 | +```yaml |
| 114 | +# proxmox-ccm.yaml |
| 115 | +config: |
| 116 | + clusters: |
| 117 | + - url: https://cluster-api-1.exmple.com:8006/api2/json |
| 118 | + insecure: false |
| 119 | + token_id: "kubernetes@pve!ccm" |
| 120 | + token_secret: "secret" |
| 121 | + region: cluster-1 |
| 122 | + |
| 123 | +# Use host resolv.conf to resolve proxmox connection url |
| 124 | +useDaemonSet: true |
| 125 | + |
| 126 | +# Set nodeSelector in daemonset mode is required |
| 127 | +nodeSelector: |
| 128 | + node-role.kubernetes.io/control-plane: "" |
| 129 | +``` |
| 130 | +
|
| 131 | +Deploy Proxmox CCM (daemondset mode) |
| 132 | +
|
| 133 | +```shell |
| 134 | +helm upgrade -i --namespace=kube-system -f proxmox-ccm.yaml \ |
| 135 | + proxmox-cloud-controller-manager \ |
| 136 | + oci://ghcr.io/sergelogvinov/charts/proxmox-cloud-controller-manager |
| 137 | +``` |
| 138 | + |
| 139 | +## Deploy CCM with load balancer (optional) |
| 140 | + |
| 141 | +This optional setup to improve the Proxmox API availability. |
| 142 | + |
| 143 | +See [load balancer](loadbalancer.md) for installation instructions. |
0 commit comments