akash-network / support

Akash Support and Issue Tracking
5 stars 3 forks source link

docs: metallb 0.13 uses CRD based config, docs need to reflect this #74

Closed andy108369 closed 1 year ago

andy108369 commented 1 year ago

The docs should be updated => https://docs.akash.network/providers/build-a-cloud-provider/ip-leases-provider-enablement-optional-step/metallb-install

metallb 0.13 uses CRD-based config instead of the ConfigMap-based one, here are the migration steps => https://metallb.universe.tf/configuration/migration_to_crds/

Migration steps

based on https://metallb.universe.tf/configuration/migration_to_crds/

  1. save the old v0.12 configmap-based metallb config to a config.yaml file

    kubectl -n metallb-system get cm config -o yaml > config.yaml
  2. use this command to migrate it to v0.13 (CRD-based format) - (resources.yaml)

    docker run -d -v $(pwd):/var/input quay.io/metallb/configmaptocrs

This will produce a new config file - resources.yaml.

  1. apply the new config

    kubectl apply -f resources.yaml
  2. remove the old config

    kubectl -n metallb-system delete cm config

Now you can upgrade / use MetalLB v0.13.

Example

old v0.12 metallb configmap-based config

new metallb v0.13 crd-based config

andy108369 commented 1 year ago

The config examples for the docs are:

MetalLB v0.12 config example

This is a ConfigMap-based config for MetalLB <=0.12

kubespray 2.21.0 brings metallb v0.12.1 by default https://github.com/kubernetes-sigs/kubespray/blob/v2.21.0/roles/download/defaults/main.yml#L1215

cat <<EOF | kubectl apply -f -
apiVersion: v1
kind: ConfigMap
metadata:
  namespace: metallb-system
  name: config
data:
  config: |
    address-pools:
    - name: default
      protocol: layer2
      addresses:
      - 144.217.30.192/28
      - 198.50.185.112/28
      - 66.70.218.96/28
      - 194.28.98.217/32
      - 194.28.98.219-194.28.98.222
EOF

MetalLB v0.13 config example

This is a CRD-based config for MetalLB >=0.13

cat <<EOF | kubectl apply -f -
apiVersion: metallb.io/v1beta1
kind: IPAddressPool
metadata:
  name: default
  namespace: metallb-system
spec:
  addresses:
  - 144.217.30.192/28
  - 198.50.185.112/28
  - 66.70.218.96/28
  - 194.28.98.217/32
  - 194.28.98.219-194.28.98.222
  autoAssign: true
  avoidBuggyIPs: false
EOF
chainzero commented 1 year ago

Suggested doc has been added to docs.akash.network at the following location:

https://docs.akash.network/providers/build-a-cloud-provider/ip-leases-provider-enablement-optional-step/metallb-install#example-of-new-metallb-v0.13-crd-based-config