feat: install helm binary

!35
This commit is contained in:
2024-03-13 15:27:36 +09:30
parent 6a10eb22cc
commit 29a9e696a9
4 changed files with 51 additions and 0 deletions

View File

@ -32,6 +32,8 @@ nfc_role_kubernetes_etcd_enabled: false
nfc_role_kubernetes_install_olm: false
nfc_role_kubernetes_install_helm: true
nfc_role_kubernetes_install_kubevirt: false
nfc_role_kubernetes_kubevirt_operator_replicas: 1
@ -151,6 +153,10 @@ k3s:
# ServiceSubnet: 172.16.72.0/24 # Mandatory, String. CIDR
#
#
# helm:
# enabled: true # Optional, Boolean. default=false. Install Helm Binary
#
#
# kube_virt:
# enabled: false # Optional, Boolean. default=false. Install KubeVirt
#

View File

@ -68,6 +68,8 @@ This Ansible role is designed to deploy a K3s Kubernetes cluster. Without adding
> `kubectl virt ....` instead of `virtctl ....`
- Install the Helm Binary
## Role Workflow

27
tasks/helm/main.yaml Normal file
View File

@ -0,0 +1,27 @@
---
- name: Fetch Helm APT Key
ansible.builtin.get_url:
url: https://baltocdn.com/helm/signing.asc
dest: /usr/share/keyrings/helm.asc
mode: 740
- name: Add Helm Repository
ansible.builtin.apt_repository:
repo: >-
deb [arch={%- if ansible_architecture == 'aarch64' -%}
arm64
{%- else -%}
amd64
{%- endif %} signed-by=/usr/share/keyrings/helm.asc] http://baltocdn.com/helm/stable/{{
ansible_os_family | lower }}/ all main
state: present
filename: helm
- name: Install Helm
ansible.builtin.apt:
package:
- helm
state: present

View File

@ -83,3 +83,19 @@
inventory_hostname in kubernetes_config.kube_virt.nodes | default([ inventory_hostname ]) | list
tags:
- always
- name: Helm
ansible.builtin.include_tasks:
file: helm/main.yaml
apply:
tags:
- always
when: >
kubernetes_installed | default(false) | bool
and
kubernetes_config.helm.enabled | default(nfc_role_kubernetes_install_helm)
and
nfc_role_kubernetes_master
tags:
- always