Understanding Pods — Kubernetes

PHOTOGRAPH BY PAUL NICKLEN
Kubernetes.io
  • By posting a JSON or YAML manifest to the Kubernetes REST API endpoint.
  • The other way is by running the kubectl command that will allow you to quickly configure the pod's properties. Not all properties, however, can be set using this command.
apiVersion : v1
kind: Pod
metadate:
name: my-pod
spec:
containers:
- image: njerry/my-app
name: my-app
ports:
- containerPort: 8080
protocol : TCP
  1. Go to your Kubernetes cluster. It could be in your local machine or from a Kubernetes cloud provider.
  2. Create a .yaml file by switching to a Linux terminal text editor. In this case, I am using vim.
kubectl get pods
# deleting using the pod's namekubectl delete pod my-pod
kubectl delete -f mypod.yaml
kubectl run podname --image=imagename restartPolicy --port=port number expose

--

--

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