32 lines
881 B
YAML
32 lines
881 B
YAML
- name: Loadbalancer | Setup '{{ lb_provider }}'
|
|
ansible.builtin.include_tasks: "loadbalancer/{{ lb_provider }}.yaml"
|
|
|
|
- name: Loadbalancer | Create Loadbalancer for Nginx ingress
|
|
environment:
|
|
PATH: "{{ k8s_venv }}/bin:{{ ansible_env.PATH }}"
|
|
vars:
|
|
ansible_python_interpreter: "{{ k8s_venv }}/bin/python"
|
|
kubernetes.core.k8s:
|
|
state: present
|
|
kubeconfig: "{{ k8s_kubeconfig }}"
|
|
wait: true
|
|
definition:
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: ingress
|
|
namespace: ingress
|
|
spec:
|
|
selector:
|
|
name: nginx-ingress-microk8s
|
|
type: LoadBalancer
|
|
ports:
|
|
- name: http
|
|
protocol: TCP
|
|
port: "{{ lb_http_port }}"
|
|
targetPort: 80
|
|
- name: https
|
|
protocol: TCP
|
|
port: "{{ lb_https_port }}"
|
|
targetPort: 443
|