Files
a13labs.infra/ansible/roles/microk8s/tasks/loadbalancer.yml
T

32 lines
881 B
YAML
Raw Normal View History

2024-09-24 15:19:51 +02:00
- 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