-
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into display-network-errors
- Loading branch information
Showing
26 changed files
with
185 additions
and
350 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
k3s_options: | ||
- --write-kubeconfig-mode | ||
- 644 | ||
- --disable | ||
- traefik |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
--- | ||
################################################ | ||
# Install the k3s Lightweight Kubernetes Engine | ||
# from Rancher. | ||
# https://k3s.io/ | ||
################################################ | ||
- name: Install k3s | ||
shell: | ||
cmd: curl -sfL https://get.k3s.io | sh -s - {{ k3s_options | join(' ') }} | ||
warn: no | ||
creates: /usr/local/bin/k3s | ||
|
||
- name: Get home directory for {{ k8s_user }} | ||
shell: > | ||
getent passwd {{ k8s_user }} | awk -F: '{ print $6 }' | ||
register: k8s_user_home | ||
changed_when: false | ||
|
||
- name: Create .kube directories | ||
file: | ||
path: "{{ item.home }}/.kube" | ||
state: directory | ||
owner: "{{ item.owner }}" | ||
group: "{{ item.group }}" | ||
mode: 0700 | ||
loop: | ||
- home: "{{ k8s_user_home.stdout }}" | ||
owner: "{{ k8s_user }}" | ||
group: "{{ k8s_group }}" | ||
- home: /root | ||
owner: root | ||
group: root | ||
|
||
- name: Set link .kube/config to /etc/rancher/k3s/k3s.yaml | ||
file: | ||
src: /etc/rancher/k3s/k3s.yaml | ||
path: "{{ item }}/.kube/config" | ||
state: link | ||
loop: | ||
- "{{ k8s_user_home.stdout }}" | ||
- /root | ||
|
||
- name: Save kubectl configuration on host | ||
fetch: | ||
src: "{{ k8s_user_home.stdout }}/.kube/config" | ||
dest: "{{ kubecfg }}" | ||
flat: yes | ||
|
||
- name: Restrict permissions to kubeconfig to owner | ||
delegate_to: localhost | ||
become: no | ||
file: | ||
path: "{{ kubecfg }}" | ||
state: file | ||
mode: 0600 | ||
|
||
# The kubeconfig file that is generated by k3s on the target | ||
# system identifies the server by the IP address. This updates | ||
# the file when it has been copied to the host to replace the | ||
# IP address with the server name. This is needed in the a | ||
# cloud environment where the IP address seen on the host is not | ||
# the public IP address. For example: | ||
# server: 10.0.0.40:6443 | ||
# is changed to: | ||
# server: nuc2:6443 | ||
# (kubectl communicates with the cluster over port 16443 or 6443) | ||
- name: Replace server IP with DNS name in site_files copy | ||
delegate_to: localhost | ||
become: no | ||
lineinfile: | ||
state: present | ||
path: "{{ kubecfg }}" | ||
regexp: '^(\s+server: https:\/\/)[.0-9]+:(1?6443)' | ||
backrefs: yes | ||
line: '\1{{ k8s_dns_name }}:\2' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
deploy/roles/k8s_cert_manager/templates/letsencrypt_prod.yaml.j2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
deploy/roles/k8s_cert_manager/templates/letsencrypt_staging.yaml.j2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.