Skip to content

feat: Combine generic variables with provider specific variables #173

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Sep 25, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions docs/content/audit-policy.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ title: "Audit policy"

Kubernetes auditing provides a security-relevant, chronological set of records documenting the sequence of actions in a
cluster. The cluster audits the activities generated by users, by applications that use the Kubernetes API, and by the
control plane itself. The `auditpolicypatch` external patch will generate appropriate configuration for the Kubernetes
control plane itself. The `clusterconfigpatch` external patch will generate appropriate configuration for the Kubernetes
control plane.

To enable the audit policy enable the `auditpolicypatch` external patch on `ClusterClass`.
To enable the meta handler enable the `clusterconfigvars` and `clusterconfigpatch` external patches on `ClusterClass`.

```yaml
apiVersion: cluster.x-k8s.io/v1beta1
Expand All @@ -16,9 +16,9 @@ metadata:
name: <NAME>
spec:
patches:
- name: audit-policy
- name: cluster-config
external:
generateExtension: "auditpolicypatch.capi-runtime-extensions"
generateExtension: "clusterconfigpatch.capi-runtime-extensions"
```

Applying this configuration will result in new bootstrap files on the `KubeadmControlPlaneTemplate`.
3 changes: 1 addition & 2 deletions docs/content/calico-cni.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ The hook creates two `ClusterResourceSets`: one to deploy the Tigera Operator, a
Calico via the Tigera `Installation` CRD. The Tigera Operator CRS is shared between all clusters in the operator,
whereas the Calico installation CRS is unique per cluster.

To enable the meta handler enable the `clusterconfigvars` and `clusterconfigpatch`
external patches on `ClusterClass`.
To enable the meta handler enable the `clusterconfigvars` and `clusterconfigpatch` external patches on `ClusterClass`.

```yaml
apiVersion: cluster.x-k8s.io/v1beta1
Expand Down
3 changes: 1 addition & 2 deletions docs/content/cluster-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ ClusterClasses, allowing for a single configuration variable with nested values.
with the least configuration. The included patches are usable individually, but require declaring all the individual
patch and variable handlers in the ClusterClass.

To enable the meta handler enable the `clusterconfigvars` and `clusterconfigpatch`
external patches on `ClusterClass`.
To enable the meta handler enable the `clusterconfigvars` and `clusterconfigpatch` external patches on `ClusterClass`.

```yaml
apiVersion: cluster.x-k8s.io/v1beta1
Expand Down
19 changes: 10 additions & 9 deletions docs/content/etcd.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ title: "etcd"

Override the container image repository and tag for [etcd](https://github.com/etcd-io/etcd).

To enable this handler set the `etcdpatch` and `etcdvars` external patches on `ClusterClass`.
To enable the meta handler enable the `clusterconfigvars` and `clusterconfigpatch` external patches on `ClusterClass`.

```yaml
apiVersion: cluster.x-k8s.io/v1beta1
Expand All @@ -13,10 +13,10 @@ metadata:
name: <NAME>
spec:
patches:
- name: image-registry
- name: cluster-config
external:
generateExtension: "etcdpatch.capi-runtime-extensions"
discoverVariablesExtension: "etcdvars.capi-runtime-extensions"
generateExtension: "clusterconfigpatch.capi-runtime-extensions"
discoverVariablesExtension: "clusterconfigvars.capi-runtime-extensions"
```

On the cluster resource then specify desired etcd image repository and/or image tag values:
Expand All @@ -29,11 +29,12 @@ metadata:
spec:
topology:
variables:
- name: etcd
values:
image:
repository: my-registry.io/my-org/my-repo
tag: "v3.5.99_custom.0"
- name: clusterConfig
value:
etcd:
image:
repository: my-registry.io/my-org/my-repo
tag: "v3.5.99_custom.0"
```

Applying this configuration will result in the following value being set:
Expand Down
16 changes: 8 additions & 8 deletions docs/content/extra-apiserver-cert-sans.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ title: "Extra API Server Certificate SANs"
If the API server can be accessed by alternative DNS addresses then setting additional SANs on the API server
certificate is necessary in order for clients to successfully validate the API server certificate.

To enable the API server certificate SANs enable the `extraapiservercertsansvars` and `extraapiservercertsanspatch`
external patches on `ClusterClass`.
To enable the meta handler enable the `clusterconfigvars` and `clusterconfigpatch` external patches on `ClusterClass`.

```yaml
apiVersion: cluster.x-k8s.io/v1beta1
Expand All @@ -15,10 +14,10 @@ metadata:
name: <NAME>
spec:
patches:
- name: apiserver-cert-sans
- name: cluster-config
external:
generateExtension: "extraapiservercertsanspatch.capi-runtime-extensions"
discoverVariablesExtension: "extraapiservercertsansvars.capi-runtime-extensions"
generateExtension: "clusterconfigpatch.capi-runtime-extensions"
discoverVariablesExtension: "clusterconfigvars.capi-runtime-extensions"
```

On the cluster resource then specify desired certificate SANs values:
Expand All @@ -31,10 +30,11 @@ metadata:
spec:
topology:
variables:
- name: extraAPIServerCertSANs
- name: clusterConfig
value:
- a.b.c.example.com
- d.e.f.example.com
extraAPIServerCertSANs:
- a.b.c.example.com
- d.e.f.example.com
```

Applying this configuration will result in the certificate SANs being correctly set in the
Expand Down
21 changes: 11 additions & 10 deletions docs/content/http-proxy.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ In some network environments it is necessary to use HTTP proxy to successfuly ex
To configure Kubernetes components (`containerd`, `kubelet`) to use HTTP proxy use the `httpproxypatch`
external patch that will generate appropriate configuration for control plane and worker nodes.

To enable the http proxy enable the `httpproxypatch` external patch on `ClusterClass`.
To enable the meta handler enable the `clusterconfigvars` and `clusterconfigpatch` external patches on `ClusterClass`.

```yaml
apiVersion: cluster.x-k8s.io/v1beta1
Expand All @@ -15,10 +15,10 @@ metadata:
name: <NAME>
spec:
patches:
- name: http-proxy
- name: cluster-config
external:
generateExtension: "httpproxypatch.capi-runtime-extensions"
discoverVariablesExtension: "httpproxyvars.capi-runtime-extensions"
generateExtension: "clusterconfigpatch.capi-runtime-extensions"
discoverVariablesExtension: "clusterconfigvars.capi-runtime-extensions"
```

On the cluster resource then specify desired HTTP proxy values:
Expand All @@ -31,13 +31,14 @@ metadata:
spec:
topology:
variables:
- name: proxy
- name: clusterConfig
value:
http: http://example.com
https: http://example.com
additionalNo:
- no-proxy-1.example.com
- no-proxy-2.example.com
proxy:
http: http://example.com
https: https://example.com
additionalNo:
- no-proxy-1.example.com
- no-proxy-2.example.com
```

The `additionalNo` list will be added to default pre-calculated values that apply on k8s networking
Expand Down
16 changes: 8 additions & 8 deletions docs/content/kubernetes-image-repository.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ title: "Kubernete Image Repository"

Override the container image repository used when pulling Kubernetes images.

To enable this handler set the `imagerepositorypatch` and `imagerepositoryvars` external patches on `ClusterClass`.
To enable the meta handler enable the `clusterconfigvars` and `clusterconfigpatch` external patches on `ClusterClass`.

```yaml
apiVersion: cluster.x-k8s.io/v1beta1
Expand All @@ -13,10 +13,10 @@ metadata:
name: <NAME>
spec:
patches:
- name: image-repository
- name: cluster-config
external:
generateExtension: "imagerepositorypatch.capi-runtime-extensions"
discoverVariablesExtension: "imagerepositoryvars.capi-runtime-extensions"
generateExtension: "clusterconfigpatch.capi-runtime-extensions"
discoverVariablesExtension: "clusterconfigvars.capi-runtime-extensions"
```

On the cluster resource then specify desired Kubernetes image repository value:
Expand All @@ -27,10 +27,10 @@ kind: Cluster
metadata:
name: <NAME>
spec:
topology:
variables:
- name: kubernetesImageRepository
value: "my-registry.io/my-org/my-repo"
variables:
- name: clusterConfig
value:
imageRepository: my-registry.io/my-org/my-repo
```

Applying this configuration will result in the following value being set:
Expand Down