Introducing our new CEO Don Johnson - Read More

bitnamicharts/metallb

Verified Publisher

By VMware

Updated 1 day ago

Bitnami Helm chart for MetalLB

Helm
Image
Integration & Delivery
Networking
2

100K+

Bitnami package for MetalLB

MetalLB is a load-balancer implementation for bare metal Kubernetes clusters, using standard routing protocols.

Overview of MetalLB

Trademarks: This software listing is packaged by Bitnami. The respective trademarks mentioned in the offering are owned by the respective companies, and use of them does not imply any affiliation or endorsement.

TL;DR

helm install my-release oci://registry-1.docker.io/bitnamicharts/metallb

Looking to use MetalLB in production? Try VMware Tanzu Application Catalog, the commercial edition of the Bitnami catalog.

Introduction

Bitnami charts for Helm are carefully engineered, actively maintained and are the quickest and easiest way to deploy containers on a Kubernetes cluster that are ready to handle production workloads.

This chart bootstraps a MetalLB Controller Controller Deployment and a MetalLB Speaker Daemonset on a Kubernetes cluster using the Helm package manager.

Bitnami charts can be used with Kubeapps for deployment and management of Helm Charts in clusters.

Prerequisites

  • Kubernetes 1.23+
  • Helm 3.8.0+
  • Virtual IPs for Layer 2 or Route Reflector for BGP setup.

Installing the Chart

To install the chart with the release name my-release:

helm install my-release oci://REGISTRY_NAME/REPOSITORY_NAME/metallb

Note: You need to substitute the placeholders REGISTRY_NAME and REPOSITORY_NAME with a reference to your Helm chart registry and repository. For example, in the case of Bitnami, you need to use REGISTRY_NAME=registry-1.docker.io and REPOSITORY_NAME=bitnamicharts.

These commands deploy metallb on the Kubernetes cluster in the default configuration. The Parameters section lists the parameters that can be configured during installation.

Tip: List all releases using helm list

Configuration and installation details

Resource requests and limits

Bitnami charts allow setting resource requests and limits for all containers inside the chart deployment. These are inside the resources value (check parameter table). Setting requests is essential for production workloads and these should be adapted to your specific use case.

To make this process easier, the chart contains the resourcesPreset values, which automatically sets the resources section according to different presets. Check these presets in the bitnami/common chart. However, in production workloads using resourcesPreset is discouraged as it may not fully adapt to your specific needs. Find more information on container resource management in the official Kubernetes documentation.

Prometheus metrics

This chart can be integrated with Prometheus by setting *.metrics.enabled (under the controller, speaker and speaker.frr sections) to true. This will expose the MetalLB native Prometheus port in both the containers and services. The services will also have the necessary annotations to be automatically scraped by Prometheus.

Prometheus requirements

It is necessary to have a working installation of Prometheus or Prometheus Operator for the integration to work. Install the Bitnami Prometheus helm chart or the Bitnami Kube Prometheus helm chart to easily have a working Prometheus in your cluster.

Integration with Prometheus Operator

The chart can deploy ServiceMonitor objects for integration with Prometheus Operator installations. To do so, set the value *.metrics.serviceMonitor.enabled=true (under the controller, speaker and speaker.frr sections). Ensure that the Prometheus Operator CustomResourceDefinitions are installed in the cluster or it will fail with the following error:

no matches for kind "ServiceMonitor" in version "monitoring.coreos.com/v1"

Install the Bitnami Kube Prometheus helm chart for having the necessary CRDs and the Prometheus Operator.

Rolling VS Immutable tags

It is strongly recommended to use immutable tags in a production environment. This ensures your deployment does not change automatically if the same tag is updated with a different image.

Bitnami will release a new chart updating its containers if a new version of the main container, significant changes, or critical vulnerabilities exist.

To configure MetalLB please look into the configuration section MetalLB Configuration.

Backup and restore

To back up and restore Helm chart deployments on Kubernetes, you need to back up the persistent volumes from the source deployment and attach them to a new deployment using Velero, a Kubernetes backup/restore tool. Find the instructions for using Velero in this guide.

Example IP addresses to assing to the LoadBalancer configuration
# The address-pools lists the IP addresses that MetalLB is
# allowed to allocate. You can have as many
# address pools as you want.
apiVersion: metallb.io/v1beta1
kind: IPAddressPool
metadata:
  # A name for the address pool. Services can request allocation
  # from a specific address pool using this name.
  name: first-pool
  namespace: metallb-system
spec:
  # A list of IP address ranges over which MetalLB has
  # authority. You can list multiple ranges in a single pool, they
  # will all share the same settings. Each range can be either a
  # CIDR prefix, or an explicit start-end range of IPs.
  addresses:
  - 192.168.10.0/24
  - 192.168.9.1-192.168.9.5
  - fc00:f853:0ccd:e799::/124

Parameters

Global parameters
NameDescriptionValue
global.imageRegistryGlobal Docker image registry""
global.imagePullSecretsGlobal Docker registry secret names as an array[]
global.security.allowInsecureImagesAllows skipping image verificationfalse
global.compatibility.openshift.adaptSecurityContextAdapt the securityContext sections of the deployment to make them compatible with Openshift restricted-v2 SCC: remove runAsUser, runAsGroup and fsGroup and let the platform use their allowed default IDs. Possible values: auto (apply if the detected running cluster is Openshift), force (perform the adaptation always), disabled (do not perform adaptation)auto
Common parameters
NameDescriptionValue
kubeVersionForce target Kubernetes version (using Helm capabilities if not set)""
nameOverrideString to partially override metallb.fullname include (will maintain the release name)""
fullnameOverrideString to fully override metallb.fullname template""
commonLabelsAdd labels to all the deployed resources{}
commonAnnotationsAdd annotations to all the deployed resources{}
extraDeployArray of extra objects to deploy with the release[]
diagnosticMode.enabledEnable diagnostic mode (all probes will be disabled and the command will be overridden)false
diagnosticMode.commandCommand to override all containers in the the deployment(s)/statefulset(s)["sleep"]
diagnosticMode.argsArgs to override all containers in the the deployment(s)/statefulset(s)["infinity"]
installCRDsFlag to install metallb CRDstrue
MetalLB parameters
NameDescriptionValue
rbac.createSpecifies whether to install and use RBAC rulestrue
psp.createWhether to create a PodSecurityPolicy. WARNING: PodSecurityPolicy is deprecated in Kubernetes v1.21 or later, unavailable in v1.25 or laterfalse
networkPolicy.enabledEnable creation of NetworkPolicy resourcestrue
networkPolicy.allowExternalThe Policy model to applytrue
networkPolicy.allowExternalEgressAllow the pod to access any range of port and all destinations.true
networkPolicy.kubeAPIServerPortsList of possible endpoints to kube-apiserver (limit to your cluster settings to increase security)[]
networkPolicy.extraIngressAdd extra ingress rules to the NetworkPolicy[]
networkPolicy.extraEgressAdd extra ingress rules to the NetworkPolicy[]
networkPolicy.ingressNSMatchLabelsLabels to match to allow traffic from other namespaces{}
networkPolicy.ingressNSPodMatchLabelsPod labels to match to allow traffic from other namespaces{}
prometheusRule.enabledPrometheus Operator alertmanager alerts are createdfalse
Controller parameters
NameDescriptionValue
controller.image.registryMetalLB Controller image registryREGISTRY_NAME
controller.image.repositoryMetalLB Controller image repositoryREPOSITORY_NAME/metallb-controller
controller.image.digestMetalLB Controller image digest in the way sha256:aa.... Please note this parameter, if set, will override the tag""
controller.image.pullPolicyMetalLB Controller image pull policyIfNotPresent
controller.image.pullSecretsSpecify docker-registry secret names as an array[]
controller.updateStrategy.typeMetalLB controller deployment strategy type.RollingUpdate
controller.automountServiceAccountTokenMount Service Account token in podtrue
controller.hostAliasesDeployment pod host aliases[]
controller.rbac.createcreate specifies whether to install and use RBAC rules.true
controller.psp.createWhether to create a PodSecurityPolicy. WARNING: PodSecurityPolicy is deprecated in Kubernetes v1.21 or later, unavailable in v1.25 or latertrue
controller.priorityClassNameMetalLB controller pods' priorityClassName""
controller.runtimeClassNameName of the runtime class to be used by MetalLB controller pod(s)""
controller.schedulerNameName of the k8s scheduler (other than default)""
controller.terminationGracePeriodSecondsIn seconds, time the given to the MetalLB controller pod needs to terminate gracefully0
controller.topologySpreadConstraintsTopology Spread Constraints for pod assignment[]
controller.resourcesPresetSet container resources according to one common preset (allowed values: none, nano, micro, small, medium, large, xlarge, 2xlarge). This is ignored if controller.resources is set (controller.resources is recommended for production).nano
controller.resourcesSet container requests and limits for different resources like CPU or memory (essential for production workloads){}
controller.nodeSelectorNode labels for controller pod assignment{}
controller.tolerationsTolerations for controller pod assignment[]
controller.affinityAffinity for controller pod assignment{}
controller.podAnnotationsController Pod annotations{}
controller.podLabelsController Pod labels{}
controller.podAffinityPresetController Pod affinitypreset. Allowed values: soft, hard""
controller.podAntiAffinityPresetController Pod anti affinitypreset. Allowed values: soft, hardsoft
controller.nodeAffinityPreset.typeController Pod Node affinity preset. Allowed values: soft, hard""
controller.nodeAffinityPreset.keyController Pod Node affinity label key to match""
controller.nodeAffinityPreset.valuesController Pod Node affinity label values to match[]
controller.podSecurityContext.enabledEnabled MetalLB Controller pods' Security Contexttrue
controller.podSecurityContext.fsGroupChangePolicySet filesystem group change policyAlways
controller.podSecurityContext.sysctlsSet kernel settings using the sysctl interface[]
controller.podSecurityContext.supplementalGroupsSet filesystem extra groups[]
controller.podSecurityContext.fsGroupSet MetalLB Controller pod's Security Context fsGroup

Note: the README for this chart is longer than the DockerHub length limit of 25000, so it has been trimmed. The full README can be found at https://github.com/bitnami/charts/blob/main/bitnami/metallb/README.md

Docker Pull Command

docker pull bitnamicharts/metallb
Bitnami