FY18P20Labs

View the Project on GitHub

Containers Orchestrator hands-on lab with Kubernetes

Create and deploy into Kubernetes Namspaces

Kubernetes provides namespaces as a way to create isolated environments within a cluster (e.g. dev,test,prod)

https://github.com/lastcoolnameleft/demos/blob/master/k8s-lab/k8s-create-namespaces.yaml

apiVersion: v1
kind: Namespace
metadata:
  name: test
  labels:
    name: test
---
apiVersion: v1
kind: Namespace
metadata:
  name: prod
  labels:
    name: prod

Create a test and prod namespace deployment using the kubectl create command:

kubectl create -f https://raw.githubusercontent.com/lastcoolnameleft/demos/master/k8s-lab/k8s-create-namespaces.yaml

Use the UI or command line to verify the available namespaces now include test and prod:

kubectl get namespaces

Deploy the demo application into the test namespace

kubectl config get-contexts
kubectl config set-context test --cluster=$RESOURCE_GROUP --user=$USER --namespace=test 
kubectl config use-context test
kubectl config get-contexts

Lab Navigation

  1. Lab Overview
  2. Kubernetes Installation on Azure
  3. Hello-world on Kubernetes
  4. Experimenting with Kubernetes Features
    1. Placement
    2. Reconciliation
    3. Rolling Updates
  5. Deploying a Pod and Service from a public repository
  6. Create Azure Container Service Repository (ACR)
  7. Enable OMS monitoring of containers
  8. Create and deploy into Kubernetes Namspaces <– You are here

Back to Index