O'Reilly logo

Kubernetes for Serverless Applications by Russ McKendrick

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

The command line

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required