Skip to content

Commit

Permalink
Add tls-san option to k3s install options (#2886)
Browse files Browse the repository at this point in the history
Also:
- change "become: no" to "become: false"
- remove microk8s
  • Loading branch information
jmgrady committed Mar 6, 2024
1 parent b36749f commit feb5334
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 91 deletions.
2 changes: 1 addition & 1 deletion deploy/ansible/group_vars/nuc/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ ingress_namespace: ingress-nginx
# The server name will direct traffic to the production
# server since it is used to get the certificates for the
# NUC.
k8s_dns_name: "{{ ansible_hostname }}"
public_dns_name: "{{ ansible_hostname }}"

################################################
# Ethernet settings
Expand Down
2 changes: 1 addition & 1 deletion deploy/ansible/roles/k8s_config/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---
# Used to setup the certificate for kubectl
# Can be overridden by specific groups/hosts
k8s_dns_name: "{{ combine_server_name }}"
public_dns_name: "{{ combine_server_name }}"
10 changes: 5 additions & 5 deletions deploy/ansible/roles/k8s_config/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

- name: Restrict permissions to kubeconfig to owner
delegate_to: localhost
become: no
become: false
file:
path: "{{ kubecfg }}"
state: file
Expand All @@ -31,25 +31,25 @@
# (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
become: false
lineinfile:
state: present
path: "{{ kubecfg }}"
regexp: '^(\s+server: https:\/\/)[.0-9]+:(1?6443)'
backrefs: yes
line: '\1{{ k8s_dns_name }}:\2'
line: '\1{{ public_dns_name }}:\2'

- name: Replace 'default' cluster, user, etc with {{ kubecfgdir }}
delegate_to: localhost
become: no
become: false
replace:
path: "{{ kubecfg }}"
regexp: "^(.*)default(.*)$"
replace: '\1{{ kubecfgdir }}\2'

- name: Link ~/.kube/config to {{ kubecfg }}
delegate_to: localhost
become: no
become: false
file:
state: link
src: "{{ kubecfg }}"
Expand Down
13 changes: 3 additions & 10 deletions deploy/ansible/roles/k8s_install/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
# Used to setup the certificate for kubectl
# Can be overridden by specific groups/hosts
k8s_dns_name: "{{ combine_server_name }}"
public_dns_name: "{{ combine_server_name }}"

k8s_required_pkgs:
- apt-transport-https
Expand All @@ -14,12 +14,5 @@ k3s_options:
- 644
- --disable
- traefik

# Options for installing the microk8s engine
microk8s_options:
addons:
- storage
- dns
- ingress
- helm3
- rbac
- --tls-san
- "{{ public_dns_name }}"
72 changes: 0 additions & 72 deletions deploy/ansible/roles/k8s_install/tasks/microk8s.yml

This file was deleted.

2 changes: 1 addition & 1 deletion deploy/ansible/roles/network_config/defaults/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ eth_if_pattern: "en[a-z][0-9]"

###############################
# virtual_if device
# This is needed when microk8s is running on a target that
# This is needed when k3s is running on a target that
# does not have an ethernet connection plugged-in.
###############################

Expand Down
2 changes: 1 addition & 1 deletion deploy/ansible/roles/network_config/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
when: has_wifi

###
# Create a virtual network interface so that microk8s/k3s can run
# Create a virtual network interface so that k3s can run
# when no ethernet connection is attached.
###
- name: Create virtual network I/F
Expand Down

0 comments on commit feb5334

Please sign in to comment.