|
1 |
| - # Copyright (c) 2023 VEXXHOST, Inc. |
2 |
| - # |
3 |
| - # Licensed under the Apache License, Version 2.0 (the "License"); you may |
4 |
| - # not use this file except in compliance with the License. You may obtain |
5 |
| - # a copy of the License at |
6 |
| - # |
7 |
| - # http://www.apache.org/licenses/LICENSE-2.0 |
8 |
| - # |
9 |
| - # Unless required by applicable law or agreed to in writing, software |
10 |
| - # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
11 |
| - # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
12 |
| - # License for the specific language governing permissions and limitations |
13 |
| - # under the License. |
| 1 | +# Copyright (c) 2025 VEXXHOST, Inc. |
| 2 | +# SPDX-License-Identifier: Apache-2.0 |
14 | 3 |
|
15 | 4 | - name: Set node selector for Cluster API components
|
16 | 5 | kubernetes.core.k8s:
|
|
53 | 42 | # set the default value of imagePullPolicy in CRDs.
|
54 | 43 | # yamllint disable rule:line-length
|
55 | 44 | - name: Set default values for imagePullPolicy in kubeadmConfigSpec of CRDs
|
56 |
| - changed_when: false |
57 | 45 | when: cluster_api_control_plane_version | float >= 1.4
|
58 |
| - ansible.builtin.command: | |
59 |
| - kubectl patch crd {{ item.crd }} --type=json -p='[{"op": "add", "path": "{{ item.path }}", "value": "IfNotPresent"}]' |
| 46 | + kubernetes.core.k8s_json_patch: |
| 47 | + kind: CustomResourceDefinition |
| 48 | + name: "{{ item.crd }}" |
| 49 | + patch: |
| 50 | + - op: add |
| 51 | + path: "{{ item.path }}" |
| 52 | + value: "IfNotPresent" |
| 53 | + wait: true |
60 | 54 | loop:
|
61 | 55 | - {"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"}
|
62 | 56 | - {"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"}
|
|
66 | 60 | - {"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"}
|
67 | 61 | - {"crd": "kubeadmcontrolplanes.controlplane.cluster.x-k8s.io", "path": "/spec/versions/2/schema/openAPIV3Schema/properties/spec/properties/kubeadmConfigSpec/properties/initConfiguration/properties/nodeRegistration/properties/imagePullPolicy/default"}
|
68 | 62 | - {"crd": "kubeadmcontrolplanes.controlplane.cluster.x-k8s.io", "path": "/spec/versions/2/schema/openAPIV3Schema/properties/spec/properties/kubeadmConfigSpec/properties/joinConfiguration/properties/nodeRegistration/properties/imagePullPolicy/default"}
|
| 63 | + |
| 64 | +- name: Set CAPO instance creation timeout |
| 65 | + when: cluster_api_infrastructure_provider == "openstack" |
| 66 | + kubernetes.core.k8s_json_patch: |
| 67 | + kind: Deployment |
| 68 | + namespace: capo-system |
| 69 | + name: capo-controller-manager |
| 70 | + patch: |
| 71 | + - op: add |
| 72 | + path: /spec/template/spec/containers/0/env |
| 73 | + value: [] |
| 74 | + - op: add |
| 75 | + path: /spec/template/spec/containers/0/env/- |
| 76 | + value: |
| 77 | + name: CLUSTER_API_OPENSTACK_INSTANCE_CREATE_TIMEOUT |
| 78 | + value: "{{ cluster_api_capo_instance_create_timeout | quote }}" |
| 79 | + wait: true |
0 commit comments