Chapter 8. Accessing pod metadata and other resources from applications
This chapter covers
- Using the Downward API to pass information into containers
- Exploring the Kubernetes REST API
- Leaving authentication and server verification to kubectl proxy
- Accessing the API server from within a container
- Understanding the ambassador container pattern
- Using Kubernetes client libraries
Applications often need information about the environment they’re running in, including details about themselves and that of other components in the cluster. You’ve already seen how Kubernetes enables service discovery through environment variables or DNS, but what about other information? In this chapter, you’ll see how certain pod and container metadata can be passed to the container and how easy it is for an app running inside a container to talk to the Kubernetes API server to get information about the resources deployed in the cluster and even how to create or modify those resources.