-
Notifications
You must be signed in to change notification settings - Fork 270
🌱 Enable k8s upgrade in self hosted test #1732
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
apiVersion: controlplane.cluster.x-k8s.io/v1beta1 | ||
kind: KubeadmControlPlane | ||
metadata: | ||
name: ${CLUSTER_NAME}-control-plane | ||
spec: | ||
machineTemplate: | ||
infrastructureRef: | ||
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha7 | ||
kind: OpenStackMachineTemplate | ||
name: ${CLUSTER_NAME}-upgrade-from-control-plane |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
resources: | ||
- ../default | ||
- upgrade-from-template.yaml | ||
- upgrade-to-template.yaml | ||
|
||
patches: | ||
- path: kcp-patch.yaml | ||
- path: md-patch.yaml |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
apiVersion: cluster.x-k8s.io/v1beta1 | ||
kind: MachineDeployment | ||
metadata: | ||
name: ${CLUSTER_NAME}-md-0 | ||
spec: | ||
template: | ||
spec: | ||
infrastructureRef: | ||
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha7 | ||
kind: OpenStackMachineTemplate | ||
name: ${CLUSTER_NAME}-upgrade-from-md-0 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
--- | ||
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha7 | ||
kind: OpenStackMachineTemplate | ||
metadata: | ||
name: ${CLUSTER_NAME}-upgrade-from-control-plane | ||
spec: | ||
template: | ||
spec: | ||
cloudName: ${OPENSTACK_CLOUD} | ||
flavor: ${OPENSTACK_CONTROL_PLANE_MACHINE_FLAVOR} | ||
identityRef: | ||
kind: Secret | ||
name: ${CLUSTER_NAME}-cloud-config | ||
image: ${OPENSTACK_IMAGE_NAME_UPGRADE_FROM} | ||
sshKeyName: ${OPENSTACK_SSH_KEY_NAME} | ||
tags: | ||
- control-plane | ||
--- | ||
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha7 | ||
kind: OpenStackMachineTemplate | ||
metadata: | ||
name: ${CLUSTER_NAME}-upgrade-from-md-0 | ||
spec: | ||
template: | ||
spec: | ||
cloudName: ${OPENSTACK_CLOUD} | ||
flavor: ${OPENSTACK_NODE_MACHINE_FLAVOR} | ||
identityRef: | ||
kind: Secret | ||
name: ${CLUSTER_NAME}-cloud-config | ||
image: ${OPENSTACK_IMAGE_NAME_UPGRADE_FROM} | ||
sshKeyName: ${OPENSTACK_SSH_KEY_NAME} | ||
tags: | ||
- machine |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# This is just a copy of the normal cluster template OSMTs. | ||
# It is needed because we need a static name that we can put in the e2e config. | ||
# The normal templates has the cluster name as part of the OSMT name. | ||
# See CONTROL_PLANE_MACHINE_TEMPLATE_UPGRADE_TO and WORKERS_MACHINE_TEMPLATE_UPGRADE_TO | ||
# in the e2e config. | ||
--- | ||
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha7 | ||
kind: OpenStackMachineTemplate | ||
metadata: | ||
name: upgrade-to-control-plane | ||
labels: | ||
clusterctl.cluster.x-k8s.io/move: "" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This label is important to get the (not yet in use) template moved to the self hosted cluster. Otherwise it would be left behind since it is not part of the owner chain at that point. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes, I think it's something I tried to add into CAPO before, IIRC it's moving stuffs from boostrap to deployed cluster? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Exactly. To be clear, it is only needed on this template because it is not part of the cluster owner chain. All resources that are part of the cluster are moved automatically. For example, the OpenStackMachineTemplates that are used when initializing the workload cluster are automatically moved. |
||
spec: | ||
template: | ||
spec: | ||
cloudName: ${OPENSTACK_CLOUD} | ||
flavor: ${OPENSTACK_CONTROL_PLANE_MACHINE_FLAVOR} | ||
identityRef: | ||
kind: Secret | ||
name: ${CLUSTER_NAME}-cloud-config | ||
image: ${OPENSTACK_IMAGE_NAME} | ||
sshKeyName: ${OPENSTACK_SSH_KEY_NAME} | ||
tags: | ||
- control-plane | ||
--- | ||
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha7 | ||
kind: OpenStackMachineTemplate | ||
metadata: | ||
name: upgrade-to-md-0 | ||
labels: | ||
clusterctl.cluster.x-k8s.io/move: "" | ||
spec: | ||
template: | ||
spec: | ||
cloudName: ${OPENSTACK_CLOUD} | ||
flavor: ${OPENSTACK_NODE_MACHINE_FLAVOR} | ||
identityRef: | ||
kind: Secret | ||
name: ${CLUSTER_NAME}-cloud-config | ||
image: ${OPENSTACK_IMAGE_NAME} | ||
sshKeyName: ${OPENSTACK_SSH_KEY_NAME} | ||
tags: | ||
- machine |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is very great update
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All credit goes to @wwentland 😊