[multus] Update to common-v3 (#1040)

* [multus] Update to common-v3

Co-authored-by: angelnu <git@angelnucom>
This commit is contained in:
Angel Nunez Mencias 2021-06-22 10:47:56 +02:00 committed by GitHub
parent 1659f3c867
commit d4bfcc43a8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 129 additions and 90 deletions

View File

@ -2,7 +2,7 @@ apiVersion: v2
appVersion: v3.7.1
description: multus CNI allows multiple NICs per pod
name: multus
version: 1.1.0
version: 2.0.0
kubeVersion: ">=1.16.0-0"
keywords:
- multus
@ -16,4 +16,4 @@ maintainers:
dependencies:
- name: common
repository: https://library-charts.k8s-at-home.com
version: 2.5.0
version: 3.2.0

View File

@ -1,6 +1,6 @@
# multus
![Version: 1.1.0](https://img.shields.io/badge/Version-1.1.0-informational?style=flat-square) ![AppVersion: v3.7.1](https://img.shields.io/badge/AppVersion-v3.7.1-informational?style=flat-square)
![Version: 2.0.0](https://img.shields.io/badge/Version-2.0.0-informational?style=flat-square) ![AppVersion: v3.7.1](https://img.shields.io/badge/AppVersion-v3.7.1-informational?style=flat-square)
multus CNI allows multiple NICs per pod
@ -18,7 +18,7 @@ Kubernetes: `>=1.16.0-0`
| Repository | Name | Version |
|------------|------|---------|
| https://library-charts.k8s-at-home.com | common | 2.5.0 |
| https://library-charts.k8s-at-home.com | common | 3.2.0 |
## TL;DR
@ -91,33 +91,20 @@ rm -rf /var/lib/rancher/k3s/agent/etc/cni/net.d/*multus*
| Key | Type | Default | Description |
|-----|------|---------|-------------|
| additionalVolumeMounts[0].mountPath | string | `"/host/etc/cni/net.d"` | |
| additionalVolumeMounts[0].name | string | `"cni"` | |
| additionalVolumeMounts[1].mountPath | string | `"/host/opt/cni/bin"` | |
| additionalVolumeMounts[1].name | string | `"cnibin"` | |
| additionalVolumes[0].hostPath.path | string | `"/var/lib/rancher/k3s/agent/etc/cni/net.d"` | |
| additionalVolumes[0].hostPath.type | string | `"Directory"` | |
| additionalVolumes[0].name | string | `"cni"` | |
| additionalVolumes[1].hostPath.path | string | `"/var/lib/rancher/k3s/data/current/bin"` | |
| additionalVolumes[1].hostPath.type | string | `"Directory"` | |
| additionalVolumes[1].name | string | `"cnibin"` | |
| args[0] | string | `"--multus-conf-file=auto"` | |
| args[1] | string | `"--cleanup-config-on-exit=true"` | |
| args[2] | string | `"--cni-version=0.3.1"` | |
| args[3] | string | `"--multus-kubeconfig-file-host=/var/lib/rancher/k3s/agent/etc/cni/net.d/multus.d/multus.kubeconfig"` | |
| command[0] | string | `"/entrypoint.sh"` | |
| controllerType | string | `"daemonset"` | |
| image.pullPolicy | string | `"IfNotPresent"` | |
| image.repository | string | `"ghcr.io/k8snetworkplumbingwg/multus-cni"` | |
| image.tag | string | `"v3.7.1"` | |
| args | list | `["--multus-conf-file=auto","--cleanup-config-on-exit=true","--cni-version=0.3.1","--multus-kubeconfig-file-host=/var/lib/rancher/k3s/agent/etc/cni/net.d/multus.d/multus.kubeconfig"]` | Arguments used by the Multus installer. See https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/docs/how-to-use.md If you are not using k3s you will need to adjust the multus-kubeconfig. |
| command | list | `["/entrypoint.sh"]` | Command used by the Multus installer |
| controller.type | string | `"daemonset"` | deploy to all nodes |
| image.pullPolicy | string | `"IfNotPresent"` | image pull policy |
| image.repository | string | `"ghcr.io/k8snetworkplumbingwg/multus-cni"` | image repostory |
| image.tag | string | `"v3.7.1"` | image tag |
| initContainers | list | `[{"image":"ghcr.io/k8s-at-home/cni-plugins:v0.9.1","name":"cni-installer","volumeMounts":[{"mountPath":"/host/opt/cni/bin","name":"cnibin"}]}]` | Init container that install reference CNI plugins |
| probes.liveness.enabled | bool | `false` | |
| probes.readiness.enabled | bool | `false` | |
| probes.startup.enabled | bool | `false` | |
| securityContext.privileged | bool | `true` | |
| service.enabled | bool | `false` | |
| serviceAccount.create | bool | `true` | |
| strategy.type | string | `"RollingUpdate"` | |
| initContainers[0].image | string | `"ghcr.io/k8s-at-home/cni-plugins:v0.9.1"` | CNI installer image |
| initContainers[0].volumeMounts | list | see values.yaml | Mounts host CNI binary folder |
| persistence | object | see values.yaml | Configures volumes used by the multus installer. Set by default for k3s. |
| probes | object | see values.yaml | Disable probes as installer completes after installing |
| securityContext | object | `{"privileged":true}` | Need to run as privileged to install |
| service | object | see values.yaml | Disable probes as installer completes after installing |
| serviceAccount.create | bool | `true` | create needed service account |
## Changelog
@ -125,6 +112,13 @@ All notable changes to this application Helm chart will be documented in this fi
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
### [2.0.0]
#### Changed
- **BREAKING**: Upgraded the common library dependency to version 3.2.0. This introduces several breaking changes (`service`, `ingress` and `persistence` keys have been refactored).
Be sure to check out the [library chart](https://github.com/k8s-at-home/library-charts/blob/common-3.2.0/charts/stable/common/) for the up-to-date values.
### [1.0.0]
#### Added

View File

@ -9,6 +9,13 @@ All notable changes to this application Helm chart will be documented in this fi
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
### [2.0.0]
#### Changed
- **BREAKING**: Upgraded the common library dependency to version 3.2.0. This introduces several breaking changes (`service`, `ingress` and `persistence` keys have been refactored).
Be sure to check out the [library chart](https://github.com/k8s-at-home/library-charts/blob/common-3.2.0/charts/stable/common/) for the up-to-date values.
### [1.0.0]
#### Added

View File

@ -1,2 +1,74 @@
{{/* Make sure all variables are set properly */}}
{{- include "common.values.setup" . }}
{{/* Append the hardcoded settings */}}
{{- define "multus.harcodedValues" -}}
controller:
# -- deploy to all nodes
type: daemonset
# -- Init container that installs reference CNI plugins
initContainers:
- name: cni-installer
# -- CNI installer image
image: {{ .Values.cni.image.repository }}:{{ .Values.cni.image.tag }}
pullPolicy: {{ .Values.cni.image.pullPolicy }}
# -- Mounts host CNI binary folder
volumeMounts:
- name: cnibin
mountPath: /host/opt/cni/bin
# -- Command used by the Multus installer
command:
- /entrypoint.sh
# -- Arguments used by the Multus installer.
# See https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/docs/how-to-use.md
# If you are not using k3s you will need to adjust the multus-kubeconfig.
args:
- "--multus-conf-file=auto"
- "--cleanup-config-on-exit=true"
- "--cni-version={{ .Values.cni.version }}"
- "--multus-kubeconfig-file-host={{ .Values.cni.paths.config }}/multus.d/multus.kubeconfig"
# -- Need to run as privileged to install
securityContext:
privileged: true
# -- Configures volumes used by the multus installer.
persistence:
cni:
enabled: true
type: hostPath
hostPath: {{ .Values.cni.paths.config }}
hostPathType: Directory
mountPath: /host/etc/cni/net.d
cnibin:
enabled: true
type: hostPath
hostPath: {{ .Values.cni.paths.bin }}
hostPathType: Directory
mountPath: /host/opt/cni/bin
serviceAccount:
# -- create needed service account
create: true
# -- Disable probes as installer completes after installing
probes:
liveness:
enabled: false
readiness:
enabled: false
startup:
enabled: false
# -- Disable probes as installer completes after installing
service:
main:
enabled: false
{{- end -}}
{{- $_ := mergeOverwrite .Values (include "multus.harcodedValues" . | fromYaml) -}}
{{/* Render the templates */}}
{{ include "common.all" . }}

View File

@ -22,11 +22,11 @@ spec:
- name: remove-config
image: "alpine"
command: ["/bin/sh","-c", "rm -rf /host/etc/cni/net.d/*multus*"]
{{- with (include "common.controller.volumeMounts" . | trim) }}
volumeMounts:
{{- . | nindent 10 }}
{{- end }}
{{- with (include "common.controller.volumes" . | trim) }}
- name: cni
mountPath: /host/etc/cni/net.d
volumes:
{{- . | nindent 8 }}
{{- end }}
- name: cni
hostPath:
path: {{ .Values.cni.paths.config }}
type: Directory

View File

@ -6,64 +6,30 @@
#
image:
# -- multus installer repostory
repository: ghcr.io/k8snetworkplumbingwg/multus-cni
# -- multus installer tag
tag: v3.7.1
# -- multus installer pull policy
pullPolicy: IfNotPresent
controllerType: daemonset
cni:
image:
# -- CNI installer repostory
repository: ghcr.io/k8s-at-home/cni-plugins
# -- CNI installer tag
tag: v0.9.1
# -- CNI installer pull policy
pullPolicy: IfNotPresent
serviceAccount:
create: true
paths:
# -- CNI config folder for k3s.
# Change to `/etc/cni/net.d` for non k3s
config: /var/lib/rancher/k3s/agent/etc/cni/net.d
# -- Init container that install reference CNI plugins
initContainers:
- name: cni-installer
image: ghcr.io/k8s-at-home/cni-plugins:v0.9.1
volumeMounts:
- name: cnibin
mountPath: /host/opt/cni/bin
# -- CNI plugin binaries folder for k3s.
# Change to `/opt/cni/bin` for non k3s
bin: /var/lib/rancher/k3s/data/current/bin
command:
- /entrypoint.sh
args:
- "--multus-conf-file=auto"
- "--cleanup-config-on-exit=true"
- "--cni-version=0.3.1"
- "--multus-kubeconfig-file-host=/var/lib/rancher/k3s/agent/etc/cni/net.d/multus.d/multus.kubeconfig"
securityContext:
privileged: true
strategy:
type: RollingUpdate
additionalVolumes:
- name: cni
hostPath:
# path: /etc/cni/net.d
path: /var/lib/rancher/k3s/agent/etc/cni/net.d
type: Directory
- name: cnibin
hostPath:
# path: /opt/cni/bin
path: /var/lib/rancher/k3s/data/current/bin
type: Directory
additionalVolumeMounts:
- name: cni
mountPath: /host/etc/cni/net.d
- name: cnibin
mountPath: /host/opt/cni/bin
probes:
liveness:
enabled: false
readiness:
enabled: false
startup:
enabled: false
service:
enabled: false
# -- CNI interface version
version: "0.3.1"