Kubernetes Tutorial: Part 3— Familiarizing the environment

Logos of Kubernetes and Streamlit
partha@jarvis:~/Documents/Projects$ kubectl cluster-info
Kubernetes master is running at https://172.17.0.2:8443
KubeDNS is running at https://172.17.0.2:8443/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy
To further debug and diagnose cluster problems, use 'kubectl cluster-info dump'.
  • kind — Type of the object to be created
  • metadata — Data that helps in uniquely identifying the object in the cluster
  • spec — Desired state of the object in the cluster

Namespaces

YAML file for Namespace Creation
kubectl create -f namespace.yaml
partha@jarvis:~/Documents/Projects$ kubectl get namespaces
NAME STATUS AGE
default Active 42d
kube-node-lease Active 42d
kube-public Active 42d
kube-system Active 42d
kubernetes-dashboard Active 42d
partha Active 31d

Secrets

kubectl create secret docker-registry docker-registry-creds 
--docker-server=https://index.docker.io/v1/ --docker-username=<user-name> --docker-password=<docker-hub-password> --docker-email=<registred-email> -n partha
partha@jarvis:~$ kubectl get secrets -n partha
NAME TYPE DATA AGE
default-token-s2vnk kubernetes.io/service-account-token 3 36d
docker-registry-creds kubernetes.io/dockerconfigjson 1 36d

Pod

YAML file for Pod creation
image: <docker-server-address>/<account>/<image-name>ubuntu:<image-tag>
partha@jarvis:~/Documents/Projects$ kubectl logs pod/ubuntu-base -n partha
Hello, Kubernetes!
partha@jarvis:~/Documents/Projects$ kubectl exec -it  pod/ubuntu-base bash -n partha
kubectl exec [POD] [COMMAND] is DEPRECATED and will be removed in a future version. Use kubectl exec [POD] -- [COMMAND] instead.
root@ubuntu-base:/#

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Parthasarathy Subburaj

Parthasarathy Subburaj

Helping computers see and understand the world as we do!