Skip to content
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
23 changes: 6 additions & 17 deletions roles/cluster_api/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,6 @@
# Copyright (c) 2023 VEXXHOST, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.

# clusterctl depends heavily on the GitHub API and gets very quickly rate
# limited so you should set this to your own token.
#
# Copyright (c) 2025 VEXXHOST, Inc.
# SPDX-License-Identifier: Apache-2.0

# See: https://github.com/kubernetes-sigs/cluster-api/issues/3982
cluster_api_github_token: ""

Expand All @@ -35,3 +21,6 @@ cluster_api_control_plane_version: "{{ cluster_api_version }}"
# cluster_api_infrastructure_version:

cluster_api_node_selector: {}

# https://cluster-api-openstack.sigs.k8s.io/clusteropenstack/configuration.html#timeout-settings
cluster_api_capo_instance_create_timeout: 10
15 changes: 2 additions & 13 deletions roles/cluster_api/meta/main.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,5 @@
# Copyright (c) 2023 VEXXHOST, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
# Copyright (c) 2025 VEXXHOST, Inc.
# SPDX-License-Identifier: Apache-2.0

galaxy_info:
author: VEXXHOST, Inc.
Expand Down
15 changes: 2 additions & 13 deletions roles/cluster_api/tasks/init.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,5 @@
# Copyright (c) 2023 VEXXHOST, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
# Copyright (c) 2025 VEXXHOST, Inc.
# SPDX-License-Identifier: Apache-2.0

- name: Initialize the management cluster
run_once: true
Expand Down
15 changes: 2 additions & 13 deletions roles/cluster_api/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,5 @@
# Copyright (c) 2023 VEXXHOST, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
# Copyright (c) 2025 VEXXHOST, Inc.
# SPDX-License-Identifier: Apache-2.0

- name: Create a folder for the Cluster API providers
ansible.builtin.file:
Expand Down
43 changes: 27 additions & 16 deletions roles/cluster_api/tasks/patch.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,5 @@
# Copyright (c) 2023 VEXXHOST, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
# Copyright (c) 2025 VEXXHOST, Inc.
# SPDX-License-Identifier: Apache-2.0

- name: Set node selector for Cluster API components
Comment thread
mnaser marked this conversation as resolved.
kubernetes.core.k8s:
Expand Down Expand Up @@ -39,10 +28,15 @@
# set the default value of imagePullPolicy in CRDs.
# yamllint disable rule:line-length
- name: Set default values for imagePullPolicy in kubeadmConfigSpec of CRDs
changed_when: false
when: cluster_api_control_plane_version | float >= 1.4
ansible.builtin.command: |
kubectl patch crd {{ item.crd }} --type=json -p='[{"op": "add", "path": "{{ item.path }}", "value": "IfNotPresent"}]'
kubernetes.core.k8s_json_patch:
kind: CustomResourceDefinition
name: "{{ item.crd }}"
patch:
- op: add
path: "{{ item.path }}"
value: "IfNotPresent"
wait: true
loop:
- {"crd": "kubeadmcontrolplanetemplates.controlplane.cluster.x-k8s.io", "path": "/spec/versions/1/schema/openAPIV3Schema/properties/spec/properties/template/properties/spec/properties/kubeadmConfigSpec/properties/initConfiguration/properties/nodeRegistration/properties/imagePullPolicy/default"}
- {"crd": "kubeadmcontrolplanetemplates.controlplane.cluster.x-k8s.io", "path": "/spec/versions/1/schema/openAPIV3Schema/properties/spec/properties/template/properties/spec/properties/kubeadmConfigSpec/properties/joinConfiguration/properties/nodeRegistration/properties/imagePullPolicy/default"}
Expand All @@ -52,3 +46,20 @@
- {"crd": "kubeadmconfigtemplates.bootstrap.cluster.x-k8s.io", "path": "/spec/versions/2/schema/openAPIV3Schema/properties/spec/properties/template/properties/spec/properties/joinConfiguration/properties/nodeRegistration/properties/imagePullPolicy/default"}
- {"crd": "kubeadmcontrolplanes.controlplane.cluster.x-k8s.io", "path": "/spec/versions/2/schema/openAPIV3Schema/properties/spec/properties/kubeadmConfigSpec/properties/initConfiguration/properties/nodeRegistration/properties/imagePullPolicy/default"}
- {"crd": "kubeadmcontrolplanes.controlplane.cluster.x-k8s.io", "path": "/spec/versions/2/schema/openAPIV3Schema/properties/spec/properties/kubeadmConfigSpec/properties/joinConfiguration/properties/nodeRegistration/properties/imagePullPolicy/default"}

- name: Set CAPO instance creation timeout
when: cluster_api_infrastructure_provider == "openstack"
kubernetes.core.k8s_json_patch:
kind: Deployment
namespace: capo-system
name: capo-controller-manager
patch:
- op: add
path: /spec/template/spec/containers/0/env
value: []
- op: add
path: /spec/template/spec/containers/0/env/-
value:
name: CLUSTER_API_OPENSTACK_INSTANCE_CREATE_TIMEOUT
value: "{{ cluster_api_capo_instance_create_timeout | quote }}"
wait: true
15 changes: 2 additions & 13 deletions roles/cluster_api/tasks/upgrade.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,5 @@
# Copyright (c) 2023 VEXXHOST, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
# Copyright (c) 2025 VEXXHOST, Inc.
# SPDX-License-Identifier: Apache-2.0

- name: Parse provider resources into version mapping
run_once: true
Expand Down
15 changes: 2 additions & 13 deletions roles/cluster_api/vars/main.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,5 @@
# Copyright (c) 2023 VEXXHOST, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
# Copyright (c) 2025 VEXXHOST, Inc.
# SPDX-License-Identifier: Apache-2.0

_cluster_api_environment: |
{% set res = {'CLUSTER_TOPOLOGY': 'true', 'EXP_CLUSTER_RESOURCE_SET': 'true'} -%}
Expand Down
Loading