Makefiles and scripts for using consul-cni plugin in different environments
Consul CNI on Kind requires that Calico is installed and the Kind pod subnet is set to the same value that Calico is expecting. These settings are located in the consul-cni-on-kind subdirectory.
There are make targets in consul-cni-on-kind
that make this easier to run.
- In the Makefile, change the values of HELM_CHART_DIR and CNI_DIR to point to your local repository with your CNI branch.
- Change DOCKERHUB to match your dockerhub account
make all
will rebuild everything from scratch.- There are make targets for each step of
make all
that you can use individually.
make all
will:
- delete your kind cluster
- create a new kind cluster
- deploy Calico
- build a multi-arch re-build of the image, push it to dockerub
- deploy consul
- deploy deploy static server and client
- change your context to the consul namespace and show the status of the pods
NOTE: All config files are located in the directory.
GKE requires that Network Policy Enforcement be enabled for your cluster. This installs Calico.
- Turn on Network Policy Enforcement by running one set of the following commands:
For a new cluster, run the command:
gcloud container clusters create CLUSTER_NAME --enable-network-policy
For an existing cluster, run the commands:
gcloud container clusters update CLUSTER_NAME --update-addons=NetworkPolicy=ENABLED
and
gcloud container clusters update CLUSTER_NAME --enable-network-policy
-
In the
consul-cni-on-gke/Makefile
replace the values of HELM_CHART_DIR and CNI_DIR to point to your local repository with your CNI branch. -
Change DOCKERHUB to match your dockerhub account
-
make all
will rebuild everything from scratch. - delete your consul install - build a multi-arch re-build of the image, push it to dockerub - deploy consul - deploy deploy static server and client - change your context to the consul namespace and show the status of the pods -
There are make targets for each step of
make all
that you can use individually.
This tends to be a faster local setup of using kind as it does not pull down all the images on every rebuild of the kind cluster.
- In the
consul-cni-on-kind-local-registry/Makefile
replace the values of HELM_CHART_DIR and CNI_DIR to point to your local repository with your CNI branch. Leave DOCKERHUB set as localhost:5001 - Run
make pull
. This will pull all of the calico images into your local docker image cache. - Run
make all
. This will: - create a Kind cluster with a registry container and configure Kind to use that registry. - load all of the calico images into Kind. - deploy calico. - build the control-plane-dev image, tag it with localhost:5001 and push it to the running docker registry on your machine. - deploy consul. - deploy static server and client.