Merge branch 'development' into 'master'
chore: release fixes to stable See merge request nofusscomputing/projects/ansible/collections/kubernetes!43
This commit is contained in:
@ -1 +0,0 @@
|
|||||||
galaxy.yml galaxy[version-incorrect]
|
|
3
.gitignore
vendored
Normal file
3
.gitignore
vendored
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
artifacts/
|
||||||
|
build/
|
||||||
|
*.tar.gz
|
14
README.md
14
README.md
@ -14,26 +14,26 @@
|
|||||||
|
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
  [](https://gitlab.com/nofusscomputing/projects/ansible/kubernetes/-/issues)
|
  [](https://gitlab.com/nofusscomputing/projects/ansible/collections/kubernetes/-/issues)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
  
|
  
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
This project is hosted on [gitlab](https://gitlab.com/nofusscomputing/projects/ansible/kubernetes) and has a read-only copy hosted on [Github](https://github.com/NofussComputing/ansible_collection_kubernetes).
|
This project is hosted on [gitlab](https://gitlab.com/nofusscomputing/projects/ansible/collections/kubernetes) and has a read-only copy hosted on [Github](https://github.com/NofussComputing/ansible_collection_kubernetes).
|
||||||
|
|
||||||
----
|
----
|
||||||
|
|
||||||
**Stable Branch**
|
**Stable Branch**
|
||||||
|
|
||||||
 
|
 
|
||||||
|
|
||||||
----
|
----
|
||||||
|
|
||||||
**Development Branch**
|
**Development Branch**
|
||||||
|
|
||||||
 
|
 
|
||||||
|
|
||||||
----
|
----
|
||||||
<br>
|
<br>
|
||||||
@ -42,14 +42,14 @@ This project is hosted on [gitlab](https://gitlab.com/nofusscomputing/projects/a
|
|||||||
|
|
||||||
links:
|
links:
|
||||||
|
|
||||||
- [Issues](https://gitlab.com/nofusscomputing/projects/ansible/kubernetes/-/issues)
|
- [Issues](https://gitlab.com/nofusscomputing/projects/ansible/collections/kubernetes/-/issues)
|
||||||
|
|
||||||
- [Merge Requests (Pull Requests)](https://gitlab.com/nofusscomputing/projects/ansible/kubernetes/-/merge_requests)
|
- [Merge Requests (Pull Requests)](https://gitlab.com/nofusscomputing/projects/ansible/collections/kubernetes/-/merge_requests)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## Contributing
|
## Contributing
|
||||||
All contributions for this project must conducted from [Gitlab](https://gitlab.com/nofusscomputing/projects/ansible/kubernetes).
|
All contributions for this project must conducted from [Gitlab](https://gitlab.com/nofusscomputing/projects/ansible/collections/kubernetes).
|
||||||
|
|
||||||
For further details on contributing please refer to the [contribution guide](CONTRIBUTING.md).
|
For further details on contributing please refer to the [contribution guide](CONTRIBUTING.md).
|
||||||
|
|
||||||
|
15
galaxy.yml
15
galaxy.yml
@ -44,6 +44,7 @@ tags:
|
|||||||
# L(specifiers,https://python-semanticversion.readthedocs.io/en/latest/#requirement-specification). Multiple version
|
# L(specifiers,https://python-semanticversion.readthedocs.io/en/latest/#requirement-specification). Multiple version
|
||||||
# range specifiers can be set and are separated by ','
|
# range specifiers can be set and are separated by ','
|
||||||
dependencies:
|
dependencies:
|
||||||
|
ansible.posix: '1.5.4'
|
||||||
kubernetes.core: '3.0.0'
|
kubernetes.core: '3.0.0'
|
||||||
|
|
||||||
|
|
||||||
@ -64,17 +65,17 @@ issues: https://gitlab.com/nofusscomputing/projects/ansible/collections/kubernet
|
|||||||
# uses 'fnmatch' to match the files or directories. Some directories and files like 'galaxy.yml', '*.pyc', '*.retry',
|
# uses 'fnmatch' to match the files or directories. Some directories and files like 'galaxy.yml', '*.pyc', '*.retry',
|
||||||
# and '.git' are always filtered. Mutually exclusive with 'manifest'
|
# and '.git' are always filtered. Mutually exclusive with 'manifest'
|
||||||
build_ignore:
|
build_ignore:
|
||||||
- .vscode/
|
- .vscode
|
||||||
- artifacts/
|
- artifacts
|
||||||
- docs/
|
- docs
|
||||||
- .gitlab*
|
- .git*
|
||||||
- includes/
|
- gitlab-ci
|
||||||
- website-template/
|
- website-template
|
||||||
- .ansible-lint-ignore
|
- .ansible-lint-ignore
|
||||||
- .cz.yaml
|
- .cz.yaml
|
||||||
- .nfc_automation.yaml
|
- .nfc_automation.yaml
|
||||||
- dockerfile
|
- dockerfile
|
||||||
- mkdocs.yaml
|
- mkdocs.yml
|
||||||
|
|
||||||
# A dict controlling use of manifest directives used in building the collection artifact. The key 'directives' is a
|
# A dict controlling use of manifest directives used in building the collection artifact. The key 'directives' is a
|
||||||
# list of MANIFEST.in style
|
# list of MANIFEST.in style
|
||||||
|
@ -1,31 +1,13 @@
|
|||||||
---
|
---
|
||||||
- name: "restart ContainerD"
|
|
||||||
service:
|
|
||||||
name: containerd
|
|
||||||
state: restarted
|
|
||||||
when: >
|
|
||||||
containerd_config.changed | default(false) | bool
|
|
||||||
and
|
|
||||||
containerd_installed.rc | default(1) | int == 0
|
|
||||||
and
|
|
||||||
kubernetes_type == 'k8s'
|
|
||||||
tags:
|
|
||||||
- configure
|
|
||||||
- install
|
|
||||||
|
|
||||||
|
|
||||||
- name: Restart Kubernetes
|
- name: Restart Kubernetes
|
||||||
ansible.builtin.service:
|
ansible.builtin.service:
|
||||||
name: |-
|
name: |-
|
||||||
{%- if kubernetes_type == 'k3s' -%}
|
{%- if nfc_role_kubernetes_master | default(false) | bool -%}
|
||||||
{%- if Kubernetes_Master | default(false) | bool -%}
|
k3s
|
||||||
k3s
|
|
||||||
{%- else -%}
|
|
||||||
k3s-agent
|
|
||||||
{%- endif -%}
|
|
||||||
{%- else -%}
|
{%- else -%}
|
||||||
kubelet
|
k3s-agent
|
||||||
{%- endif %}
|
{%- endif -%}
|
||||||
state: restarted
|
state: restarted
|
||||||
listen: kubernetes_restart
|
listen: kubernetes_restart
|
||||||
when: |-
|
when: |-
|
||||||
@ -33,19 +15,19 @@
|
|||||||
nfc_kubernetes_no_restart
|
nfc_kubernetes_no_restart
|
||||||
or
|
or
|
||||||
(
|
(
|
||||||
inventory_hostname in groups['kubernetes_master']
|
nfc_role_kubernetes_master
|
||||||
and
|
and
|
||||||
nfc_kubernetes_no_restart_master
|
nfc_kubernetes_no_restart_master
|
||||||
)
|
)
|
||||||
or
|
or
|
||||||
(
|
(
|
||||||
inventory_hostname == kubernetes_config.cluster.prime.name
|
inventory_hostname == kubernetes_config.cluster.prime.name | default(inventory_hostname)
|
||||||
and
|
and
|
||||||
nfc_kubernetes_no_restart_prime
|
nfc_kubernetes_no_restart_prime
|
||||||
)
|
)
|
||||||
or
|
or
|
||||||
(
|
(
|
||||||
inventory_hostname in groups['kubernetes_worker']
|
nfc_role_kubernetes_worker
|
||||||
and
|
and
|
||||||
nfc_kubernetes_no_restart_slave
|
nfc_kubernetes_no_restart_slave
|
||||||
)
|
)
|
||||||
|
@ -39,7 +39,16 @@
|
|||||||
- src: iptables-kubernetes.rules.j2
|
- src: iptables-kubernetes.rules.j2
|
||||||
dest: "/etc/iptables.rules.d/iptables-kubernetes.rules"
|
dest: "/etc/iptables.rules.d/iptables-kubernetes.rules"
|
||||||
notify: firewall_reloader
|
notify: firewall_reloader
|
||||||
when: "{{ firewall_rules_dir_metadata.stat.exists }}"
|
when: |-
|
||||||
|
{%- if nfc_kubernetes.enable_firewall -%}
|
||||||
|
|
||||||
|
{{ firewall_rules_dir_metadata.stat.exists }}
|
||||||
|
|
||||||
|
{%- else -%}
|
||||||
|
|
||||||
|
false
|
||||||
|
|
||||||
|
{%- endif %}
|
||||||
|
|
||||||
|
|
||||||
- name: Add Kubernetes Node Labels
|
- name: Add Kubernetes Node Labels
|
||||||
|
@ -21,10 +21,10 @@
|
|||||||
loop_var: package
|
loop_var: package
|
||||||
vars:
|
vars:
|
||||||
packages:
|
packages:
|
||||||
- name: curl
|
- curl
|
||||||
- name: iptables
|
- iptables
|
||||||
- name: jq
|
- jq
|
||||||
- name: wireguard
|
- wireguard
|
||||||
|
|
||||||
|
|
||||||
- name: Remove swapfile from /etc/fstab
|
- name: Remove swapfile from /etc/fstab
|
||||||
|
@ -61,7 +61,7 @@
|
|||||||
|
|
||||||
{%- if kubernetes_host != '' -%}
|
{%- if kubernetes_host != '' -%}
|
||||||
|
|
||||||
{%- for master_host in groups['kubernetes_master'] -%}
|
{%- for master_host in groups['kubernetes_master'] | default([]) -%}
|
||||||
|
|
||||||
{%- if master_host in groups[kubernetes_config.cluster.group_name | default('me_is_optional')] | default([]) -%}
|
{%- if master_host in groups[kubernetes_config.cluster.group_name | default('me_is_optional')] | default([]) -%}
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
{%- if
|
{%- if
|
||||||
inventory_hostname in groups['kubernetes_master']
|
nfc_role_kubernetes_master
|
||||||
or
|
or
|
||||||
kubernetes_config.cluster.prime.name | default(inventory_hostname) == inventory_hostname
|
kubernetes_config.cluster.prime.name | default(inventory_hostname) == inventory_hostname
|
||||||
-%}
|
-%}
|
||||||
@ -128,6 +128,16 @@
|
|||||||
|
|
||||||
{# SoF All Nodes #}
|
{# SoF All Nodes #}
|
||||||
|
|
||||||
|
{%- if inventory_hostname == 'localhost' -%}
|
||||||
|
|
||||||
|
{%- set node_name = hostname_to_check.stdout -%}
|
||||||
|
|
||||||
|
{%- else -%}
|
||||||
|
|
||||||
|
{%- set node_name = inventory_hostnamet -%}
|
||||||
|
|
||||||
|
{%- endif -%}
|
||||||
|
|
||||||
{%
|
{%
|
||||||
|
|
||||||
set all_nodes_config = {
|
set all_nodes_config = {
|
||||||
@ -135,7 +145,7 @@
|
|||||||
"system-reserved=cpu=" + kubelet_arg_system_reserved_cpu + ",memory=" + kubelet_arg_system_reserved_memory +
|
"system-reserved=cpu=" + kubelet_arg_system_reserved_cpu + ",memory=" + kubelet_arg_system_reserved_memory +
|
||||||
",ephemeral-storage=" + kubelet_arg_system_reserved_storage
|
",ephemeral-storage=" + kubelet_arg_system_reserved_storage
|
||||||
],
|
],
|
||||||
"node-name": inventory_hostname,
|
"node-name": node_name,
|
||||||
}
|
}
|
||||||
|
|
||||||
-%}
|
-%}
|
||||||
@ -149,7 +159,7 @@
|
|||||||
|
|
||||||
{%- for cluster_node in groups[kubernetes_config.cluster.group_name] -%}
|
{%- for cluster_node in groups[kubernetes_config.cluster.group_name] -%}
|
||||||
|
|
||||||
{%- if cluster_node in groups['kubernetes_master'] -%}
|
{%- if cluster_node in groups['kubernetes_master'] | default([]) -%}
|
||||||
|
|
||||||
{%- if hostvars[cluster_node].host_external_ip is defined -%}
|
{%- if hostvars[cluster_node].host_external_ip is defined -%}
|
||||||
|
|
||||||
@ -228,7 +238,7 @@
|
|||||||
|
|
||||||
|
|
||||||
{%- if
|
{%- if
|
||||||
inventory_hostname in groups['kubernetes_master']
|
nfc_role_kubernetes_master
|
||||||
or
|
or
|
||||||
kubernetes_config.cluster.prime.name | default(inventory_hostname) == inventory_hostname
|
kubernetes_config.cluster.prime.name | default(inventory_hostname) == inventory_hostname
|
||||||
-%}
|
-%}
|
||||||
|
Reference in New Issue
Block a user