ibm-calico-bgp-peer

by Helm

Helm chartv1.1.0Apache-2.0

A Helm chart for configuring a bgp peer to your ICP Calico cluster

About this chart

Configure a BGP Peer Resource to the Kubernetes Calico Cluster

Introduction

A BGP peer resource (BGPPeer) represents a remote BGP peer with which the node(s) in a Calico cluster will peer. Configuring BGP peers allows you to peer a Calico network with your datacenter fabric (e.g. ToR). For more information on cluster layouts, see Calico's documentation on L3 Topologies.

A peer can be added as a Global Peer where the added BGP Agent peers with every calico node in the cluster. Or BGP peerings can be configured on a per-node basis, i.e., configured as node-specific peers.

Chart Details

This chart will do the following:

  • Creates a ConfigMap that contains the Calico BGP Peer configuration
  • Runs a Job to add a BGP Peer to the K8S Calico Cluster
  • On deletion, the chart first runs a Job that removes the added Peer. If the removal of Peer is successful, the chart deletes the ConfigMap, the Job that added the BGP Peer and the Job that removed the BGP Peer

Prerequisites

  • Already have (calico) provisioned and running in your ICP cluster

Installing the Chart

You should provide the IP address of the BGP Agent to be added as a peer and the calico etcd endpoint url (Example: https://master-node-ip:4001). You should also provide the name of the k8s secret object that contains the key, client certificate and Certificate Authority to connect to the provided calico etcd endpoint.

The k8s secret object must be created in the kube-system namespace with three keys: etcd-ca, etcd-cert and etcd-key as shown in the following structure:

apiVersion: v1
kind: Secret
metadata:
  name: etcd-secret
  namespace: kube-system
type: Opaque
data:
  etcd-ca: LS0......
    .......
	.......
	..tLQ==
  etcd-cert: LS0......
    .......
	.......
	..tLQ==
  etcd-key: LS0......
    .......
	.......
	..tsde2

Note: The k8s secret object containing the etcd credentials must be created in the kube-system namespace.

You can provide the AS number (default: 64512) and Node IP address of the node in the ICP cluster when BGP Peer needs to be configured on a per-node basis. When the Node IP address is specified, the scope is node level, otherwise the scope is global.

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

$ helm install --name my-release add-bgp-peer --set bgpPeer=1.2.3.4 --set etcd.endpoint=https://2.3.4.5:4001 --set etcd.secret=etcd-secret

The command adds the BGP Agent 1.2.3.4 as a global peer to the Calico Cluster. The Configuration section lists the parameters that can be configured during installation.

Tip: List all releases using helm list

Uninstalling the Chart

To uninstall/delete the my-release deployment:

$ helm delete my-release --purge

The command removes all the Kubernetes components associated with the chart and deletes the release.

Configuration

The following table lists the configurable parameters of the Calico BGP Peer chart and their default values.

ParameterDescriptionDefault
peerIpIP address of the BGP Agent to be added as peer (Required)nil
asNumberThe global default node AS number is the AS number used by the BGP agent (Required)65412
nodeThe hostname of the node to which this peer applies. If specified, the scope is node level, otherwise the scope is global (Optional)nil
etcd.endpointCalico etcd endpoint details. Example: https://calico-etcd-ip:calico-etcd-port (Required)nil
etcd.secretName of the k8s secret object containing the key, client certificate and Certificate Authority to connect to the calico etcd endpoint (Required)nil
image.repositorycalicoctl image repository (Required)calico/ctl
image.tagcalicoctl image tag (Required)v3.1.3
image.pullPolicyImage pull policy (Required)IfNotPresent

For more information refer to the Configuring BGP Peers documentation.

Specify each parameter using the --set key=value[,key=value] argument to helm install.

Alternatively, a YAML file that specifies the values for the parameters can be provided while installing the chart. For example,

$ helm install --name my-release -f values.yaml add-bgp-peer

Tip: You can use the default values.yaml

Resources Required

The Chart deploys a ConfigMap and a Job to add the BGP Peer to the Calico Cluster. As the Job executes and completes running, the resources required is only transient in nature.

Limitations

  • This Chart works only with IBM Cloud Private
  • This Chart can run on any of the three architecture types
  • This Chart supports calico/ctl versions v3.1.3
  • Cluster Admin Access is needed to run this Chart as the objects are created in the restricted kube-system namespace

Deploy ibm-calico-bgp-peer with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has ibm-calico-bgp-peer on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartibm-calico-bgp-peer is pinned at v1.1.0 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply