How-To Enable or Disable MetalLB via Sunpike API For an Already Installed Cluster

Problem

How-To Add Enable or Disable MetalLB via Sunpike API For an Already Installed Cluster?

Environment

  • Platform9 Managed Kubernetes - v5.2 and K8s v1.20 and Higher

Procedure

  1. Fetch the authentication TOKEN.
  • Keystone Identity API: This link describes the process for getting a Keystone authentication token in order to access the PMK REST API.
  1. Make use of either the below mentioned API call to check if the cluster already has MetalLB enabled or not.
Command
Copy
  • For the cluster that does not have MetalLB enabled, the below output will be presented.
Example
Copy
  1. To enable MetalLB for this cluster create a new JSON spec for MetalLB.
Reference Format for MetalLB Spec JSON
Copy

The metallb version in the above JSON file is currently on 0.9.6. It will be updated along with the pf9-kube version and can be referred from the Support Matrix.

  1. To Enable MetalLB ClusterAddon object with the above-mentioned new JSON spec metallbspec.json.
API call to enable the MetalLB
Copy

Replace the placeholders: <DU_FQDN>, <PROJECT_ID> and the <CLUSTER_UUID> with their appropriate values wherever required.

The "name" attribute in the spec must be in the format CLUSTER_UUID-metallb

Also,MetallbIpRange value should be set with the required set of IP addresses.

  • The API call mentioned below can be referred as an example for the one above.
API call Example to enable the MetalLB
Copy
  • Verify whether MetalLB is now enabled.
Example
Copy
  • To Disable MetalLB for a Cluster that already has it enabled, use the API call below.
API call to disable MetalLB
Copy
  • The API call mentioned below can be referred as an example for the one above.
API Call Example for disabling metalLB
Copy
Type to search, ESC to discard
Type to search, ESC to discard
Type to search, ESC to discard