Changes between Version 1 and Version 2 of k8snetworking2023


Ignore:
Timestamp:
Dec 7, 2023, 7:36:34 AM (12 months ago)
Author:
deepthi
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • k8snetworking2023

    v1 v2  
    2121`kubectl get pods -n metallb-system`
    2222
     23You should see the MetalLB pods running.
     24
     25'''Step 2: Configure MetalLB'''
     26
     27MetalLB can operate in either Layer 2 mode or BGP mode. We'll use Layer 2 mode for simplicity.
     28
     291. Create a ConfigMap for MetalLB: Define a range of IP addresses that MetalLB will manage. Create a file named `metallb-pool.yaml` with the following content:
     30
     31{{{
     32apiVersion: metallb.io/v1beta1
     33kind: IPAddressPool
     34metadata:
     35name: ippool
     36  namespace: metallb-system
     37spec:
     38  addresses:
     39  - 192.168.1.200/32
     40  - 192.168.1.240-192.168.1.250
     41}}}
     42
     43Replace 192.168.1.240-192.168.1.250 with your desired IP range.
     44
     45Apply the Pool:
     46
     47`kubectl apply -f metallb-pool.yaml`
     48
     492. Create a L2 Advertisement: When additional IP ranges are defined in the config- map, they need to be advertised on to the network. Create a file named L2add.yaml with the following content:
     50
     51{{{
     52apiVersion: metallb.io/v1beta1
     53kind: L2Advertisement
     54metadata:
     55  name: example
     56  namespace: metallb-system
     57spec:
     58  ipAddressPools:
     59  - ippool
     60}}}