Skip to content

Commit bf4700b

Browse files
authored
Merge branch 'main' into feat/update_versions
Signed-off-by: Kurt Garloff <[email protected]>
2 parents af2810f + 46b6e40 commit bf4700b

File tree

63 files changed

+3272
-86
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+3272
-86
lines changed

docs/providers/openstack/configuration.md

Lines changed: 63 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,68 @@
1+
# Configuration
2+
3+
This page lists the custom configuration options available, including their default values and if they are optional. The following example shows how these variables can be used inside the `cluster.yaml` file under `spec.topology.variables`.
4+
5+
## Example
6+
7+
```yaml
8+
apiVersion: cluster.x-k8s.io/v1beta1
9+
kind: Cluster
10+
metadata:
11+
name:
12+
namespace:
13+
labels:
14+
managed-secret: cloud-config
15+
spec:
16+
clusterNetwork:
17+
pods:
18+
cidrBlocks:
19+
- 192.168.0.0/16
20+
serviceDomain: cluster.local
21+
services:
22+
cidrBlocks:
23+
- 10.96.0.0/12
24+
topology:
25+
variables: // <-- variables from the table can be set here
26+
- name: controller_flavor
27+
value: "SCS-4V-8-20"
28+
- name: worker_flavor
29+
value: "SCS-4V-8-20"
30+
- name: external_id
31+
value: "ebfe5546-f09f-4f42-ab54-094e457d42ec"
32+
class: openstack-alpha-1-29-v2
33+
controlPlane:
34+
replicas: 2
35+
version: v1.29.3
36+
workers:
37+
machineDeployments:
38+
- class: openstack-alpha-1-29-v2
39+
failureDomain: nova
40+
name: openstack-alpha-1-29-v2
41+
replicas: 4
42+
```
43+
44+
Variables from the table containing a `.` are to be used in an object with the part before the dot being the object name and the part behind the dot being the value names. The following example demonstrates this with `oidc_config`.
45+
46+
```yaml
47+
...
48+
topology:
49+
variables:
50+
- name: oidc_config
51+
value:
52+
issuer_url: "https://dex.k8s.scs.community"
53+
client_id: "kubectl"
54+
...
55+
```
56+
57+
## Available variables
58+
159
|Name|Type|Default|Example|Description|Required|
260
|----|----|-------|-------|-----------|--------|
361
|`external_id`|string|""|"ebfe5546-f09f-4f42-ab54-094e457d42ec"|ExternalNetworkID is the ID of an external OpenStack Network. This is necessary to get public internet to the VMs.|False|
4-
|`controller_flavor`|string|"SCS-2V-4-20"|"SCS-2V-4-20"|OpenStack instance flavor for control-plane nodes.|False|
5-
|`worker_flavor`|string|"SCS-2V-4-20"|"SCS-2V-4-20"|OpenStack instance flavor for worker nodes.|False|
6-
|`controller_root_disk`|integer||20|Root disk size in GiB for control-plane nodes. OpenStack volume will be created and used instead of an ephemeral disk defined in flavor. Should be used also for the diskless flavors.|False|
7-
|`worker_root_disk`|integer||20|Root disk size in GiB for worker nodes. OpenStack volume will be created and used instead of an ephemeral disk defined in flavor. Should be used also for the diskless flavors.|False|
62+
|`controller_flavor`|string|"SCS-2V-4-20s"|"SCS-2V-4-20s"|OpenStack instance flavor for control-plane nodes.|False|
63+
|`worker_flavor`|string|"SCS-2V-4"|"SCS-2V-4"|OpenStack instance flavor for worker nodes.|False|
64+
|`controller_root_disk`|integer||25|Root disk size in GiB for control-plane nodes. OpenStack volume will be created and used instead of an ephemeral disk defined in flavor. Should only be used for the diskless flavors.|False|
65+
|`worker_root_disk`|integer|25|25|Root disk size in GiB for worker nodes. OpenStack volume will be created and used instead of an ephemeral disk defined in flavor. Should be used for the diskless flavors.|False|
866
|`yawol_flavor_id`|string|""|"0a79590e-10d7-4c2c-8f69-ca0a2c6208d2"|ID of the existing flavor used as a default yawol flavor.|False|
967
|`yawol_image_id`|string|""|"f0b2ef46-f0ff-43d2-9c08-f58a5a6e9060"|ID of the existing imaged used as a default yawol image.|False|
1068
|`kube_vip_network_id`|string|""|"40a51f6c-9e4b-4b24-9187-49851a410c97"|ID of the existing network. The network should have one subnet with one port reserved as virtual IP.|False|
@@ -29,4 +87,4 @@
2987
|`oidc_config.groups_prefix`|string|oidc:|oidc:|Prefix prepended to group claims to prevent clashes wit h existing names (such as system: groups). For example, the value oidc: will cre ate group names like oidc:engineering and oidc:infra.||
3088
|`network_mtu`|integer||1500|NetworkMTU sets the maximum transmission unit (MTU) value to address fragmentation for the private network ID.|False|
3189
|`controlPlaneAvailabilityZones`|array||['nova']|ControlPlaneAvailabilityZones is the set of availability zones which control plane machines may be deployed to.|False|
32-
|`controlPlaneOmitAvailabilityZone`|boolean||True|ControlPlaneOmitAvailabilityZone causes availability zone to be omitted when creating control plane nodes, allowing the Nova scheduler to make a decision on which availability zone to use based on other scheduling constraints.|False|
90+
|`controlPlaneOmitAvailabilityZone`|boolean||True|ControlPlaneOmitAvailabilityZone causes availability zone to be omitted when creating control plane nodes, allowing the Nova scheduler to make a decision on which availability zone to use based on other scheduling constraints.|False|

docs/providers/openstack/quickstart.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ Install the [envsubst](https://github.com/drone/envsubst) Go package. It is requ
5555
```bash
5656
GOBIN=/tmp go install github.com/drone/envsubst/v2/cmd/envsubst@latest
5757
```
58+
Note: On typical Linux distros, you will have a binary `/usr/bin/envsubst` from the gettext package that does *not* work.
5859

5960
Get the latest CSO release version and apply CSO manifests to the management cluster.
6061

@@ -176,7 +177,7 @@ export CS_POD_CIDR=192.168.0.0/16
176177
export CS_SERVICE_CIDR=10.96.0.0/12
177178
export CS_EXTERNAL_ID=ebfe5546-f09f-4f42-ab54-094e457d42ec # gx-scs
178179
export CS_CLASS_NAME=openstack-"${CS_NAME}"-"${CS_K8S_VERSION/./-}"-"${CS_VERSION}"
179-
export CS_K8S_PATCH_VERSION=8
180+
export CS_K8S_PATCH_VERSION=6
180181
```
181182

182183
Create and apply `cluster.yaml` file to the management cluster.
@@ -205,9 +206,11 @@ spec:
205206
topology:
206207
variables:
207208
- name: controller_flavor
208-
value: "SCS-2V-4-50"
209+
value: "SCS-2V-4-20s"
209210
- name: worker_flavor
210-
value: "SCS-2V-4-50"
211+
value: "SCS-2V-4"
212+
- name: worker_root_disk
213+
value: 30
211214
- name: external_id
212215
value: ${CS_EXTERNAL_ID}
213216
class: ${CS_CLASS_NAME}

hack/config-template.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# Configuration
2+
3+
This page lists the custom configuration options available, including their default values and if they are optional. The following example shows how these variables can be used inside the `cluster.yaml` file under `spec.topology.variables`.
4+
5+
## Example
6+
7+
```yaml
8+
apiVersion: cluster.x-k8s.io/v1beta1
9+
kind: Cluster
10+
metadata:
11+
name:
12+
namespace:
13+
labels:
14+
managed-secret: cloud-config
15+
spec:
16+
clusterNetwork:
17+
pods:
18+
cidrBlocks:
19+
- 192.168.0.0/16
20+
serviceDomain: cluster.local
21+
services:
22+
cidrBlocks:
23+
- 10.96.0.0/12
24+
topology:
25+
variables: // <-- variables from the table can be set here
26+
- name: controller_flavor
27+
value: "SCS-4V-8-20"
28+
- name: worker_flavor
29+
value: "SCS-4V-8-20"
30+
- name: external_id
31+
value: "ebfe5546-f09f-4f42-ab54-094e457d42ec"
32+
class: openstack-alpha-1-29-v2
33+
controlPlane:
34+
replicas: 2
35+
version: v1.29.3
36+
workers:
37+
machineDeployments:
38+
- class: openstack-alpha-1-29-v2
39+
failureDomain: nova
40+
name: openstack-alpha-1-29-v2
41+
replicas: 4
42+
```
43+
44+
Variables from the table containing a `.` are to be used in an object with the part before the dot being the object name and the part behind the dot being the value names. The following example demonstrates this with `oidc_config`.
45+
46+
```yaml
47+
...
48+
topology:
49+
variables:
50+
- name: oidc_config
51+
value:
52+
issuer_url: "https://dex.k8s.scs.community"
53+
client_id: "kubectl"
54+
...
55+
```
56+
57+
## Available variables
58+
59+
!!table!!

hack/docugen.py

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,17 @@
88
generates a markdown table for documentation purposes.
99
"""
1010

11-
11+
import argparse
1212
import subprocess
1313
from pathlib import Path
14+
import sys
1415

1516
import yaml
1617

1718
BASE_PATH = Path(__file__).parent.parent
18-
TEMPLATE_PATH = BASE_PATH.joinpath(
19-
"providers", "openstack", "scs", "cluster-class"
20-
)
19+
TEMPLATE_PATH = BASE_PATH.joinpath("providers", "openstack", "scs", "cluster-class")
20+
DOCS_TMPL_PATH = BASE_PATH.joinpath("hack", "config-template.md")
21+
DOCS_OUT_PATH = BASE_PATH.joinpath("docs", "providers", "openstack", "configuration.md")
2122

2223

2324
def generate_row(content: list):
@@ -100,6 +101,13 @@ def parse_object(tmpl: dict) -> list:
100101

101102

102103
if __name__ == "__main__":
104+
parser = argparse.ArgumentParser()
105+
parser.add_argument(
106+
"--dry-run", action="store_true", help="Only print result to stdout."
107+
)
108+
109+
args = parser.parse_args()
110+
103111
cmd = [
104112
"helm",
105113
"template",
@@ -109,6 +117,9 @@ def parse_object(tmpl: dict) -> list:
109117
"templates/cluster-class.yaml",
110118
]
111119

120+
with open(DOCS_TMPL_PATH, "r") as f:
121+
tmpl = f.read()
122+
112123
cmdout = subprocess.run(cmd, capture_output=True, check=False)
113124
rendered_template = cmdout.stdout.decode("utf-8")
114125

@@ -127,4 +138,12 @@ def parse_object(tmpl: dict) -> list:
127138
parsed = parse_variable(var)
128139
result_table.append(generate_row(parsed))
129140

130-
print("\n".join(result_table))
141+
output = tmpl.replace("!!table!!", "\n".join(result_table))
142+
143+
if args.dry_run:
144+
print(output)
145+
sys.exit()
146+
147+
print(f"Writing output to file {DOCS_OUT_PATH}")
148+
with open(DOCS_OUT_PATH, "w") as f:
149+
f.write(output)
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
values: |
2+
metrics-server:
3+
commonLabels:
4+
domain: "{{ .Cluster.spec.controlPlaneEndpoint.host }}"
5+
clusterAddonVersion: "v1"
6+
{{- range .Cluster.spec.topology.variables }}
7+
{{- if and (eq .name "rook_ceph_values") .value }}
8+
rook-ceph:{{ .value | nindent 4 }}
9+
{{- else if and (eq .name "rook_ceph_cluster_values") .value }}
10+
rook-ceph-cluster:{{ .value | nindent 4 }}
11+
{{- end }}
12+
{{- end }}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Patterns to ignore when building packages.
2+
# This supports shell glob matching, relative path matching, and
3+
# negation (prefixed with !). Only one pattern per line.
4+
.DS_Store
5+
# Common VCS dirs
6+
.git/
7+
.gitignore
8+
.bzr/
9+
.bzrignore
10+
.hg/
11+
.hgignore
12+
.svn/
13+
# Common backup files
14+
*.swp
15+
*.bak
16+
*.tmp
17+
*.orig
18+
*~
19+
# Various IDEs
20+
.project
21+
.idea/
22+
*.tmproj
23+
.vscode/
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
dependencies:
2+
- name: metrics-server
3+
repository: https://kubernetes-sigs.github.io/metrics-server/
4+
version: 3.12.1
5+
- name: cilium
6+
repository: https://helm.cilium.io/
7+
version: 1.15.7
8+
- name: hcloud-cloud-controller-manager
9+
repository: https://charts.hetzner.cloud
10+
version: 1.20.0
11+
- name: rook-ceph
12+
repository: https://charts.rook.io/release
13+
version: v1.14.9
14+
- name: rook-ceph-cluster
15+
repository: https://charts.rook.io/release
16+
version: v1.14.9
17+
digest: sha256:225dd45233da2ae9fe8c52f1908167ffab3e7ca6df86996e21a5abe233756711
18+
generated: "2024-08-08T15:38:15.791040283+02:00"
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
apiVersion: v2
2+
dependencies:
3+
- alias: metrics-server
4+
name: metrics-server
5+
repository: https://kubernetes-sigs.github.io/metrics-server/
6+
version: 3.12.1
7+
- alias: cilium
8+
name: cilium
9+
repository: https://helm.cilium.io/
10+
version: 1.15.7
11+
- alias: hcloud-cloud-controller-manager
12+
name: hcloud-cloud-controller-manager
13+
repository: https://charts.hetzner.cloud
14+
version: 1.20.0
15+
- alias: rook-ceph
16+
name: rook-ceph
17+
repository: https://charts.rook.io/release
18+
version: v1.14.9
19+
condition: rook-ceph.enabled,rook-ceph-cluster.enabled
20+
- alias: rook-ceph-cluster
21+
name: rook-ceph-cluster
22+
repository: https://charts.rook.io/release
23+
version: v1.14.9
24+
condition: rook-ceph-cluster.enabled
25+
name: hetzner-baremetal-1-30-cluster-addon
26+
type: application
27+
version: v1
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)