kubeasz/roles/cluster-addon/tasks/ingress.yml

38 lines
1.8 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

# https://github.com/traefik/traefik-helm-chart
- block:
- name: 创建 traefik chart 个性化设置
template: src=traefik/values.yaml.j2 dest={{ cluster_dir }}/yml/traefik-values.yaml
- name: helm 创建 traefik chart {{ traefik_chart_ver }}
shell: "{{ base_dir }}/bin/helm install -n kube-system traefik \
-f {{ cluster_dir }}/yml/traefik-values.yaml \
{{ base_dir }}/roles/cluster-addon/files/traefik-{{ traefik_chart_ver }}.tgz"
run_once: true
connection: local
when: 'ingress_backend == "traefik"'
#- block:
# - block:
# - name: 尝试推送离线 nginx-ingress镜像若执行失败可忽略
# copy: src={{ base_dir }}/down/{{ nginx_ingress_offline }} dest=/opt/kube/images/{{ nginx_ingress_offline }}
# when: 'nginx_ingress_offline in download_info.stdout'
#
# - name: 获取nginx_ingress离线镜像推送情况
# command: "ls /opt/kube/images"
# register: image_info
#
# - name: 导入 nginx_ingress的离线镜像若执行失败可忽略
# shell: "{{ bin_dir }}/docker load -i /opt/kube/images/{{ nginx_ingress_offline }}"
# when: 'nginx_ingress_offline in image_info.stdout and CONTAINER_RUNTIME == "docker"'
#
# - name: 导入 nginx_ingress的离线镜像若执行失败可忽略
# shell: "{{ bin_dir }}/ctr -n=k8s.io images import /opt/kube/images/{{ nginx_ingress_offline }}"
# when: 'nginx_ingress_offline in image_info.stdout and CONTAINER_RUNTIME == "containerd"'
#
# - name: 创建 nginx_ingress部署
# shell: "{{ base_dir }}/bin/kubectl apply -f {{ base_dir }}/manifests/ingress/nginx-ingress/nginx-ingress.yaml"
# connection: local
# run_once: true
# when: 'ingress_backend == "nginx-ingress"'