Deploy Ghost in a Spot Namespace on Kubernautic from your browser

Arash
Kubernauts
Published in
3 min readJun 28, 2020

--

Photo by Karim MANJRA on Unsplash

In my previous post Spot Namespaces was introduced.

In this post I’m going to show you how you can run ghost, a headless CMS or your own apps in a namespace by defining the proper requests and limits in the deployment manifest file of ghost or your own app on Kubernautic.

After you’re logged into Rancher you’ll have access to your project on your assigned Kubernetes cluster in form of <user-id>-project-spot-namespace:

Click on the project and in the navigation menu bar click on Namespaces, now you can see a the namespace which is assigned to your project:

Now that we know the id of our namespace, we’re ready to deploy our Ghost app.

First you need to select the cluster and click on the “Launch kubectl” button:

With that we’ll have Shell access to the cluster in our browser:

With the following kubectl command, you can switch to your namespace:

kubectl config set-context --current --namespace <your namespace>

And deploy Ghost like this:

kubectl create -f https://raw.githubusercontent.com/kubernauts/practical-kubernetes-problems/master/3-ghost-deployment.yaml

Please note in the spec part of the manifest we’re setting the limits for CPU and Memory in the resources part of our ghost image, unless you’ll not be able to deploy the app.

spec:
containers:
- image: ghost:latest
imagePullPolicy: IfNotPresent
name: ghost
resources:
limits:
memory: 512Mi
cpu: 500m
requests:
memory: 256Mi

To see if our deployment was successful, we can run:

kubectl get deployment

Now we can create a L7 Ingress to ghost easily in Rancher by selecting Resources → Workloads → LoadBalancing → Add ingress.

In this example we’re going to tell Rancher to generate a .xip.io hostname for us, we select the target which is ghost and provide the port 2368 in Port filed:

After couple of seconds the L7 ghost ingress is ready to go, click on the ghost-ingress-xyz-xip.io link and enjoy:

Questions?

If you have any questions, we’d love to welcome you to our Kubernauts Slack channel and be of help.

We’re hiring!

We love people who love building things, New Things!
If you wish to work on New Things, please do visit our job offerings page.

--

--