Skip to content

Commit 95b02fd

Browse files
authored
feat: document the cloud controller manager (#144)
Added documentation to the project for users and developers.
1 parent 5424a87 commit 95b02fd

File tree

2 files changed

+95
-29
lines changed

2 files changed

+95
-29
lines changed

README.adoc

Lines changed: 95 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,104 @@
11
= Oxide Cloud Controller Manager
22

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
66
https://kubernetes.io/docs/concepts/architecture/cloud-controller/[Cloud Controller Manager]
77
architecture.
88

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
1412
https://pkg.go.dev/k8s.io/cloud-provider#Interface[`cloudprovider.Interface`].
1513

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].
2390

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.
2593

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+
----

manifests/oxide-cloud-controller-manager.yaml

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,4 @@
11
---
2-
apiVersion: v1
3-
kind: Secret
4-
metadata:
5-
name: oxide-cloud-controller-manager
6-
namespace: kube-system
7-
type: Opaque
8-
stringData:
9-
oxide-host: ""
10-
oxide-token: ""
11-
oxide-project: ""
12-
---
132
apiVersion: apps/v1
143
kind: Deployment
154
metadata:
@@ -43,7 +32,6 @@ spec:
4332
command:
4433
- "/usr/bin/oxide-cloud-controller-manager"
4534
- "--cloud-provider=oxide"
46-
- "--allow-untagged-cloud=true" # TODO: Remove.
4735
resources:
4836
requests:
4937
cpu: 100m

0 commit comments

Comments
 (0)