In the previous chapter, we briefly touched upon how you can use YAML or JSON files to define your pods, ReplicaSets, and services. Let's use kubectl to launch to an application that is to the preceding one.
First of all, we need a file to launch; you can find a copy of the following one, which is called cli-hello-world.yml, in the Chapter03 folder of the code bundle and GitHub repository that accompany this title:
apiVersion: v1kind: Servicemetadata: name: cli-hello-worldspec: selector: app: cli-hello-world type: NodePort ports: - protocol: TCP port: 8000 targetPort: 80---apiVersion: apps/v1beta1kind: Deploymentmetadata: name: cli-hello-world labels: app: nginxspec: replicas: 1 selector: matchLabels: app: cli-hello-world ...