-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #115 from dejo1307/april_0.4.0_fixes
April 0.4.0 fixes
- Loading branch information
Showing
21 changed files
with
203 additions
and
46 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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
--- | ||
__helm_version: "{{ helm_version | default('3.5.2') }}" | ||
__helm_version: "{{ helm_version | default('3.5.4') }}" | ||
__helm_url: "https://get.helm.sh/helm-v{{ __helm_version }}-linux-amd64.tar.gz" | ||
__helm_install_dir: "{{ helm_install_dir | default('/opt/helm') }}" |
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
21 changes: 21 additions & 0 deletions
21
roles/third_party/kubernetes/kubernetes-install/tasks/install_kubectl.yml
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,21 @@ | ||
--- | ||
- name: "Create install directory {{ __kube_binaries_install_dir }}" | ||
file: | ||
path: "{{ __kube_binaries_install_dir }}" | ||
state: directory | ||
mode: "0755" | ||
become: true | ||
|
||
- name: "Download kubectl {{ __kubernetes_version }} from {{ __kube_binaries_download_url }} to {{ __kube_binaries_install_dir }}" | ||
get_url: | ||
url: "{{ __kube_binaries_download_url }}/v{{ __kubernetes_version }}/bin/linux/amd64/kubectl" | ||
dest: "{{ __kube_binaries_install_dir }}/kubectl-{{ __kubernetes_version }}" | ||
mode: "0755" | ||
become: true | ||
|
||
- name: "Create kubectl symlink to {{ __kube_binaries_install_dir }}/kubectl-{{ __kubernetes_version }}" | ||
file: | ||
src: "{{ __kube_binaries_install_dir }}/kubectl-{{ __kubernetes_version }}" | ||
dest: "{{ __kube_binaries_install_dir }}/kubectl" | ||
state: link | ||
become: true |
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
30 changes: 30 additions & 0 deletions
30
roles/third_party/kubernetes/kubernetes-upgrade/tasks/upgrade_kubectl.yml
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,30 @@ | ||
--- | ||
- name: Run kubectl version | ||
command: "kubectl version --client --short" | ||
register: kubectl_version_output | ||
ignore_errors: True | ||
|
||
- name: Get kubectl version | ||
set_fact: | ||
kubectl_version: "{{ kubectl_version_output.stdout | regex_search('Client Version:\\sv(.*)', '\\1') | first }}" | ||
when: kubectl_version_output.rc == 0 | ||
|
||
- set_fact: | ||
kubectl_version: "0" | ||
when: kubectl_version_output.rc != 0 | ||
|
||
- debug: | ||
msg: | ||
- "Current kubectl version = {{ kubectl_version }}, 0 means undetermined or not installed" | ||
- "Target kubectl upgrade version = {{ __kubernetes_version }}" | ||
|
||
- name: Delete old version if exists | ||
file: | ||
path: "{{ __kube_binaries_install_dir }}/kubectl" | ||
state: absent | ||
when: __kubernetes_version is version( kubectl_version, '>') | ||
|
||
- name: Install new kubectl version | ||
include_tasks: | ||
file: ../../kubernetes-install/tasks/install_kubectl.yml | ||
when: __kubernetes_version is version( kubectl_version, '>') |
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
81 changes: 81 additions & 0 deletions
81
roles/third_party/kubernetes/setup-master-node/templates/kubeadm.config.1.18.19.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
apiVersion: kubeadm.k8s.io/v1beta2 | ||
kind: ClusterConfiguration | ||
kubernetesVersion: v{{ __kubernetes_version }} | ||
apiServer: | ||
{% if enable_pod_security is defined %} | ||
extraArgs: | ||
enable-admission-plugins: PodSecurityPolicy | ||
{% endif %} | ||
{% if single_node_installation is not defined %} | ||
certSANS: | ||
- "{{ __load_balancer_dns }}" | ||
controlPlaneEndpoint: "{{ __load_balancer_dns }}:6443" | ||
etcd: | ||
local: | ||
extraArgs: | ||
listen-client-urls: "https://127.0.0.1:2379,https://{{ ansible_default_ipv4.address }}:2379" | ||
advertise-client-urls: "https://{{ ansible_default_ipv4.address }}:2379" | ||
listen-peer-urls: "https://{{ ansible_default_ipv4.address }}:2380" | ||
initial-advertise-peer-urls: "https://{{ ansible_default_ipv4.address }}:2380" | ||
{% if inventory_hostname == hostvars[groups['k8s_masters'][0]]['inventory_hostname'] %} | ||
initial-cluster: "{{ hostvars[groups['k8s_masters'][0]]['inventory_hostname'] }}=https://{{ hostvars[groups['k8s_masters'][0]]['ansible_default_ipv4']['address'] }}:2380" | ||
{% elif inventory_hostname == hostvars[groups['k8s_masters'][1]]['inventory_hostname'] %} | ||
initial-cluster: "{{ hostvars[groups['k8s_masters'][0]]['inventory_hostname'] }}=https://{{ hostvars[groups['k8s_masters'][0]]['ansible_default_ipv4']['address'] }}:2380,{{ hostvars[groups['k8s_masters'][1]]['inventory_hostname'] }}=https://{{ hostvars[groups['k8s_masters'][1]]['ansible_default_ipv4']['address'] }}:2380" | ||
{% elif inventory_hostname == hostvars[groups['k8s_masters'][2]]['inventory_hostname'] %} | ||
initial-cluster: "{{ hostvars[groups['k8s_masters'][0]]['inventory_hostname'] }}=https://{{ hostvars[groups['k8s_masters'][0]]['ansible_default_ipv4']['address'] }}:2380,{{ hostvars[groups['k8s_masters'][1]]['inventory_hostname'] }}=https://{{ hostvars[groups['k8s_masters'][1]]['ansible_default_ipv4']['address'] }}:2380,{{ hostvars[groups['k8s_masters'][2]]['inventory_hostname'] }}=https://{{ hostvars[groups['k8s_masters'][2]]['ansible_default_ipv4']['address'] }}:2380" | ||
{% endif %} | ||
{% if inventory_hostname != hostvars[groups['k8s_masters'][0]]['inventory_hostname'] %} | ||
initial-cluster-state: existing | ||
{% endif %} | ||
serverCertSANs: | ||
- {{ inventory_hostname }} | ||
- {{ ansible_default_ipv4.address }} | ||
peerCertSANs: | ||
- {{ inventory_hostname }} | ||
- {{ ansible_default_ipv4.address }} | ||
{% endif %} | ||
networking: | ||
# This CIDR is a Calico default. Substitute or remove for your CNI provider. | ||
podSubnet: "{{ __pod_subnet }}" | ||
{% if inventory_hostname != hostvars[groups['k8s_masters'][0]]['inventory_hostname'] %} | ||
--- | ||
apiVersion: kubeadm.k8s.io/v1beta2 | ||
kind: InitConfiguration | ||
kubernetesVersion: v{{ __kubernetes_version }} | ||
apiServer: | ||
{% if enable_pod_security is defined %} | ||
extraArgs: | ||
enable-admission-plugins: PodSecurityPolicy | ||
{% endif %} | ||
{% if single_node_installation is not defined %} | ||
certSANS: | ||
- "{{ __load_balancer_dns }}" | ||
controlPlaneEndpoint: "{{ __load_balancer_dns }}:6443" | ||
etcd: | ||
local: | ||
extraArgs: | ||
listen-client-urls: "https://127.0.0.1:2379,https://{{ ansible_default_ipv4.address }}:2379" | ||
advertise-client-urls: "https://{{ ansible_default_ipv4.address }}:2379" | ||
listen-peer-urls: "https://{{ ansible_default_ipv4.address }}:2380" | ||
initial-advertise-peer-urls: "https://{{ ansible_default_ipv4.address }}:2380" | ||
{% if inventory_hostname == hostvars[groups['k8s_masters'][0]]['inventory_hostname'] %} | ||
initial-cluster: "{{ hostvars[groups['k8s_masters'][0]]['inventory_hostname'] }}=https://{{ hostvars[groups['k8s_masters'][0]]['ansible_default_ipv4']['address'] }}:2380" | ||
{% elif inventory_hostname == hostvars[groups['k8s_masters'][1]]['inventory_hostname'] %} | ||
initial-cluster: "{{ hostvars[groups['k8s_masters'][0]]['inventory_hostname'] }}=https://{{ hostvars[groups['k8s_masters'][0]]['ansible_default_ipv4']['address'] }}:2380,{{ hostvars[groups['k8s_masters'][1]]['inventory_hostname'] }}=https://{{ hostvars[groups['k8s_masters'][1]]['ansible_default_ipv4']['address'] }}:2380" | ||
{% elif inventory_hostname == hostvars[groups['k8s_masters'][2]]['inventory_hostname'] %} | ||
initial-cluster: "{{ hostvars[groups['k8s_masters'][0]]['inventory_hostname'] }}=https://{{ hostvars[groups['k8s_masters'][0]]['ansible_default_ipv4']['address'] }}:2380,{{ hostvars[groups['k8s_masters'][1]]['inventory_hostname'] }}=https://{{ hostvars[groups['k8s_masters'][1]]['ansible_default_ipv4']['address'] }}:2380,{{ hostvars[groups['k8s_masters'][2]]['inventory_hostname'] }}=https://{{ hostvars[groups['k8s_masters'][2]]['ansible_default_ipv4']['address'] }}:2380" | ||
{% endif %} | ||
{% if inventory_hostname != hostvars[groups['k8s_masters'][0]]['inventory_hostname'] %} | ||
initial-cluster-state: existing | ||
{% endif %} | ||
serverCertSANs: | ||
- {{ inventory_hostname }} | ||
- {{ ansible_default_ipv4.address }} | ||
peerCertSANs: | ||
- {{ inventory_hostname }} | ||
- {{ ansible_default_ipv4.address }} | ||
{% endif %} | ||
networking: | ||
# This CIDR is a Calico default. Substitute or remove for your CNI provider. | ||
podSubnet: "{{ __pod_subnet }}" | ||
{% endif %} |
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