Configure Calicoctl for IBM Cloud Kubernetes Service
Do you want to have access to your Calico policies in a quick and simple way? We’ve got you covered.
In the IBM Cloud Kubernetes Service, the Calico configuration file can now be generated automatically with just a single command. For clusters 1.10 and above, you can use the new flag
--network to download your cluster config.
Downloading the Calico config example
Make sure to update the IBM Cloud Kubernetes Service CLI plugin in the following way:
With the latest CLI, you can download the Calico Config. The location of the
calicoctl.cfg file will be displayed, which can be then used to configure
calicoctl to access your cluster.
Installing the Calico binary on MacOS
Here are the steps on how to install the exact version of the
calicoctl binary that matches what is running in your Kubernetes cluster. If you already have the right version of
calicoctl installed, please proceed to the next section.
Assuming you have
kubectl set up for your cluster, follow the steps below.
Find the Calico version you have currently running in your Kubernetes cluster:
Move the binary to your bin directory:
Using the Calico config
Option #1) The CLIs
Calico has the option to specify the config on every cmd:
Note: You can also pass it in as a variable if you set it beforehand $CALICOCNF.
Option #2) Using the config in the default config location
Calico has a default config location (
/etc/calico/calicoctl.cfg), and if you move the config to this location, you won’t need to pass the config on every
calicoctlcmd, which comes pretty handy.
Enjoy the easy operation:
For more information about setting up Calico, you can check out the IBM Cloud Kubernetes Service docs.
If you have questions, engage our team via Slack by registering here and join the discussion in the #general channel on our public IBM Cloud Kubernetes Service Slack.