8

Deploy Ghost in a Spot Namespace on RSaaS from your browser

 3 years ago
source link: https://blog.kubernauts.io/deploy-ghost-in-a-spot-namespace-on-rsaas-from-your-browser-d9376db342e0
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Deploy Ghost in a Spot Namespace on RSaaS from your browser

Image for post
Image for post
Photo by Karim MANJRA on Unsplash

In my previous post Spot Namespaces on RSaaS 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 RSaaS.

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:

Image for post
Image for post

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:

Image for post
Image for post

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:

Image for post
Image for post

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

Image for post
Image for post

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
Image for post
Image for post

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:

Image for post
Image for post

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

Image for post
Image for post
Image for post
Image for post

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.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK