Skip to content

Latest commit

 

History

History
73 lines (72 loc) · 6.2 KB

README.md

File metadata and controls

73 lines (72 loc) · 6.2 KB

Kubernates

Namespaces in kubernates

  • List the current namespaces in a cluster using:

image

  • Create a new YAML file called my-namespace.yaml

image

  • Edit using nano editor with the contents:

image

  • Run using following command

image

  • Can view new created namespace using following command

image

  • Another way of creating namespace is as follows:

image

  • Delete a namespace with following command

image

Pods in Kubernates

  • They can be simply created with the kubctl run command, where you have a defined image on the Docker registry which we will pull while creating a pod.

image

  • This can also be done by creating the yaml file and then running the kubectl create command.

image

  • Multi container pods are created using yaml file with the definition of the containers.

image

Implementation of storage class and pvc

  • Create a storage class using vi editor

image

  • Create a storage class using following command:

image

  • Let’s create a PVC yaml using the above storage class…

image

  • We can create this resource and check for the following outputs:

image

  • show list of all pvc

image

Daemonset

  • describe a DaemonSet in a YAML file. For example, the daemonset.yaml file below describes a DaemonSet that runs the fluentd-elasticsearch Docker image:

image

  • create a Daemonset using following command:

image

Implementation of Configmap and secret application (with DB)

  • In configmap example, we will create a simple YAML that contains the data using vi editor

image

  • Configmap created using the kubectl apply command as shown below.

image

  • Use the following command with the appropriate ConfigMap name defined in the metadata section.

image

  • As secrets are defined by type, let’s create a basic-auth type Secret that contains the database username and password using vi editor

image

  • Secret can be created using the kubectl apply command as shown below.

image

  • As secrets contain confidential data, the describe command does not expose this secret data even when the user query through the kubectl using the specific secret name.

image

HelmChart

  • use the helmcreate command to create a helmchart

image

  • Let’s deploy an Apache webserver using Helm. As a first step, we need to tell Helm what location to search by adding a Helm repository:

image

  • Let’s install the actual container:

image

  • After a few minutes your deployment is ready. We can check the state of the containers using kubectl:

image

  • Helm can show us information about current deployments:

image

  • Helm stores deployment information in secrets – here they are:

image

  • Deply wordpress using helm chart

  • We can install using command as follows:

image

GitLab

  • Installation of GitLab in ubuntu using following command:

image