Sample Kubernetes scripts to deploy Ghost blog to a Kubernetes cluster in local Deployment structure:
- Create
mysql
deployment:kubectl apply -f mysql-deployment.yml
- Create
mysql-svc
ClusterIP service so that it's accessible byghost
application:kubectl apply -f mysql-service.yml
- Create
ghost
deployment:kubectl apply -f ghost-deployment.yml
- Create
ghost-svc
NodePort service so that it's accessible by external clients:kubectl apply -f ghost-service.yml
Ghost application can be accessed from: http://localhost:30001
The same deployments can be applied to GKE, but in order to make the cluster available to public, need to create additional ingress, pointing to ghost-svc
:
kubectl apply -f ghost-ingress.yml
The service can be accessed through ingress public IP, port 80
For testing only. Deploying using Kubernetes Deployment is preferred. This will create a ReplicaSet with multi-containers in a pod
kubectl apply -f ghost-rs.yml
docker-compose.yml
is docker compose equivalent of this setup