fabric-samples/full-stack-asset-transfer-guide/infrastructure/kind_console_ingress/90-KIND-ingress.yml
Josh Kneubuhl 4c656f6215 Import Full Stack Asset Transfer Guide at commit fb554befdbbeff9e69159b54fce0b811603f29c7
Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com>
2022-11-09 13:14:04 -05:00

37 lines
1.4 KiB
YAML

---
- name: Setup ingress for KIND for use with Fabric Operator/Console
hosts: localhost
tasks:
- name: Create kubernetes resources for the ingress
k8s:
definition: "{{ lookup('kubernetes.core.kustomize', dir='templates/ingress') }}"
register: resultingress
- name: Wait for the ingress
command: kubectl wait --namespace ingress-nginx --for=condition=ready pod --selector=app.kubernetes.io/component=controller --timeout=2m
changed_when: false
# Override the cluster DNS with a local override to refer pods to the HOST interface
# when connecting to ingress.
- name: Need the cluster ip address
k8s_info:
api_version: v1
kind: service
namespace: ingress-nginx
name: "ingress-nginx-controller"
register: ingress_info
- name: Applying CoreDNS overrides for ingress domain
vars:
clusterip: "{{ ingress_info.resources[0].spec.clusterIP }}"
k8s:
state: present
namespace: kube-system
resource_definition: "{{ lookup('template','templates/coredns/coredns.yaml.j2') }}"
apply: yes
- name: Rollout the CoreDNS
shell: |
kubectl -n kube-system rollout restart deployment/coredns
kubectl wait --namespace ingress-nginx --for=condition=ready pod --selector=app.kubernetes.io/component=controller --timeout=2m
changed_when: false