You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/book/src/development/development.md
+96-1Lines changed: 96 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -50,9 +50,104 @@ make docker-build docker-push
50
50
51
51
After generating `infrastructure-components.yaml`, replace the `us.gcr.io/k8s-artifacts-prod/capi-openstack/capi-openstack-controller:v0.3.4` with your image.
52
52
53
+
## Testing Cluster Creation using the 'dev-test' ClusterClass with Tilt
54
+
55
+
This guide demonstrates how to create a Kubernetes cluster using ClusterClass, specifically designed for a development environment. It includes initializing a Kind cluster, configuring secrets, and applying ClusterClass to deploy your cluster with Tilt.
56
+
57
+
### Creating a Kind Cluster
58
+
59
+
Create a Kind cluster. This process involves the initialization of Cluster API providers for OpenStack.
60
+
61
+
```bash
62
+
kind create cluster
63
+
export CLUSTER_TOPOLOGY=true
64
+
clusterctl init --infrastructure openstack
65
+
```
66
+
67
+
### Secret Configuration
68
+
69
+
CAPO needs a clouds.yaml file in order to manage the OpenStack resources needed for the Cluster. This should be supplied as a secret named `${CLUSTER_NAME}-cloud-config`. You can create this secret for example with:
You can also make Tilt create it for you when you run `tilt up`, more on that in the next section.
76
+
53
77
## Developing with Tilt
54
78
55
-
We have support for using [Tilt](https://tilt.dev/) for rapid iterative development. Please visit the [Cluster API documentation on Tilt](https://cluster-api.sigs.k8s.io/developer/tilt.html) for information on how to set up your development environment.
79
+
We have support for using [Tilt](https://tilt.dev/) for rapid iterative development. Please visit the [Cluster API documentation on Tilt](https://cluster-api.sigs.k8s.io/developer/tilt.html) for information on how to set up your development environment.
80
+
81
+
Default values align with the devstack setup, as documented below. When specifying the `KUBERNETES_VERSION`, ensure an image named `ubuntu-2204-kube-{{ KUBERNETES_VERSION }}` is available in your environment, corresponding to that Kubernetes version.
82
+
For using Tilt with ClusterClass, update your `tilt-settings.yaml` file as described:
83
+
84
+
```yaml
85
+
kustomize_substitutions:
86
+
CLUSTER_TOPOLOGY: "true"
87
+
# Define the name of your cluster (e.g., "dev-test")
88
+
CLUSTER_NAME: "<cluster_name>"
89
+
# Desired Kubernetes Version for Your Cluster (e.g., "v1.28.5")
90
+
KUBERNETES_VERSION: "<kubernetes_version>"
91
+
# [Optional] SSH Keypair Name for Instances in OpenStack (Default: "")
Ensure the specified path (`/path/to/kustomize/secret/configuration`) contains both the `clouds.yaml` file and a `kustomization.yaml` file. The `kustomization.yaml` should define the necessary resources, such as a Kubernetes secret, using the `clouds.yaml` file.
105
+
106
+
For example, if you want to automatically create a secret named `dev-test-cloud-config` with the content of your `clouds.yaml` every time you do `tilt up`, you could do the following.
107
+
108
+
Create a folder to hold the kustomization.
109
+
We will use `/tmp/capo-dev` as example here.
110
+
111
+
Add the `clouds.yaml` file that you want to use to the folder.
112
+
It could look something like this:
113
+
114
+
```yaml
115
+
clouds:
116
+
capo-e2e:
117
+
auth:
118
+
username: demo
119
+
password: secretadmin
120
+
# If using application credentials you would have something like this instead:
121
+
# auth_type: v3applicationcredential
122
+
# application_credential_id: abc123
123
+
# application_credential_secret: 456def
124
+
user_domain_id: default
125
+
auth_url: https://example.com/identity
126
+
domain_id: default
127
+
project_name: demo
128
+
verify: false
129
+
region_name: RegionOne
130
+
```
131
+
132
+
Create a kustomization file named `kustomization.yaml` in the same folder:
133
+
134
+
```yaml
135
+
apiVersion: kustomize.config.k8s.io/v1beta1
136
+
kind: Kustomization
137
+
# Do not add random hash to the end of the secret name
138
+
generatorOptions:
139
+
disableNameSuffixHash: true
140
+
secretGenerator:
141
+
- files:
142
+
- clouds.yaml
143
+
name: dev-test-cloud-config
144
+
type: Opaque
145
+
```
146
+
147
+
If you now add `/tmp/capo-dev` to the `additional_kustomizations`, tilt will automatically apply
148
+
the secret when you do `tilt up`.
149
+
150
+
To check that the kustomization produces the desired output, do `kustomize build /tmp/capo-dev`.
0 commit comments