Skip to content

Commit

Permalink
Merge pull request #697 from dmvolod/simplify-configmap-configuration
Browse files Browse the repository at this point in the history
📖 Simplifying ConfigMap with metadata configuration
  • Loading branch information
k8s-ci-robot authored Jan 29, 2025
2 parents 507fc88 + d75be1c commit a0d39e2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -167,28 +167,22 @@ For example, you have two files: `components.yaml` and `metadata.yaml`. To creat
gzip -c components.yaml > components.gz
```

2. Create a ConfigMap manifest from the archived data:
2. Create a ConfigMap in your Kubernetes cluster from the archived data:

```sh
kubectl create configmap v1.9.3 --namespace=capz-system --from-file=components=components.gz --from-file=metadata=metadata.yaml --dry-run=client -o yaml > configmap.yaml
kubectl create configmap v1.9.3 -n capz-system --from-file=components=components.gz --from-file=metadata=metadata.yaml
```

3. Edit the file by adding "provider.cluster.x-k8s.io/compressed: true" annotation:
3. Add "provider.cluster.x-k8s.io/compressed: true" annotation to the ConfigMap:

```sh
yq eval -i '.metadata.annotations += {"provider.cluster.x-k8s.io/compressed": "true"}' configmap.yaml
kubectl annotate configmap v1.9.3 -n capz-system provider.cluster.x-k8s.io/compressed=true
```

**Note**: Without this annotation, the operator won't be able to determine if the data is compressed or not.

4. Add labels that will be used to match the ConfigMap in the `fetchConfig` section of the provider:

```sh
yq eval -i '.metadata.labels += {"my-label": "label-value"}' configmap.yaml
```

5. Create the ConfigMap in your Kubernetes cluster using kubectl:

```sh
kubectl create -f configmap.yaml
kubectl label configmap v1.9.3 -n capz-system provider-components=azure
```
2 changes: 1 addition & 1 deletion docs/local-development.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ kind create cluster
```

## Run Tilt
Once the cluster is live and you've confirmed you're using the correct context, you can simply run:
Once the cluster is live, and you've confirmed you're using the correct context, you can simply run:
```bash
tilt up
```
Expand Down

0 comments on commit a0d39e2

Please sign in to comment.