- Prerequisites
- Step 1: Create Cluster
- Step 2: Install Helm 2 Tiller (Skip for Helm 3)
- Step 3: Install Nginx-Ingress
- Step 4: Install Ghost Blog App
For example, with macOS and Homebrew:
brew cask install docker
brew install k3d kubernetes-cli helm@2 ngrok
# You have to symlink helm@2, for example:
ln -s /usr/local/opt/helm@2/bin/helm /usr/local/bin/helm2
For other platforms, see https://github.com/rancher/k3d
Ensure you install version ≥ 3.0.0
of K3D.
We will use ngrok
to create a temporary domain to proxy to our port 443:
ngrok http https://localhost
Copy/paste the temporary domain, e.g. a1b2c3d4e5f6.ngrok.io
Don't close this terminal! Once you quit ngrok, the temporary domain is purged.
We'll use k3d to create a quick Kubernetes installation.
k3d cluster create rancher \
--k3s-server-arg "--no-deploy=traefik" \
--api-port 6550 --servers 1 --agents 1 \
--port 8084:80@loadbalancer \
--wait
kubectl cluster-info
kubectl get node # or kubectl get no
kubectl get storageclass # or kubectl get sc
kubectl get namespace # or kubectl get ns
kubectl get pod -A
kubectl get svc -A
# Let's install Helm 2 tiller
kubectl -n kube-system create serviceaccount tiller
kubectl create clusterrolebinding tiller \
--clusterrole=cluster-admin \
--serviceaccount=kube-system:tiller
helm2 init --service-account=tiller
kubectl get po -n kube-system -w
helm2 version
Instead of Traefik, let's use nginx-ingress controller.
helm2 repo update
helm2 install --name nginx-ingress stable/nginx-ingress \
--version 1.33.0 --set-string controller.config.ssl-redirect=false
# Wait for nginx-ingress to be ready
kubectl rollout status deploy/nginx-ingress-controller
# This should respond with 404 from default backend!
curl http://localhost
If our nginx-ingress controller is working correctly, you should see a 404 not found message, because we haven't installed anything.
Finally, let's install latest Ghost. Don't forget to change MYDOMAIN
!
# Change this to your domain from the ngrok tool
export MYDOMAIN=a1b2c3d4e5f6.ngrok.io
helm2 install --name blog stable/ghost \
--set-string ghostPassword=1234567890 \
--set-string externalDatabase.password=1234567890 \
--set service.type=ClusterIP \
--set ingress.enabled=true \
--set persistence.enabled=false
kubectl get pod -w
kubectl get pv,pvc -A
curl http://localhost:8084 -H "Host: $MYDOMAIN"
open http://"$MYDOMAIN":8084
Finally, open in browser: http://<ngrok-domain>:8084
Thanks for participating!