diff --git a/ansible/inventory/group_vars/all/gateway-api b/ansible/inventory/group_vars/all/gateway-api new file mode 100644 index 0000000..3caf615 --- /dev/null +++ b/ansible/inventory/group_vars/all/gateway-api @@ -0,0 +1,24 @@ +--- +zuul_operator_gateway_api_crd_url: "https://github.com/kubernetes-sigs/gateway-api/releases/download/v1.3.0/standard-install.yaml" +zuul_operator_gateway_api_gateways: + - name: zuul-web-gateway + spec: + gatewayClassName: envoy + listeners: + - name: zuul-web-gateway-https + protocol: TLS + port: 443 + tls: + mode: Passthrough + +zuul_operator_gateway_api_httproutes: + - name: zuul-web-gateway-route + spec: + parentRefs: + - name: zuul-web-gateway + hostnames: + - "zuul.stackhpc.com" + rules: + - backendRefs: + - name: zuul-web + port: 8080 diff --git a/ansible/run.yml b/ansible/run.yml index 96b4c37..05bbf7a 100644 --- a/ansible/run.yml +++ b/ansible/run.yml @@ -56,3 +56,40 @@ namespace: "zuul" state: present + - name: Ensure Gateway API CRDs + kubernetes.core.k8s: + namespace: "zuul" + src: "{{ zuul_operator_gateway_api_crd_url }}" + state: present + when: zuul_operator_gateway_api_crd_url | length > 0 + tags: gateway-api + + - name: Ensure Gateway API Gateways + kubernetes.core.k8s: + definition: + apiVersion: gateway.networking.k8s.io/v1 + kind: Gateway + metadata: + name: "{{ item.name }}" + spec: "{{ item.spec }}" + namespace: "zuul" + state: present + loop: "{{ zuul_operator_gateway_api_gateways }}" + loop_control: + label: "{{ item.name }}" + tags: gateway-api + + - name: Ensure Gateway API HTTPRoutes + kubernetes.core.k8s: + definition: + apiVersion: gateway.networking.k8s.io/v1 + kind: HTTPRoute + metadata: + name: "{{ item.name }}" + spec: "{{ item.spec }}" + namespace: "zuul" + state: present + loop: "{{ zuul_operator_gateway_api_httproutes }}" + loop_control: + label: "{{ item.name }}" + tags: gateway-api