Browse Source

Feat: Gateway API CRDs install support (#11376)

* Feat: add Gateway API CRDs installation

Signed-off-by: ChengHao Yang <17496418+tico88612@users.noreply.github.com>

* Feat: add Gateway API CRDs variable in inventory

Signed-off-by: ChengHao Yang <17496418+tico88612@users.noreply.github.com>

---------

Signed-off-by: ChengHao Yang <17496418+tico88612@users.noreply.github.com>
pull/11499/head
ChengHao Yang 2 months ago
committed by GitHub
parent
commit
8a961a60c2
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
6 changed files with 31843 additions and 0 deletions
  1. 4
      inventory/sample/group_vars/k8s_cluster/addons.yml
  2. 4
      roles/kubernetes-apps/gateway_api/defaults/main.yml
  3. 33
      roles/kubernetes-apps/gateway_api/tasks/main.yml
  4. 18317
      roles/kubernetes-apps/gateway_api/templates/experimental-install.yaml.j2
  5. 13478
      roles/kubernetes-apps/gateway_api/templates/standard-install.yaml.j2
  6. 7
      roles/kubernetes-apps/meta/main.yml

4
inventory/sample/group_vars/k8s_cluster/addons.yml

@ -96,6 +96,10 @@ rbd_provisioner_enabled: false
# rbd_provisioner_storage_class: rbd
# rbd_provisioner_reclaim_policy: Delete
# Gateway API CRDs
gateway_api_enabled: false
# gateway_api_experimental_channel: false
# Nginx ingress controller deployment
ingress_nginx_enabled: false
# ingress_nginx_host_network: false

4
roles/kubernetes-apps/gateway_api/defaults/main.yml

@ -0,0 +1,4 @@
---
gateway_api_enabled: false
gateway_api_version: v1.1.0
gateway_api_experimental_channel: false

33
roles/kubernetes-apps/gateway_api/tasks/main.yml

@ -0,0 +1,33 @@
---
- 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 | Set channel
set_fact:
gateway_api_channel: "{{ 'experimental' if gateway_api_experimental_channel else 'standard' }}"
when:
- "inventory_hostname == groups['kube_control_plane'][0]"
- name: Gateway API | Copy Gateway API manifests to remote
template:
src: "{{ gateway_api_channel }}-install.yaml.j2"
dest: "{{ kube_config_dir }}/addons/gateway_api/{{ gateway_api_channel }}-install.yaml"
mode: "0644"
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]"

18317
roles/kubernetes-apps/gateway_api/templates/experimental-install.yaml.j2
File diff suppressed because it is too large
View File

13478
roles/kubernetes-apps/gateway_api/templates/standard-install.yaml.j2
File diff suppressed because it is too large
View File

7
roles/kubernetes-apps/meta/main.yml

@ -111,6 +111,13 @@ dependencies:
tags:
- oci
- role: kubernetes-apps/gateway_api
when:
- gateway_api_enabled
- inventory_hostname == groups['kube_control_plane'][0]
tags:
- gateway_api
- role: kubernetes-apps/metallb
when:
- metallb_enabled

Loading…
Cancel
Save