mirror of
https://github.com/hyperledger/fabric-samples.git
synced 2026-06-17 15:35:09 +00:00
37 lines
1.3 KiB
YAML
37 lines
1.3 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 traefik --for=condition=ready pod --selector=app=traefik --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: traefik
|
|
name: "traefik"
|
|
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 traefik --for=condition=ready pod --selector=app=traefik --timeout=2m
|
|
changed_when: false
|