Setup of a minikube cluster

So maybe you are like me and ended up here because you want to know a thing or 2 about K8S (kubernetes)

As you can see in my first post on the topic of Kubernetes I did already learn myself howto install minikube which we will use here also, but I have no clue on what I am doing yet. So basicaly I called in the cavelary and asked some support from a friend

He explained me how to setup a deployment of a few nodes in kubernetes on a minikube cluster.

The files I use and refrence in this blog can also be found here on my github We will be installing a few ngnix pods a pod to handle the PHP calls with FPM and and ingress to enable incoming traffic to your pobs

Deployment of NGNIX PODS

First we start with the deployment of the ngnix pods: (see also ngnix_deploy.yml ) We also defined the service to run in the same file. Some explanations:

# By using the "app: nginx" we link both the service and the pod
kind: Deployment
  name: nginx-deployment
      app: nginx
kind: Service
apiVersion: v1
  name: nginx-service
    app: nginx

# We use a default image from I believe dockerhub
      - name: nginx
        image: nginx:latest 

# We claim a persistent volume
      - name: task-pv-storage
          claimName: task-pv-claim

# We place a ngnix config file 
      - name: nginx-config
          name: nginx-config
          - key: nginx.conf
            path: site.conf

# The service type is a loadbalancer goint to port 80 on the pods
    app: nginx
    - port: 80 # Default port for image
  type: LoadBalancer

Although the Kubernetes deployment and service definitions are usualy not preceded by the normal “—” at the start of a YAML file. These are just YAML definition files.

The task of using the persistent volume consists of a 2 step aproach :

Futher we want to define our own ngnix site.conf we also uploaded ngnix_config.yml

TO BE CONTINUED WITH “php-fpm-deployment”

comments powered by Disqus