Skip to content
Snippets Groups Projects
Commit 79285995 authored by kaiyou's avatar kaiyou
Browse files

Publish node roles

parent caa0e7a7
No related branches found
No related tags found
No related merge requests found
Pipeline #30637 failed
...@@ -30,11 +30,26 @@ ...@@ -30,11 +30,26 @@
src: "{{ playbook_dir }}/../../helm/" src: "{{ playbook_dir }}/../../helm/"
dest: "/tmp/hepto-bootstrap" dest: "/tmp/hepto-bootstrap"
- name: Assign node roles
ansible.builtin.shell: |
{% for node in groups['master'] %}
kubectl taint node {{ hostvars[node].inventory_hostname }} node-role.kubernetes.io/control-plane="":NoSchedule
{% endfor %}
{% for role, nodes in groups.items() %}
{% for node in nodes %}
kubectl label node {{ hostvars[node].inventory_hostname }} node-role.kubernetes.io/{{ role }}=true
{% endfor %}
{% endfor %}
environment:
KUBECONFIG: "{{ kubeconfig }}"
- name: Bootstrap the cluster - name: Bootstrap the cluster
ansible.builtin.shell: | ansible.builtin.shell: |
helm upgrade --install --dependency-update --create-namespace -n infra-bootstrap hepto /tmp/hepto-bootstrap \ helm upgrade --install --dependency-update --create-namespace -n infra-bootstrap hepto /tmp/hepto-bootstrap \
-f /tmp/cluster_info \ -f /tmp/cluster_info \
-f /tmp/node_info -f /tmp/node_info
# Run a second time for custom resources to be created
helm upgrade -n infra-bootstrap hepto /tmp/hepto-bootstrap -f /tmp/cluster_info -f /tmp/node_info
environment: environment:
KUBECONFIG: "{{ kubeconfig }}" KUBECONFIG: "{{ kubeconfig }}"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment