Merge branch 'development' into 'master'

chore: release fixes to stable

See merge request nofusscomputing/projects/ansible/collections/kubernetes!43
This commit is contained in:
2024-03-13 16:15:49 +00:00
9 changed files with 54 additions and 50 deletions

View File

@ -1 +0,0 @@
galaxy.yml galaxy[version-incorrect]

3
.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
artifacts/
build/
*.tar.gz

View File

@ -14,26 +14,26 @@
<br> <br>
![Gitlab forks count](https://img.shields.io/badge/dynamic/json?label=Forks&query=%24.forks_count&url=https%3A%2F%2Fgitlab.com%2Fapi%2Fv4%2Fprojects%2F51640029%2F&color=ff782e&logo=gitlab&style=plastic) ![Gitlab stars](https://img.shields.io/badge/dynamic/json?label=Stars&query=%24.star_count&url=https%3A%2F%2Fgitlab.com%2Fapi%2Fv4%2Fprojects%2F51640029%2F&color=ff782e&logo=gitlab&style=plastic) [![Open Issues](https://img.shields.io/badge/dynamic/json?color=ff782e&logo=gitlab&style=plastic&label=Open%20Issues&query=%24.statistics.counts.opened&url=https%3A%2F%2Fgitlab.com%2Fapi%2Fv4%2Fprojects%2F51640029%2Fissues_statistics)](https://gitlab.com/nofusscomputing/projects/ansible/kubernetes/-/issues) ![Gitlab forks count](https://img.shields.io/badge/dynamic/json?label=Forks&query=%24.forks_count&url=https%3A%2F%2Fgitlab.com%2Fapi%2Fv4%2Fprojects%2F51640029%2F&color=ff782e&logo=gitlab&style=plastic) ![Gitlab stars](https://img.shields.io/badge/dynamic/json?label=Stars&query=%24.star_count&url=https%3A%2F%2Fgitlab.com%2Fapi%2Fv4%2Fprojects%2F51640029%2F&color=ff782e&logo=gitlab&style=plastic) [![Open Issues](https://img.shields.io/badge/dynamic/json?color=ff782e&logo=gitlab&style=plastic&label=Open%20Issues&query=%24.statistics.counts.opened&url=https%3A%2F%2Fgitlab.com%2Fapi%2Fv4%2Fprojects%2F51640029%2Fissues_statistics)](https://gitlab.com/nofusscomputing/projects/ansible/collections/kubernetes/-/issues)
![GitHub forks](https://img.shields.io/github/forks/NofussComputing/ansible_collection_kubernetes?logo=github&style=plastic&color=000000&labell=Forks) ![GitHub stars](https://img.shields.io/github/stars/NofussComputing/ansible_collection_kubernetes?color=000000&logo=github&style=plastic) ![Github Watchers](https://img.shields.io/github/watchers/NofussComputing/ansible_collection_kubernetes?color=000000&label=Watchers&logo=github&style=plastic) ![GitHub forks](https://img.shields.io/github/forks/NofussComputing/ansible_collection_kubernetes?logo=github&style=plastic&color=000000&labell=Forks) ![GitHub stars](https://img.shields.io/github/stars/NofussComputing/ansible_collection_kubernetes?color=000000&logo=github&style=plastic) ![Github Watchers](https://img.shields.io/github/watchers/NofussComputing/ansible_collection_kubernetes?color=000000&label=Watchers&logo=github&style=plastic)
<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**
![Gitlab build status - stable](https://img.shields.io/badge/dynamic/json?color=ff782e&label=Build&query=0.status&url=https%3A%2F%2Fgitlab.com%2Fapi%2Fv4%2Fprojects%2F51640029%2Fpipelines%3Fref%3Dmaster&logo=gitlab&style=plastic) ![branch release version](https://img.shields.io/badge/dynamic/yaml?color=ff782e&logo=gitlab&style=plastic&label=Release&query=%24.commitizen.version&url=https%3A//gitlab.com/nofusscomputing/projects/ansible/kubernetes%2F-%2Fraw%2Fmaster%2F.cz.yaml) ![Gitlab build status - stable](https://img.shields.io/badge/dynamic/json?color=ff782e&label=Build&query=0.status&url=https%3A%2F%2Fgitlab.com%2Fapi%2Fv4%2Fprojects%2F51640029%2Fpipelines%3Fref%3Dmaster&logo=gitlab&style=plastic) ![branch release version](https://img.shields.io/badge/dynamic/yaml?color=ff782e&logo=gitlab&style=plastic&label=Release&query=%24.commitizen.version&url=https%3A//gitlab.com/nofusscomputing/projects/ansible/collections/kubernetes%2F-%2Fraw%2Fmaster%2F.cz.yaml)
---- ----
**Development Branch** **Development Branch**
![Gitlab build status - development](https://img.shields.io/badge/dynamic/json?color=ff782e&label=Build&query=0.status&url=https%3A%2F%2Fgitlab.com%2Fapi%2Fv4%2Fprojects%2F51640029%2Fpipelines%3Fref%3Ddevelopment&logo=gitlab&style=plastic) ![branch release version](https://img.shields.io/badge/dynamic/yaml?color=ff782e&logo=gitlab&style=plastic&label=Release&query=%24.commitizen.version&url=https%3A//gitlab.com/nofusscomputing/projects/ansible/kubernetes%2F-%2Fraw%2Fdevelopment%2F.cz.yaml) ![Gitlab build status - development](https://img.shields.io/badge/dynamic/json?color=ff782e&label=Build&query=0.status&url=https%3A%2F%2Fgitlab.com%2Fapi%2Fv4%2Fprojects%2F51640029%2Fpipelines%3Fref%3Ddevelopment&logo=gitlab&style=plastic) ![branch release version](https://img.shields.io/badge/dynamic/yaml?color=ff782e&logo=gitlab&style=plastic&label=Release&query=%24.commitizen.version&url=https%3A//gitlab.com/nofusscomputing/projects/ansible/collections/kubernetes%2F-%2Fraw%2Fdevelopment%2F.cz.yaml)
---- ----
<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).

View File

@ -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

View File

@ -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
) )

View File

@ -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

View File

@ -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

View File

@ -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([]) -%}

View File

@ -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
-%} -%}