Giter VIP home page Giter VIP logo

ghost-with-helm's Introduction

ghost-with-helm

Deploy ghost with helm

How to use

Declare PV

Create a file ghost-pv.yaml and change the path

kind: PersistentVolume
apiVersion: v1
metadata:
  name: ghost-pv
  labels:
    type: local
spec:
  storageClassName: manual
  capacity:
    storage: 12Gi
  accessModes:
    - ReadWriteOnce
  hostPath:
    path: "/home/cychong/Dropbox/Apps/ghost/content"

Then, create PV with kubectl

$ kubectl create -f ghost-pv.yaml 
persistentvolume/ghost-pv created

$ kubectl get pv
NAME       CAPACITY   ACCESS MODES   RECLAIM POLICY   STATUS      CLAIM   STORAGECLASS   REASON   AGE
ghost-pv   12Gi       RWO            Retain           Available           manual                  8s

Install chart with helm

$ helm install --name my-ghost ghost-with-helm

NAME:   my-ghost
LAST DEPLOYED: Sun Sep 22 21:39:34 2019
NAMESPACE: default
STATUS: DEPLOYED

RESOURCES:
==> v1/Deployment
NAME      READY  UP-TO-DATE  AVAILABLE  AGE
my-ghost  0/1    1           0          0s

==> v1/PersistentVolumeClaim
NAME       STATUS  VOLUME    CAPACITY  ACCESS MODES  STORAGECLASS  AGE
ghost-pvc  Bound   ghost-pv  12Gi      RWO           manual        1s

==> v1/Pod(related)
NAME                       READY  STATUS   RESTARTS  AGE
my-ghost-5f6578fd76-djd2g  0/1    Pending  0         0s

==> v1/Service
NAME      TYPE      CLUSTER-IP     EXTERNAL-IP  PORT(S)         AGE
my-ghost  NodePort  10.97.215.158  <none>       2368:30025/TCP  1s


NOTES:
1. Get the application URL by running these commands:
  export NODE_PORT=$(kubectl get --namespace default -o jsonpath="{.spec.ports[0].nodePort}" services my-ghost)
  export NODE_IP=$(kubectl get nodes --namespace default -o jsonpath="{.items[0].status.addresses[0].address}")
  echo http://$NODE_IP:$NODE_PORT

Check if the ghost is running by referring the NOTES above.

ghost-with-helm's People

Contributors

cychong47 avatar

Watchers

James Cloos avatar  avatar

ghost-with-helm's Issues

liveness check failed

$ kubectl describe pod my-ghost-5f6578fd76-k5xcs 
Events:
  Type     Reason     Age   From               Message
  ----     ------     ----  ----               -------
  Normal   Scheduled  45s   default-scheduler  Successfully assigned default/my-ghost-5f6578fd76-k5xcs to mini1
  Normal   Pulling    41s   kubelet, mini1     Pulling image "ghost:2.31.0"
  Normal   Pulled     37s   kubelet, mini1     Successfully pulled image "ghost:2.31.0"
  Normal   Created    37s   kubelet, mini1     Created container ghost
  Normal   Started    36s   kubelet, mini1     Started container ghost
  Warning  Unhealthy  31s   kubelet, mini1     Readiness probe failed: Get http://10.244.51.80:2368/: dial tcp 10.244.51.80:2368: connect: connection refused
  Warning  Unhealthy  31s   kubelet, mini1     Liveness probe failed: Get http://10.244.51.80:2368/: dial tcp 10.244.51.80:2368: connect: connection refused
  Warning  Unhealthy  20s   kubelet, mini1     Readiness probe failed: Get http://10.244.51.80:2368/: net/http: request canceled (Client.Timeout exceeded while awaiting headers)
  Warning  Unhealthy  20s   kubelet, mini1     Liveness probe failed: Get http://10.244.51.80:2368/: net/http: request canceled (Client.Timeout exceeded while awaiting headers)

Dynamic port due to NodePort

Due to the dynamic nature of port assignment in NodePort service type, port forwarding in rouer should be updated everytime I deployed.
Change to

  • fix the port value (service.yaml should updated to consider when this port is specififed in values.yaml)
  • use ingress controller
  • use loadbalancer service type - use MetalLB or something ?

PV should be deleted also when helm release is deleted

helm delete and re-install failed due to the PVC issue
In this case, first delete PV and create PV and then install helm.

$ kubectl describe pod my-ghost-5f6578fd76-kddlg
Name:           my-ghost-5f6578fd76-kddlg
Namespace:      default
Priority:       0
Node:           <none>
Labels:         app.kubernetes.io/instance=my-ghost
                app.kubernetes.io/name=ghost
                pod-template-hash=5f6578fd76
Annotations:    <none>
Status:         Pending
…
Events:
  Type     Reason            Age                From               Message
  ----     ------            ----               ----               -------
  Warning  FailedScheduling  26s (x2 over 87s)  default-scheduler  pod has unbound immediate PersistentVolumeClaims

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.