Skip to content
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

Use seperate defaultSpecs for ControlPlaneMachineSet #85

Merged
merged 2 commits into from
Jun 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
37 changes: 37 additions & 0 deletions class/defaults.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ parameters:
projectName: none
infrastructureID: none
defaultSpecs:
vsphere: {}
aws: {}
azure: {}
gcp:
Expand Down Expand Up @@ -42,6 +43,42 @@ parameters:
tags: []
userDataSecret:
name: worker-user-data
controlPlaneDefaultSpecs:
vsphere: {}
aws: {}
azure: {}
gcp:
template:
machines_v1beta1_machine_openshift_io:
spec:
providerSpec:
value:
apiVersion: gcpprovider.openshift.io/v1beta1
canIPForward: false
credentialsSecret:
name: gcp-cloud-credentials
deletionProtection: false
disks:
- autoDelete: true
boot: true
image: ${openshift4_nodes:infrastructureID}-rhcos-image
labels: null
sizeGb: 128
type: pd-ssd
kind: GCPMachineProviderSpec
metadata:
creationTimestamp: null
networkInterfaces:
- network: ${openshift4_nodes:infrastructureID}-network
subnetwork: ${openshift4_nodes:infrastructureID}-worker-subnet
projectID: ${openshift4_nodes:projectName}
region: ${facts:region}
serviceAccounts:
- email: ${openshift4_nodes:infrastructureID}-w@${openshift4_nodes:projectName}.iam.gserviceaccount.com
scopes:
- https://www.googleapis.com/auth/cloud-platform
userDataSecret:
name: master-user-data
nodeConfig:
cgroupMode: v1

Expand Down
12 changes: 1 addition & 11 deletions component/machine-sets.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -58,17 +58,7 @@ local machineSetSpecs = function(name, set, role)

local cpMachineSetSpecs = function(set)
kube._Object('machine.openshift.io/v1', 'ControlPlaneMachineSet', 'cluster') {
spec+: {
template+: {
machines_v1beta1_machine_openshift_io: {
spec+: {
providerSpec+: {
value+: params.defaultSpecs[inv.parameters.facts.cloud].template.spec.providerSpec.value,
},
},
},
},
},
spec+: params.controlPlaneDefaultSpecs[inv.parameters.facts.cloud],
} + {
metadata+: {
annotations+: std.get(set, 'annotations', {}),
Expand Down
11 changes: 11 additions & 0 deletions docs/modules/ROOT/pages/references/parameters.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,17 @@ A dictionary holding the default values applied to each `machinesets.machine.ope
The top level keys are the names of cloud providers as reported by the cluster fact `${facts:cloud}`.
The values can be everything that's accepted in the `spec` field of a `machinesets.machine.openshift.io` object.

== `controlPlaneDefaultSpecs`

[horizontal]
type:: dictionary
default:: Sensible defaults for a growing number of cloud providers.

A dictionary holding the default values applied to each `controlplanemachinesets.machine.openshift.io` object created by this component.

The top level keys are the names of cloud providers as reported by the cluster fact `${facts:cloud}`.
The values can be everything that's accepted in the `spec` field of a `controlplanemachinesets.machine.openshift.io` object.

== `infrastructureID`

[horizontal]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,5 @@ spec:
tags:
- infra-id-master
userDataSecret:
name: worker-user-data
name: master-user-data
zone: europe-west6-a
Loading