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.

8.1. Passing metadata through the Downward API

8.1.1. Understanding the available metadata

8.1.2. Exposing metadata through environment variables

8.1.3. Passing metadata through files in a downwardAPI volume

8.2. Talking to the Kubernetes API server

8.2.1. Exploring the Kubernetes REST API

8.2.2. Talking to the API server from within a pod

8.2.3. Simplifying API server communication with ambassador containers

8.2.4. Using client libraries to talk to the API server

8.3. Summary

sitemap