Skip to content

Commit

Permalink
Merge pull request #14 from paradeum-team/jyliu
Browse files Browse the repository at this point in the history
feat: helm 更新到 3.7.1, 公网安装 K8s 适配 Rocky Linux 8.5
  • Loading branch information
ss75710541 authored May 13, 2022
2 parents 1a6f547 + 5bcdc0a commit 48ec58e
Show file tree
Hide file tree
Showing 12 changed files with 26 additions and 10 deletions.
4 changes: 2 additions & 2 deletions ansible.hosts.ha.publicnetwork.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ service_subnet=10.96.0.0/12
pod_subnet=10.128.0.0/16

# helm
helm_binary_md5=e4500993ba21e5e6bdfbc084b4342025
helm_binary_url=https://pnode.solarfs.io/dn/file/{{helm_binary_md5}}/helm-v3.6.0-linux-amd64.tar.gz
helm_binary_md5=77b16cb0ebc6266ac98fc9f2285e361f
helm_binary_url=https://pnode.solarfs.io/dn/file/{{helm_binary_md5}}/helm-v3.7.1-linux-amd64.tar.gz

# os id, centos|ubuntu
OS_ID="centos"
Expand Down
4 changes: 2 additions & 2 deletions ansible.hosts.ha.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ service_subnet=10.96.0.0/12
pod_subnet=10.128.0.0/16

# helm
helm_binary_md5=e4500993ba21e5e6bdfbc084b4342025
helm_binary_url=https://pnode.solarfs.io/dn/file/{{helm_binary_md5}}/helm-v3.6.0-linux-amd64.tar.gz
helm_binary_md5=77b16cb0ebc6266ac98fc9f2285e361f
helm_binary_url=https://pnode.solarfs.io/dn/file/{{helm_binary_md5}}/helm-v3.7.1-linux-amd64.tar.gz

# os id, centos|ubuntu
OS_ID="centos"
Expand Down
4 changes: 2 additions & 2 deletions ansible.hosts.ha.vip.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ ingress_nodeport_http=32080
ingress_nodeport_https=32443

# helm
helm_binary_md5=e4500993ba21e5e6bdfbc084b4342025
helm_binary_url=https://pnode.solarfs.io/dn/file/{{helm_binary_md5}}/helm-v3.6.0-linux-amd64.tar.gz
helm_binary_md5=77b16cb0ebc6266ac98fc9f2285e361f
helm_binary_url=https://pnode.solarfs.io/dn/file/{{helm_binary_md5}}/helm-v3.7.1-linux-amd64.tar.gz

# os id, centos|ubuntu
OS_ID="centos"
Expand Down
4 changes: 2 additions & 2 deletions ansible.hosts.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ service_subnet=10.96.0.0/12
pod_subnet=10.128.0.0/16

# helm
helm_binary_md5=24b16800f8c7f44b5dd128e3355ecf1b
helm_binary_url=https://pnode.solarfs.io/dn/file/{{helm_binary_md5}}/helm-v3.6.3-linux-amd64.tar.gz
helm_binary_md5=77b16cb0ebc6266ac98fc9f2285e361f
helm_binary_url=https://pnode.solarfs.io/dn/file/{{helm_binary_md5}}/helm-v3.7.1-linux-amd64.tar.gz

# os id, centos|ubuntu
OS_ID="centos"
Expand Down
2 changes: 1 addition & 1 deletion roles/host-init/tasks/publicInterface.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
service: name=NetworkManager state=started enabled=yes

- name: Configure the public network card
shell: nmcli connection add type tun ifname pip0 con-name pip0 mode tap ip4 {{ advertise_address }}/24
shell: nmcli connection add type tun ifname pip0 con-name pip0 mode tap ip4 {{ advertise_address }}/32
tags: publicNetwork
2 changes: 1 addition & 1 deletion roles/host-init/tasks/update.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
- name: yum update
command: yum update -y
command: yum update -y --exclude=kubelet --exclude=kubeadm --exclude=docker --exclude=runc
tags: yum-update
when: OS_ID == "centos"

Expand Down
5 changes: 5 additions & 0 deletions roles/k8s-masters/handlers/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,8 @@

- name: restart coredns
shell: "kubectl rollout restart deploy coredns -n kube-system"
become: yes

- name: restart kubelet
service: name=kubelet state=restarted
become: yes
4 changes: 4 additions & 0 deletions roles/k8s-masters/tasks/kubelet.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
- name: config /etc/sysconfig/kubelet
template: src=kubelet.j2 dest=/etc/sysconfig/kubelet mode=0644
tags: join-node
1 change: 1 addition & 0 deletions roles/k8s-masters/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
- include: apiServerDns.yml
- include: kubeadmInit.yml
when: hostvars[ groups['masters'][0] ].inventory_hostname == inventory_hostname
- include: kubelet.yml
- include: joinControlPlane.yml
- include: kube-flannel.yml
when: hostvars[ groups['masters'][0] ].inventory_hostname == inventory_hostname and flannel_enable == True
Expand Down
1 change: 1 addition & 0 deletions roles/k8s-masters/templates/kubelet.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
KUBELET_EXTRA_ARGS="--node-ip {{ advertise_address }}"
4 changes: 4 additions & 0 deletions roles/k8s-nodes/tasks/joinNode.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
register: check_kubelet_conf
tags: join-node

- name: config /etc/sysconfig/kubelet
template: src=kubelet.j2 dest=/etc/sysconfig/kubelet mode=0644
tags: join-node

- name: join k8s nodes
command: "{{hostvars[ groups['masters'][0] ].join_command.stdout}}"
when: check_kubelet_conf.stat.exists == False and public_network_node == False
Expand Down
1 change: 1 addition & 0 deletions roles/k8s-nodes/templates/kubelet.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
KUBELET_EXTRA_ARGS="--node-ip {{ advertise_address }}"

0 comments on commit 48ec58e

Please sign in to comment.