In Kubernetes, Namespaces are used to create isolated environments for resources. Each Namespace is like a separate cluster within the same physical cluster. Services are used to expose your Pods and Deployments to the network. Read more about Namespace Here
-
Create a Namespace for your Deployment
-
Use the command
kubectl create namespace <namespace-name>
to create a Namespace -
Update the deployment.yml file to include the Namespace
-
Apply the updated deployment using the command:
kubectl apply -f deployment.yml -n <namespace-name>
-
Verify that the Namespace has been created by checking the status of the Namespaces in your cluster.
- Read about Services, Load Balancing, and Networking in Kubernetes. Refer official documentation of kubernetes Link
Need help with Namespaces? Check out this video for assistance.
Keep growing your Kubernetes knowledge💥🙌
Happy Learning! :)