Skip to content

Commit

Permalink
feat: added configuration to install Calico
Browse files Browse the repository at this point in the history
  • Loading branch information
vicenteherrera committed Nov 23, 2023
1 parent 8391493 commit 400f800
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 4 deletions.
18 changes: 16 additions & 2 deletions cluster/minikube/makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,22 @@

KUBERNETES_VER=1.28.0
KUBERNETES_VER=1.28.0-rc.1
CPUS=4
MEMORY=8g
DISK=20000mb
# See https://github.com/prometheus-operator/kube-prometheus

NETWORK_DEFAULT=""
NETWORK_CALICO="CALICO"
NETWORK_CILIUM="CILIUM"
NETWORK=$(NETWORK_CILIUM)

start:
minikube delete ||:
if test "$(NETWORK)" = "$(NETWORK_CALICO)"; then \
echo "# Using Calico CNI" ; NETPARAM1="--network-plugin=cni" ; NETPARAM2="--cni=calico" ; \
elif test "$(NETWORK)" = "$(NETWORK_CILIUM)"; then \
echo "# Using Cilium CNI" ; NETPARAM1="--network-plugin=cni" ; NETPARAM2="" ; \
fi ; \
minikube start \
--kubernetes-version="v${KUBERNETES_VER}" \
--memory="${MEMORY}" \
Expand All @@ -17,7 +27,11 @@ start:
--extra-config=kubelet.authorization-mode=Webhook \
--extra-config=scheduler.bind-address=0.0.0.0 \
--extra-config=controller-manager.bind-address=0.0.0.0 \
--extra-config=kubelet.housekeeping-interval=10s
--extra-config=kubelet.housekeeping-interval=10s $$NETPARAM1 $$NETPARAM1 ; \
if test "$(NETWORK)" = "$(NETWORK_CILIUM)"; then \
echo "# Additional Cilium CNI installation step" ; \
cilium install ; \
fi
minikube addons enable metrics-server

kubeconfig:
Expand Down
9 changes: 7 additions & 2 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,15 @@ CLUSTER_TYPE="minikube"
# Create a cluster, install and configure software
all: start helmfile_sync enable_audit_log

NETWORK_DEFAULT=""
NETWORK_CALICO="CALICO"
NETWORK_CILIUM="CILIUM"
NETWORK:=
# Create a cluster
start:
@$(MAKE) -s -C cluster/${CLUSTER_TYPE} start
@@echo "-------------------------------------------------"
@echo "# Using cluster type ${CLUSTER_TYPE} with network ${NETWORK}"
@$(MAKE) -s -C cluster/${CLUSTER_TYPE} start NETWORK="$(NETWORK)"
@echo "-------------------------------------------------"

# Create a cluster just with Gatekeeper
start_gatekeeper: start install_gatekeeper reinstall_gatekeeper_rules
Expand Down

0 comments on commit 400f800

Please sign in to comment.