May 2018
Intermediate to advanced
554 pages
13h 51m
English
Here, we will prepare a YAML configuration file for creating Kubernetes Deployments and related Services under a new Namespace. It will be used to build resources through the dashboard:
// the configuration file for creating Deployment and Service on new Namespace: dashboard-test$ cat my-nginx.yamlapiVersion: apps/v1beta2kind: Deploymentmetadata: name: my-nginx namespace: dashboard-testspec: replicas: 3 selector: matchLabels: run: demo template: metadata: labels: run: demo spec: containers: - name: my-container image: nginx ports: - containerPort: 80---apiVersion: v1kind: Servicemetadata: name: my-nginx namespace: dashboard-testspec: ports: - protocol: TCP port: 80 type: NodePort selector: run: demo
First, ...