19.06.2021 Views

148422597X Kubernetes Management Design Patterns [Vohra 2017-01-29] {E559F6BB}

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 7 ■ Using Services

Figure 7-9. Invoking a service in a browser

Creating a NodePort Service

In this section we shall expose the same deployment hello-world as a service of type NodePort. First, delete

the service hello-world:

./kubectl delete svc hello-world

Then expose the deployment hello-world as a service of type NodePort:

./kubectl expose rc hello-world --port=80 --type=NodePort

A service of type NodePort is exposed, as shown in Figure 7-10.

Figure 7-10. Creating a service of type NodePort

159

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!