This repository has been archived by the owner on Jun 29, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1555 from kinvolk/knrt10/metallb-update
metallb: Convert to Helm chart and update to latest version
- Loading branch information
Showing
23 changed files
with
1,966 additions
and
1,156 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Patterns to ignore when building packages. | ||
# This supports shell glob matching, relative path matching, and | ||
# negation (prefixed with !). Only one pattern per line. | ||
.DS_Store | ||
# Common VCS dirs | ||
.git/ | ||
.gitignore | ||
.bzr/ | ||
.bzrignore | ||
.hg/ | ||
.hgignore | ||
.svn/ | ||
# Common backup files | ||
*.swp | ||
*.bak | ||
*.tmp | ||
*.orig | ||
*~ | ||
# Various IDEs | ||
.project | ||
.idea/ | ||
*.tmproj | ||
.vscode/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
apiVersion: v2 | ||
name: metallb | ||
description: A network load-balancer implementation for Kubernetes using standard routing protocols | ||
home: https://metallb.universe.tf | ||
sources: | ||
- https://github.com/metallb/metallb | ||
icon: https://metallb.universe.tf/images/logo/metallb-white.png | ||
|
||
# A chart can be either an 'application' or a 'library' chart. | ||
# | ||
# Application charts are a collection of templates that can be packaged into versioned archives | ||
# to be deployed. | ||
# | ||
# Library charts provide useful utilities or functions for the chart developer. They're included as | ||
# a dependency of application charts to inject those utilities and functions into the rendering | ||
# pipeline. Library charts do not define any templates and therefore cannot be deployed. | ||
type: application | ||
|
||
# This is the chart version. This version number should be incremented each time you make changes | ||
# to the chart and its templates, including the app version. | ||
# Versions are expected to follow Semantic Versioning (https://semver.org/) | ||
# NOTE: this value is updated by the metallb release process | ||
version: 0.9.6 | ||
|
||
# This is the version number of the application being deployed. This version number should be | ||
# incremented each time you make changes to the application. Versions are not expected to | ||
# follow Semantic Versioning. They should reflect the version the application is using. | ||
# NOTE: this value is updated by the metallb release process | ||
appVersion: v0.9.6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
# metallb | ||
|
||
![Version: 0.9.6](https://img.shields.io/badge/Version-0.9.6-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v0.9.6](https://img.shields.io/badge/AppVersion-v0.9.6-informational?style=flat-square) | ||
|
||
A network load-balancer implementation for Kubernetes using standard routing protocols | ||
|
||
**Homepage:** <https://metallb.universe.tf> | ||
|
||
## Source Code | ||
|
||
* <https://github.com/metallb/metallb> | ||
|
||
## Values | ||
|
||
| Key | Type | Default | Description | | ||
|-----|------|---------|-------------| | ||
| configInline | object | `{}` | | | ||
| controller.affinity | object | `{}` | | | ||
| controller.enabled | bool | `true` | | | ||
| controller.image.pullPolicy | string | `nil` | | | ||
| controller.image.repository | string | `"quay.io/metallb/controller"` | | | ||
| controller.image.tag | string | `nil` | | | ||
| controller.livenessProbe.enabled | bool | `true` | | | ||
| controller.livenessProbe.failureThreshold | int | `3` | | | ||
| controller.livenessProbe.initialDelaySeconds | int | `10` | | | ||
| controller.livenessProbe.periodSeconds | int | `10` | | | ||
| controller.livenessProbe.successThreshold | int | `1` | | | ||
| controller.livenessProbe.timeoutSeconds | int | `1` | | | ||
| controller.logLevel | string | `"info"` | Controller log level. Must be one of: `all`, `debug`, `info`, `warn`, `error` or `none` | | ||
| controller.nodeSelector | object | `{}` | | | ||
| controller.podAnnotations | object | `{}` | | | ||
| controller.readinessProbe.enabled | bool | `true` | | | ||
| controller.readinessProbe.failureThreshold | int | `3` | | | ||
| controller.readinessProbe.initialDelaySeconds | int | `10` | | | ||
| controller.readinessProbe.periodSeconds | int | `10` | | | ||
| controller.readinessProbe.successThreshold | int | `1` | | | ||
| controller.readinessProbe.timeoutSeconds | int | `1` | | | ||
| controller.resources | object | `{}` | | | ||
| controller.securityContext.fsGroup | int | `65534` | | | ||
| controller.securityContext.runAsNonRoot | bool | `true` | | | ||
| controller.securityContext.runAsUser | int | `65534` | | | ||
| controller.serviceAccount.annotations | object | `{}` | | | ||
| controller.serviceAccount.create | bool | `true` | | | ||
| controller.serviceAccount.name | string | `""` | | | ||
| controller.tolerations | list | `[]` | | | ||
| existingConfigMap | string | `""` | | | ||
| fullnameOverride | string | `""` | | | ||
| imagePullSecrets | list | `[]` | | | ||
| nameOverride | string | `""` | | | ||
| prometheus.metricsPort | int | `7472` | | | ||
| prometheus.podMonitor.additionalLabels | object | `{}` | | | ||
| prometheus.podMonitor.enabled | bool | `false` | | | ||
| prometheus.podMonitor.interval | string | `nil` | | | ||
| prometheus.podMonitor.jobLabel | string | `"app.kubernetes.io/name"` | | | ||
| prometheus.podMonitor.metricRelabelings | list | `[]` | | | ||
| prometheus.podMonitor.relabelings | list | `[]` | | | ||
| prometheus.prometheusRule.additionalLabels | object | `{}` | | | ||
| prometheus.prometheusRule.addressPoolExhausted.enabled | bool | `true` | | | ||
| prometheus.prometheusRule.addressPoolExhausted.labels.severity | string | `"alert"` | | | ||
| prometheus.prometheusRule.addressPoolUsage.enabled | bool | `true` | | | ||
| prometheus.prometheusRule.addressPoolUsage.thresholds[0].labels.severity | string | `"warning"` | | | ||
| prometheus.prometheusRule.addressPoolUsage.thresholds[0].percent | int | `75` | | | ||
| prometheus.prometheusRule.addressPoolUsage.thresholds[1].labels.severity | string | `"warning"` | | | ||
| prometheus.prometheusRule.addressPoolUsage.thresholds[1].percent | int | `85` | | | ||
| prometheus.prometheusRule.addressPoolUsage.thresholds[2].labels.severity | string | `"alert"` | | | ||
| prometheus.prometheusRule.addressPoolUsage.thresholds[2].percent | int | `95` | | | ||
| prometheus.prometheusRule.bgpSessionDown.enabled | bool | `true` | | | ||
| prometheus.prometheusRule.bgpSessionDown.labels.severity | string | `"alert"` | | | ||
| prometheus.prometheusRule.configNotLoaded.enabled | bool | `true` | | | ||
| prometheus.prometheusRule.configNotLoaded.labels.severity | string | `"warning"` | | | ||
| prometheus.prometheusRule.enabled | bool | `false` | | | ||
| prometheus.prometheusRule.extraAlerts | list | `[]` | | | ||
| prometheus.prometheusRule.staleConfig.enabled | bool | `true` | | | ||
| prometheus.prometheusRule.staleConfig.labels.severity | string | `"warning"` | | | ||
| prometheus.scrapeAnnotations | bool | `false` | | | ||
| psp.create | bool | `true` | | | ||
| rbac.create | bool | `true` | | | ||
| speaker.affinity | object | `{}` | | | ||
| speaker.enabled | bool | `true` | | | ||
| speaker.image.pullPolicy | string | `nil` | | | ||
| speaker.image.repository | string | `"quay.io/metallb/speaker"` | | | ||
| speaker.image.tag | string | `nil` | | | ||
| speaker.livenessProbe.enabled | bool | `true` | | | ||
| speaker.livenessProbe.failureThreshold | int | `3` | | | ||
| speaker.livenessProbe.initialDelaySeconds | int | `10` | | | ||
| speaker.livenessProbe.periodSeconds | int | `10` | | | ||
| speaker.livenessProbe.successThreshold | int | `1` | | | ||
| speaker.livenessProbe.timeoutSeconds | int | `1` | | | ||
| speaker.logLevel | string | `"info"` | Speaker log level. Must be one of: `all`, `debug`, `info`, `warn`, `error` or `none` | | ||
| speaker.memberlist.enabled | bool | `true` | | | ||
| speaker.memberlist.mlBindPort | int | `7946` | | | ||
| speaker.nodeSelector | object | `{}` | | | ||
| speaker.podAnnotations | object | `{}` | | | ||
| speaker.readinessProbe.enabled | bool | `true` | | | ||
| speaker.readinessProbe.failureThreshold | int | `3` | | | ||
| speaker.readinessProbe.initialDelaySeconds | int | `10` | | | ||
| speaker.readinessProbe.periodSeconds | int | `10` | | | ||
| speaker.readinessProbe.successThreshold | int | `1` | | | ||
| speaker.readinessProbe.timeoutSeconds | int | `1` | | | ||
| speaker.resources | object | `{}` | | | ||
| speaker.serviceAccount.annotations | object | `{}` | | | ||
| speaker.serviceAccount.create | bool | `true` | | | ||
| speaker.serviceAccount.name | string | `""` | | | ||
| speaker.tolerateMaster | bool | `true` | | | ||
| speaker.tolerations | list | `[]` | | | ||
|
||
---------------------------------------------- | ||
Autogenerated from chart metadata using [helm-docs v1.5.0](https://github.com/norwoodj/helm-docs/releases/v1.5.0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
MetalLB is now running in the cluster. | ||
{{- if .Values.configInline }} | ||
LoadBalancer Services in your cluster are now available on the IPs you | ||
defined in MetalLB's configuration: | ||
|
||
config: | ||
{{ toYaml .Values.configInline | indent 2 }} | ||
|
||
To see IP assignments, try `kubectl get services`. | ||
{{- else }} | ||
WARNING: you specified a ConfigMap that isn't managed by | ||
Helm. LoadBalancer services will not function until you add that | ||
ConfigMap to your cluster yourself. | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
{{/* vim: set filetype=mustache: */}} | ||
{{/* | ||
Expand the name of the chart. | ||
*/}} | ||
{{- define "metallb.name" -}} | ||
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create a default fully qualified app name. | ||
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). | ||
If release name contains chart name it will be used as a full name. | ||
*/}} | ||
{{- define "metallb.fullname" -}} | ||
{{- if .Values.fullnameOverride }} | ||
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} | ||
{{- else }} | ||
{{- $name := default .Chart.Name .Values.nameOverride }} | ||
{{- if contains $name .Release.Name }} | ||
{{- .Release.Name | trunc 63 | trimSuffix "-" }} | ||
{{- else }} | ||
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
{{- end }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create chart name and version as used by the chart label. | ||
*/}} | ||
{{- define "metallb.chart" -}} | ||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
|
||
{{/* | ||
Common labels | ||
*/}} | ||
{{- define "metallb.labels" -}} | ||
helm.sh/chart: {{ include "metallb.chart" . }} | ||
{{ include "metallb.selectorLabels" . }} | ||
{{- if .Chart.AppVersion }} | ||
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} | ||
{{- end }} | ||
app.kubernetes.io/managed-by: {{ .Release.Service }} | ||
{{- end }} | ||
|
||
{{/* | ||
Selector labels | ||
*/}} | ||
{{- define "metallb.selectorLabels" -}} | ||
app.kubernetes.io/name: {{ include "metallb.name" . }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create the name of the controller service account to use | ||
*/}} | ||
{{- define "metallb.controller.serviceAccountName" -}} | ||
{{- if .Values.controller.serviceAccount.create }} | ||
{{- default (printf "%s-controller" (include "metallb.fullname" .)) .Values.controller.serviceAccount.name }} | ||
{{- else }} | ||
{{- default "default" .Values.controller.serviceAccount.name }} | ||
{{- end }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create the name of the speaker service account to use | ||
*/}} | ||
{{- define "metallb.speaker.serviceAccountName" -}} | ||
{{- if .Values.speaker.serviceAccount.create }} | ||
{{- default (printf "%s-speaker" (include "metallb.fullname" .)) .Values.speaker.serviceAccount.name }} | ||
{{- else }} | ||
{{- default "default" .Values.speaker.serviceAccount.name }} | ||
{{- end }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create the name of the settings ConfigMap to use. | ||
*/}} | ||
{{- define "metallb.configMapName" -}} | ||
{{ default ( printf "%s" (include "metallb.fullname" .) ) .Values.existingConfigMap | trunc 63 | trimSuffix "-" }} | ||
{{- end -}} | ||
|
||
{{/* | ||
Create the name of the settings Secret to use. | ||
*/}} | ||
{{- define "metallb.secretName" -}} | ||
{{ default ( printf "%s-memberlist" (include "metallb.fullname" .)) .Values.speaker.secretName | trunc 63 | trimSuffix "-" }} | ||
{{- end -}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{{- if .Values.configInline }} | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: {{ template "metallb.configMapName" . }} | ||
namespace: {{ .Release.Namespace }} | ||
data: | ||
config: | | ||
{{- toYaml .Values.configInline | nindent 4 }} | ||
{{- end }} |
112 changes: 112 additions & 0 deletions
112
assets/charts/components/metallb/templates/controller.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
{{- if .Values.controller.enabled }} | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: {{ template "metallb.fullname" . }}-controller | ||
namespace: {{ .Release.Namespace }} | ||
labels: | ||
{{- include "metallb.labels" . | nindent 4 }} | ||
component: controller | ||
app.kubernetes.io/component: controller | ||
app: metallb | ||
spec: | ||
selector: | ||
matchLabels: | ||
{{- include "metallb.selectorLabels" . | nindent 6 }} | ||
component: controller | ||
app: metallb | ||
app.kubernetes.io/component: controller | ||
template: | ||
metadata: | ||
{{- if or .Values.prometheus.scrapeAnnotations .Values.controller.podAnnotations }} | ||
annotations: | ||
{{- if .Values.prometheus.scrapeAnnotations }} | ||
prometheus.io/scrape: "true" | ||
prometheus.io/port: "{{ .Values.prometheus.metricsPort }}" | ||
{{- end }} | ||
{{- with .Values.controller.podAnnotations }} | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- end }} | ||
labels: | ||
{{- include "metallb.selectorLabels" . | nindent 8 }} | ||
component: controller | ||
app.kubernetes.io/component: controller | ||
app: metallb | ||
spec: | ||
{{- with .Values.imagePullSecrets }} | ||
imagePullSecrets: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
serviceAccountName: {{ template "metallb.controller.serviceAccountName" . }} | ||
terminationGracePeriodSeconds: 0 | ||
{{- if .Values.controller.securityContext }} | ||
securityContext: | ||
{{ toYaml .Values.controller.securityContext | indent 8 }} | ||
{{- end }} | ||
containers: | ||
- name: controller | ||
# Using custom built Kinvolk Image | ||
image: {{ .Values.controller.image.repository }}:{{ .Values.controller.image.tag | default .Chart.AppVersion }} | ||
{{- if .Values.controller.image.pullPolicy }} | ||
imagePullPolicy: {{ .Values.controller.image.pullPolicy }} | ||
{{- end }} | ||
args: | ||
- --port={{ .Values.prometheus.metricsPort }} | ||
- --config={{ template "metallb.configMapName" . }} | ||
env: | ||
{{- if and .Values.speaker.enabled .Values.speaker.memberlist.enabled }} | ||
# - name: METALLB_ML_SECRET_NAME | ||
# value: {{ include "metallb.secretName" . }} | ||
- name: METALLB_DEPLOYMENT | ||
value: {{ template "metallb.fullname" . }}-controller | ||
{{- end }} | ||
ports: | ||
- name: metrics | ||
containerPort: {{ .Values.prometheus.metricsPort }} | ||
{{- if .Values.controller.livenessProbe.enabled }} | ||
livenessProbe: | ||
httpGet: | ||
path: /metrics | ||
port: metrics | ||
initialDelaySeconds: {{ .Values.controller.livenessProbe.initialDelaySeconds }} | ||
periodSeconds: {{ .Values.controller.livenessProbe.periodSeconds }} | ||
timeoutSeconds: {{ .Values.controller.livenessProbe.timeoutSeconds }} | ||
successThreshold: {{ .Values.controller.livenessProbe.successThreshold }} | ||
failureThreshold: {{ .Values.controller.livenessProbe.failureThreshold }} | ||
{{- end }} | ||
{{- if .Values.controller.readinessProbe.enabled }} | ||
readinessProbe: | ||
httpGet: | ||
path: /metrics | ||
port: metrics | ||
initialDelaySeconds: {{ .Values.controller.readinessProbe.initialDelaySeconds }} | ||
periodSeconds: {{ .Values.controller.readinessProbe.periodSeconds }} | ||
timeoutSeconds: {{ .Values.controller.readinessProbe.timeoutSeconds }} | ||
successThreshold: {{ .Values.controller.readinessProbe.successThreshold }} | ||
failureThreshold: {{ .Values.controller.readinessProbe.failureThreshold }} | ||
{{- end }} | ||
{{- with .Values.controller.resources }} | ||
resources: | ||
{{- toYaml . | nindent 12 }} | ||
{{- end }} | ||
securityContext: | ||
allowPrivilegeEscalation: false | ||
readOnlyRootFilesystem: true | ||
capabilities: | ||
drop: | ||
- ALL | ||
nodeSelector: | ||
"kubernetes.io/os": linux | ||
{{- if .Values.controller.nodeSelector }} | ||
{{- toYaml .Values.controller.nodeSelector | nindent 8 }} | ||
{{- end }} | ||
{{- with .Values.controller.affinity }} | ||
affinity: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
tolerations: | ||
{{- if .Values.controller.tolerations }} | ||
{{- toYaml .Values.controller.tolerations | nindent 6 }} | ||
{{- end }} | ||
{{- end }} |
Oops, something went wrong.