May 2018
Intermediate to advanced
554 pages
13h 51m
English
When trying to use the command line to launch a Kubernetes Service immediately, we usually fire kubectl run. However, it would creates a Deployment by default, and not only taking care of the Pod replica but also providing a container-updating mechanism. To simply create a standalone ReplicaSet, we can exploit a configuration YAML file and run it:
$ cat my-first-replicaset.yamlapiVersion: extensions/v1beta1kind: ReplicaSetmetadata: name: my-first-replicaset labels: version: 0.0.1spec: replicas: 3 selector: matchLabels: project: My-Happy-Web role: frontend template: metadata: labels: project: My-Happy-Web role: frontend env: dev spec: containers: - name: happy-web image: nginx:latest
The preceding file is the YAML for ...
Read now
Unlock full access