|
1 | 1 | = Oxide Cloud Controller Manager |
2 | 2 |
|
3 | | -The Oxide Cloud Controller Manager is a Kubernetes control plane component |
4 | | -that contains Oxide specific controllers. This allows Kubernetes clusters |
5 | | -running on Oxide to integrate with Oxide via the |
| 3 | +The Oxide Cloud Controller Manager is a Kubernetes control plane component that |
| 4 | +embeds Oxide specific control logic, allowing Kubernetes clusters running on |
| 5 | +Oxide to integrate with the Oxide API via the |
6 | 6 | https://kubernetes.io/docs/concepts/architecture/cloud-controller/[Cloud Controller Manager] |
7 | 7 | architecture. |
8 | 8 |
|
9 | | -*This project is still a work in progress!* |
10 | | - |
11 | | -A cloud controller manager is free to run any cloud-specific |
12 | | -controllers it needs. However, generally, a cloud controller |
13 | | -manager runs the following controllers by implementing the |
| 9 | +A cloud controller manager is free to embed any cloud-specific control logic |
| 10 | +it needs. However, cloud controller manager implementations generally embed the |
| 11 | +following control logic by implementing the |
14 | 12 | https://pkg.go.dev/k8s.io/cloud-provider#Interface[`cloudprovider.Interface`]. |
15 | 13 |
|
16 | | -* *Node Controller* - Responsible for updating `Node` resources as nodes are added |
17 | | -or removed from the Kubernetes cluster. |
18 | | -* *Route Controller* - Responsible for configuring routes in the cloud provider so |
19 | | -that pods running on different nodes can communicate with one another. |
20 | | -* *Service Controller* - Responsible for configuring cloud provider infrastructure |
21 | | -such as load balancers and IP addresses when a `Service` of type `LoadBalancer` |
22 | | -is created. |
| 14 | +* *Node Controller*: Manages `Node` resources based on the information returned |
| 15 | +from the cloud provider API (e.g., labels, addresses, node health). |
| 16 | +* *Route Controller*: Configures routes in the cloud provider so pods running |
| 17 | +on different Kubernetes nodes can communicate with one another. |
| 18 | +* *Service Controller*: Ensures cloud provider infrastructure (e.g., load |
| 19 | +balancer, IP addresses) exists for a `Service` of type `LoadBalancer`. |
| 20 | +
|
| 21 | +The Oxide Cloud Controller Manager implements the following Oxide specific |
| 22 | +control logic. |
| 23 | + |
| 24 | +* Node Controller |
| 25 | +
|
| 26 | +== Usage |
| 27 | + |
| 28 | +Please note the following before using the Oxide Cloud Controller Manager. |
| 29 | + |
| 30 | +* The cloud controller manager can only manage a single Kubernetes cluster with |
| 31 | +all its nodes running in the same Oxide silo and project. This may be expanded |
| 32 | +in the future. |
| 33 | +* The `kubelet`, `kube-apiserver`, and `kube-controller-manager` must be run |
| 34 | +with `--cloud-provider=external` to configure the Kubernetes cluster to use |
| 35 | +a cloud controller manager. This process differs depending on your Kubernetes |
| 36 | +distribution of choice. |
| 37 | +* Nodes joining a Kubernetes cluster configured to use a cloud controller |
| 38 | +manager will have a taint `node.cloudprovider.kubernetes.io/uninitialized` with |
| 39 | +effect `NoSchedule`. This taint will be removed by the node controller within |
| 40 | +the cloud controller manager. |
| 41 | + |
| 42 | +With the above noted, let's run the Oxide Cloud Controller Manager in your |
| 43 | +Kubernetes cluster. |
| 44 | + |
| 45 | +Create the following `Secret` to hold the Oxide credentials. |
| 46 | + |
| 47 | +[source,yaml] |
| 48 | +---- |
| 49 | +--- |
| 50 | +apiVersion: v1 |
| 51 | +kind: Secret |
| 52 | +metadata: |
| 53 | + name: oxide-cloud-controller-manager |
| 54 | + namespace: kube-system |
| 55 | +type: Opaque |
| 56 | +stringData: |
| 57 | + oxide-host: "https://oxide.sys.example.com" |
| 58 | + oxide-token: "oxide-token-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" |
| 59 | + oxide-project: "example" |
| 60 | +---- |
| 61 | + |
| 62 | +Apply the |
| 63 | +link:manifests/oxide-cloud-controller-manager.yaml[oxide-cloud-controller-manager.yaml] Kubernetes manifest. |
| 64 | + |
| 65 | +[source,shell] |
| 66 | +---- |
| 67 | +kubectl apply -f oxide-cloud-controller-manager.yaml |
| 68 | +---- |
| 69 | + |
| 70 | +== Development |
| 71 | + |
| 72 | +The `Makefile` is the primary method of interfacing with this project. Refer to |
| 73 | +its targets for more information. The build artifact is a container image to be |
| 74 | +run either inside or outside the Kubernetes cluster it’s meant to manage. |
| 75 | + |
| 76 | +=== Running Locally |
| 77 | + |
| 78 | +Build the container image. |
| 79 | + |
| 80 | +[source,shell] |
| 81 | +---- |
| 82 | +make build |
| 83 | +---- |
| 84 | + |
| 85 | +Determine if you want to run the cloud controller manager inside or outside the |
| 86 | +Kubernetes cluster it's meant to manage. |
| 87 | + |
| 88 | +To run the cloud controller manager inside the Kubernetes cluster, refer to |
| 89 | +link:_usage[Usage]. |
23 | 90 |
|
24 | | -The Oxide Cloud Controller Manager only implements the following controllers. |
| 91 | +To run the cloud controller manager outside the Kubernetes cluster, run the |
| 92 | +container image with a kubeconfig for the cluster you want to manage. |
25 | 93 |
|
26 | | -* Node Controller (via https://pkg.go.dev/k8s.io/cloud-provider#InstancesV2[`cloudprovider.InstancesV2`]) |
| 94 | +[source,shell] |
| 95 | +---- |
| 96 | +podman run \ |
| 97 | + --env OXIDE_HOST \ |
| 98 | + --env OXIDE_TOKEN \ |
| 99 | + --env OXIDE_PROJECT \ |
| 100 | + --volume ./kubeconfig.yaml:/tmp/kubeconfig.yaml:ro \ |
| 101 | + ghcr.io/oxidecomputer/oxide-cloud-controller-manager:TAG \ |
| 102 | + --cloud-provider oxide \ |
| 103 | + --kubeconfig /tmp/kubeconfig.yaml |
| 104 | +---- |
0 commit comments