The KubeInvaders repository represents an exceptionally innovative project. However, for individuals like myself who are relatively new to Kubernetes, the initial setup process from scratch can be somewhat perplexing. Below is a comprehensive, step-by-step guide on how to effortlessly configure KubeInvaders within a Kubernetes (K8s) cluster hosted by a cloud provider.
Step 1 Choice a Cloud Service Provider
Create cloud account. Ie AWS, GCP, Azure. I went with Linode.
Step 2 Create Kubernetes Cluster
Create the cluster.
For Linode, Step by step directions can be found below:
Getting Started with LKE (Linode Kubernetes Engine)
I choice to stand up 3 nodes for Redundancy/High Availability.
Step 3 Download kubeconfig.yaml file
Once the cluster has been Created, download the kubeconfig.yaml file to your local machine. Save the .yaml file path to the KUBECONFIG environmental variable
export KUBECONFIG=/Users/drew/Downloads/kubeinvaders-kubeconfig.yaml
echo $KUBECONFIG
Step 4 Install Helm
On your local machine, Install helm if it is not already.
For mac:
brew install helm
Step 5 Add Repo, then Update
Add kubeinvaders helm repo then update:
helm repo add kubeinvaders https://lucky-sideburn.github.io/helm-charts/
helm repo update
List Helm Repos on your local machine:
helm repo list
Step 6 Create namespace
List name spaces
kubectl get namespaces
Create namespace
kubectl create namespace kubeinvaders
Verify the namespace you created
kubectl get namespaces
Step 7 Install KubeInvaders
Install the “kubeinvaders” Helm chart with specific configuration options below.
You can change the ‘namespace1’ and ‘namespace2’ if you want.
helm install kubeinvaders --set-string config.target_namespace="namespace1\,namespace2" \
-n kubeinvaders kubeinvaders/kubeinvaders --set ingress.enabled=true --set ingress.hostName=kubeinvaders.io --set deployment.image.tag=v1.9.6
Step 8 Add Ingress
The NGINX Ingress Controller is a popular choice for managing ingress traffic into your Kubernetes cluster and is used for routing external HTTP and HTTPS traffic to services running inside the cluster.
helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx
helm repo update
helm install nginx-ingress ingress-nginx/ingress-nginx
For me the command above created a “nodebalancer” in linode
Step 9 Annotate the External IP
kubectl get all
Step 10 Edit host file
With the IP address you annotated in step 9 edit the hosts file below. You may need to use sudo.
vi /etc/hosts
x.x.x.x kubeinvaders.io
Go to kubeinvaders.io via browser (It may take a few minutes to load the first time)