Skip to content

Commit afd02e0

Browse files
committed
Register worker nodes with tags in ansible
1 parent 6e78e01 commit afd02e0

File tree

4 files changed

+16
-2
lines changed

4 files changed

+16
-2
lines changed
Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
- name: Install k3s agent
22
ansible.builtin.shell: |
3-
curl -sfL https://get.k3s.io | K3S_URL=https://{{ k3s_master_ip }}:6443 K3S_TOKEN={{ hostvars[groups['master'][0]]['k3s_token'] }} sh -
3+
curl -sfL https://get.k3s.io | \
4+
K3S_URL=https://{{ k3s_master_ip }}:6443 \
5+
K3S_TOKEN={{ hostvars[groups['master'][0]]['k3s_token'] }} \
6+
K3S_NODE_LABEL="node-role.kubernetes.io/worker=true" \
7+
sh -

ansible/playbooks/roles/teleport-master/templates/roles/admin-bot-role.yaml.j2

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,12 @@ spec:
1212
- repository: "{{ github_infra_repo }}"
1313
workflow: "{{ github_infra_repo_workflows }}"
1414
resources: ['bot']
15+
rules:
16+
- resources: [user]
17+
verbs: [renew]
1518
verbs: ['create', 'read']
1619

20+
1721
impersonate:
1822
roles: ['admin-access']
1923
users: ["{{ '{{internal.bot_name}}' }}"]

ansible/playbooks/roles/teleport-master/templates/roles/admin-role.yaml.j2

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,19 @@ spec:
1313
kubernetes_labels:
1414
'*': '*'
1515
kubernetes_groups: ['system:masters']
16+
kubernetes_resources:
17+
- kind: '*'
18+
namespace: '*'
19+
name: '*'
1620

1721
db_labels:
1822
'*': '*'
1923

2024
rules:
2125
- resources: ['*']
2226
verbs: ['*']
27+
- resources: [user]
28+
verbs: [renew]
2329

2430
options:
2531
forward_agent: true

terraform/clusters.auto.tfvars

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ clusters = {
88
name = "worker-group-1"
99
instance_size = "Standard_B1ms"
1010
disk_size = 30
11-
count = 1
11+
count = 2
1212
tags = { role = "ms1", owner = "exploravis-infra" }
1313
}
1414
]

0 commit comments

Comments
 (0)