Shipa Blog

Latest updates on our products, plus helpful articles relating to Kubernetes, container security, microservices and more

Local Shipa Deployment – k3d/s and Telepresence

Shipa can be deployed on most Kubernetes environments (EKS, GKE, AKS, OKE, Linode, minikube and so on). How about k3s? Let us try to deploy WordPress on k3s cluster using Shipa. 

We are going to use k3d to create a k3s Kubernetes cluster.

Install k3d

$ brew install k3d

Install K3s cluster

We are going to install k3s with Kubernetes 1.21 and we will disable default Traefik as it’s not really needed. 

k3d cluster create -i rancher/k3s:v1.21.5-k3s2-amd64

Install Shipa

helm install shipa shipa-charts/shipa  -n shipa-system --create-namespace \
--timeout=15m \
--set=metrics.image=gcr.io/shipa-1000/metrics:30m \
--set=auth.adminUser=admin@shipa.io \
--set=auth.adminPassword=shipa2020 \
--set=shipaCluster.serviceType=ClusterIP \
--set=shipaCluster.ip=10.43.10.20 \
--set=service.nginx.serviceType=ClusterIP \
--set=service.nginx.clusterIP=10.43.10.10

Here we are assigning clusterIPs to shipa ingress controllers. 

Note: K3d uses Service LB to assign IP addresses but I could not get it to work due to it getting stuck in a pending state. For this reason, we will get ClusterIP assigned and open the network route later

On successful installation, you can run kubectl get pods -Aw it should show all shipa pods are successfully running and shipa-init-job has completed as well.

Getting Shipa Pods

Similarly, run kubectl get svc -Aw, you should see shipa ingress controllers shipa-ingress-nginx and shipa-ingress have clusterIP assigned. 

Getting Shipa Services

Shipa uses shipa-ingress-inginx to route traffic to its services. All user applications are routed using shipa-ingress which is Traefik 1.7

Setup network route to k3s cluster

We need to make Kubernetes pods accessible from the host. I am going to use Telepresence for this purpose.

$ brew install datawire/blackbird/telepresence

$ telepresence connect

Launching Telepresence Daemon v2.3.2 (api v3)
Connecting to traffic manager...
Connected to context k3d-k3s-default (https://0.0.0.0:60254)

Setup Shipa target

Install Shipa CLI:

$ curl -s https://storage.googleapis.com/shipa-client/install.sh | bash

$ shipa target add shipa-on-k3s `k -n shipa-system get svc shipa-ingress-nginx -o jsonpath="{.spec.clusterIP}"` -s

Couldn't establish a trusted HTTPS connection.
Do you want to use self signed Shipa CA for future connections? (y/n) y
New target shipa-on-k3s -> https://10.43.10.10:8081 added to target list and defined as the current target

Login into Shipa

$ shipa login admin@shipa.io
Password: 
Successfully logged in!

$ shipa app list            
+-------------+-----------+---------------+------------------------------------------+
| Application | Status    | Shipa Managed | Address                                  |
+-------------+-----------+---------------+------------------------------------------+
| dashboard   | 1 running | true          | http://dashboard.10.43.10.20.shipa.cloud |
+-------------+-----------+---------------+------------------------------------------+

Open dashboard application http://dashboard.10.43.10.20.shipa.cloud in browser and login:

Shipa Dashboard

Create and deploy WordPress application

$ shipa app create wordpress -k shipa-framework -t shipa-admin-team 
Shipa WordPress App
$ shipa app deploy -a wordpress -i  docker.io/wordpress
Shipa Deploy WordPress
$ shipa app list
Shipa App List

Open WordPress application http://wordpress.10.43.10.20.shipa.cloud in browser:

WordPress running locally with Shipa and K3d

For details on using Shipa please check the Quickstart guide: https://learn.shipa.io/docs/quickstart and give us feedback at our community slack channel.  

If installing Shipa is not your thing and want to start deploying applications, you can use Shipa cloud.

– Vivek