mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2026-02-28 09:39:12 +03:00
Refactor: add common_crds role & migrate gateway_api
Adding commonly used CRDs can be expanded Signed-off-by: ChengHao Yang <17496418+tico88612@users.noreply.github.com>
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
---
|
||||
gateway_api_enabled: false
|
||||
gateway_api_version: 1.2.1
|
||||
|
||||
# `gateway_api_channel` default is "standard".
|
||||
# "standard" release channel includes all resources that have graduated to GA or beta, including GatewayClass, Gateway, HTTPRoute, and ReferenceGrant.
|
||||
# "experimental" for some experimental resources and fields. Note that future releases of the API could include breaking changes to experimental resources and fields. For example, any experimental resource or field could be removed in a future release.
|
||||
# https://gateway-api.sigs.k8s.io/guides/#install-experimental-channel
|
||||
gateway_api_channel: "standard"
|
||||
33
roles/kubernetes-apps/common_crds/gateway_api/tasks/main.yml
Normal file
33
roles/kubernetes-apps/common_crds/gateway_api/tasks/main.yml
Normal file
@@ -0,0 +1,33 @@
|
||||
---
|
||||
- name: Gateway API | Download YAML
|
||||
include_tasks: "../../../../download/tasks/download_file.yml"
|
||||
vars:
|
||||
download: "{{ download_defaults | combine(downloads.gateway_api_crds) }}"
|
||||
|
||||
- name: Gateway API | Create addon dir
|
||||
file:
|
||||
path: "{{ kube_config_dir }}/addons/gateway_api"
|
||||
state: directory
|
||||
owner: root
|
||||
group: root
|
||||
mode: "0755"
|
||||
when:
|
||||
- inventory_hostname == groups['kube_control_plane'][0]
|
||||
|
||||
- name: Gateway API | Copy YAML from download dir
|
||||
copy:
|
||||
src: "{{ local_release_dir }}/gateway-api-{{ gateway_api_channel }}-install.yaml"
|
||||
dest: "{{ kube_config_dir }}/addons/gateway_api/{{ gateway_api_channel }}-install.yaml"
|
||||
mode: "0644"
|
||||
remote_src: true
|
||||
when:
|
||||
- "inventory_hostname == groups['kube_control_plane'][0]"
|
||||
|
||||
- name: Gateway API | Install Gateway API
|
||||
kube:
|
||||
name: Gateway API
|
||||
kubectl: "{{ bin_dir }}/kubectl"
|
||||
filename: "{{ kube_config_dir }}/addons/gateway_api/{{ gateway_api_channel }}-install.yaml"
|
||||
state: latest
|
||||
when:
|
||||
- "inventory_hostname == groups['kube_control_plane'][0]"
|
||||
6
roles/kubernetes-apps/common_crds/meta/main.yml
Normal file
6
roles/kubernetes-apps/common_crds/meta/main.yml
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
dependencies:
|
||||
- role: kubernetes-apps/common_crds/gateway_api
|
||||
when: gateway_api_enabled
|
||||
tags:
|
||||
- gateway_api
|
||||
Reference in New Issue
Block a user