更新时间:2021-08-27 19:04:55
封面
Title Page
Copyright and Credits
Kubernetes for Developers
Packt Upsell
Why subscribe?
PacktPub.com
Contributors
About the author
About the reviewers
Packt is searching for authors like you
Preface
Who this book is for
What this book covers
To get the most out of this book
Download the example code files
Conventions used
Get in touch
Reviews
Setting Up Kubernetes for Development
What you need for development
Optional tools
Getting a local cluster up and running
Resetting and restarting your cluster
Looking at what's built-in and included with Minikube
Verifying Docker
Clearing and cleaning Docker images
Kubernetes concept – container
Kubernetes resource – Pod
Namespaces
Writing your code for Pods and Containers
Kubernetes resource – Node
Networks
Controllers
Kubernetes resource – ReplicaSet
Kubernetes resource – Deployment
Representing Kubernetes resources
Summary
Packaging Your Code to Run in Kubernetes
Container images
Container registries
Making your first container
Dockerfile commands
Example – Python/Flask container image
Building the container
Running your container
Pod name
Port forwarding
Proxy
How did the proxy know to connect to port 5000 on the container?
Getting logs from your application
Example – Node.js/Express container image
Tagging your container images
Interacting with Your Code in Kubernetes
Practical notes for writing software to run in a container
Getting options for your executable code
Practical notes for building container images
Sending output from your program
Logs
Pods with more than one container
Streaming the logs
Previous logs
Timestamps
More debugging techniques
Interactive deployment of an image
Attaching to a running Pod
Running a second process in a container
Kubernetes concepts – labels
Organization of labels
Kubernetes concepts – selectors
Viewing labels
Listing resources with labels using kubectl
Automatic labels and selectors
Kubernetes resources – service
Defining a service resource
Endpoints
Service type – ExternalName
Headless service
Discovering services from within your Pod
DNS for services
Exposing services outside the cluster
Service type – LoadBalancer
Service type – NodePort
Minikube service
Example service – Redis
Finding the Redis service
Using Redis from Python
Updating the Flask deployment
Deployments and rollouts
Rollout history
Rollout undo
Updating with the kubectl set command
Declarative Infrastructure