舉報

會員
Kubernetes for Developers
Ifyouareafull-stackorback-endsoftwaredevelopersinterested,curious,orbeingaskedtotestaswellasrunthecodeyou'recreating,youcanleverageKubernetestomakethatprocesssimplerandconsistentregardlessofwhereyoudeploy.Ifyou'relookingfordeveloperfocusedexamplesinNodeJSandPythonforhowtobuild,test,deploy,andrunyourcodewithKubernetes,thisisperfectforyou.
最新章節
- Leave a review - let other readers know what you think
- Other Books You May Enjoy
- Summary
- Mailing lists and forums
- Stack Overflow
- YouTube
品牌:中圖公司
上架時間:2021-08-27 18:11:03
出版社:Packt Publishing
本書數字版權由中圖公司提供,并由其授權上海閱文信息技術有限公司制作發行
- Leave a review - let other readers know what you think 更新時間:2021-08-27 19:04:55
- Other Books You May Enjoy
- Summary
- Mailing lists and forums
- Stack Overflow
- YouTube
- Slack
- Interacting with the Kubernetes project
- Telepresence
- ksync
- Draft
- img
- skaffold
- Brigade
- ksonnet
- Helm
- Linters
- Emerging projects for developers
- Missing resources
- Stuck in PodInitializing
- No endpoints available for service
- Adding your own setup to the container
- Starting and inspecting the image
- CrashLoopBackOff
- ErrImagePull
- Navigating the documentation
- Error validating data
- Common errors and how to resolve them
- Troubleshooting Common Problems and Next Steps
- Summary
- Next steps with pipelines
- Example pipeline
- Updating Jenkins
- Accessing Jenkins
- Installing Jenkins using Helm
- Example – using Jenkins and the Kubernetes plugin
- Next steps
- Example – using Minikube with Travis.CI
- Continuous integration with Kubernetes
- Interacting with the deployment
- Waiting for the pods to become available
- Deploying with kubectl
- Validating the cluster health
- Node.js tests and dependencies with mocha and chai
- Example – integration testing with Node.js
- Accessing the deployment
- Waiting for state changes
- PyTest fixtures and the python-kubernetes client
- PyTest and pytest-dependency
- Example – integration testing with Python
- Simple validation with Bats
- Tests in Kubernetes and system-under-test in Kubernetes namespaces
- Tests local and system-under-test in Kubernetes namespaces
- Tests local and system-under-test in Kubernetes
- Patterns of using Kubernetes with testing
- Reviewing resources needed for testing
- Testing strategies using Kubernetes
- Integration Testing
- Summary
- Considerations for adding tracing
- Add the libraries and code to generate traces
- Adding a tracing collector to your pod
- Example – adding tracing to your application
- Trying out Jaeger
- Architecture of Jaeger distributed tracing
- Spans and traces
- Distributed tracing with Jaeger
- Running Kibana in production
- Lucene query language
- Filtering by app
- Viewing logs using Kibana
- Log aggregation with EFK
- Installing and using Elasticsearch Fluentd and Kibana
- A Kubernetes concept – DaemonSet
- Logging and Tracing
- Summary
- Service signals in Prometheus
- Node.js metrics with Prometheus
- Flask metrics with Prometheus
- Using Prometheus to view application metrics
- Installing Grafana
- Viewing metrics with Prometheus
- Installing Prometheus using Helm
- Installing Helm
- Capturing metrics with Prometheus
- Choosing requests and limits for your containers
- Kubernetes concept – Quality of Service
- Built-in metrics with Kubernetes
- Monitoring and Metrics
- Summary
- Custom Resource Definition
- A Node.js example using Stateful Set
- Stateful Sets
- PersistentVolume and PersistentVolumeClaim
- Volumes
- Persistence with Kubernetes
- Celery worker
- RabbitMQ and configuration
- Celery worker example
- A worker queue example with Python and Celery
- CronJob
- Job
- Background Processing in Kubernetes
- Summary
- SIGTERM in Node.js
- SIGTERM in Python
- Handling a graceful shutdown
- Quick interactive testing
- Initialization containers
- Container lifecycle hooks
- Adding a probe to our Node.js example
- Running the Python probes example
- Adding a probe to our Python example
- Readiness probe
- Liveness probe
- Probes
- Getting a snapshot of the current state
- Deployments ReplicaSets and Pods
- Container lifecycle
- Pod lifecycle
- Pod and Container Lifecycles
- Summary
- Using the ConfigMap within Python/Flask
- SIDEBAR – JSONPATH
- Example – Python/Flask deployment with ConfigMap
- Secrets and security – how secret are the secrets?
- Exposing Secrets into a container
- Kubernetes resource – Secrets
- Dependencies on ConfigMaps
- Exposing ConfigMap as files inside the container
- Environment variables
- Exposing the configuration into your container images
- Managing ConfigMaps
- Creating a ConfigMap
- Kubernetes resource – ConfigMap
- Exposing labels and annotations in Pods
- Kubernetes resource – Annotations
- Audit trail
- ImagePullPolicy
- Declaring your first application
- Creating a simple deployment
- A wall of YAML
- Imperative versus declarative commands
- Declarative Infrastructure
- Summary
- Updating with the kubectl set command
- Rollout undo
- Rollout history
- Deployments and rollouts
- Updating the Flask deployment
- Using Redis from Python
- Finding the Redis service
- Example service – Redis
- Minikube service
- Service type – NodePort
- Service type – LoadBalancer
- Exposing services outside the cluster
- DNS for services
- Discovering services from within your Pod
- Headless service
- Service type – ExternalName
- Endpoints
- Defining a service resource
- Kubernetes resources – service
- Automatic labels and selectors
- Listing resources with labels using kubectl
- Viewing labels
- Kubernetes concepts – selectors
- Organization of labels
- Kubernetes concepts – labels
- Running a second process in a container
- Attaching to a running Pod
- Interactive deployment of an image
- More debugging techniques
- Timestamps
- Previous logs
- Streaming the logs
- Pods with more than one container
- Logs
- Sending output from your program
- Practical notes for building container images
- Getting options for your executable code
- Practical notes for writing software to run in a container
- Interacting with Your Code in Kubernetes
- Summary
- Tagging your container images
- Getting logs from your application
- Proxy
- Port forwarding
- Running your container
- Building the container
- Example – Node.js/Express container image
- Getting logs from your application
- How did the proxy know to connect to port 5000 on the container?
- Proxy
- Port forwarding
- Pod name
- Running your container
- Building the container
- Example – Python/Flask container image
- Dockerfile commands
- Making your first container
- Container registries
- Container images
- Packaging Your Code to Run in Kubernetes
- Summary
- Representing Kubernetes resources
- Kubernetes resource – Deployment
- Kubernetes resource – ReplicaSet
- Controllers
- Networks
- Kubernetes resource – Node
- Writing your code for Pods and Containers
- Namespaces
- Kubernetes resource – Pod
- Kubernetes concept – container
- Clearing and cleaning Docker images
- Verifying Docker
- Looking at what's built-in and included with Minikube
- Resetting and restarting your cluster
- Getting a local cluster up and running
- Optional tools
- What you need for development
- Setting Up Kubernetes for Development
- Reviews
- Get in touch
- Conventions used
- Download the example code files
- To get the most out of this book
- What this book covers
- Who this book is for
- Preface
- Packt is searching for authors like you
- About the reviewers
- About the author
- Contributors
- PacktPub.com
- Why subscribe?
- Packt Upsell
- Kubernetes for Developers
- Copyright and Credits
- Title Page
- 封面
- 封面
- 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
- Building the container
- Running your container
- Port forwarding
- Proxy
- Getting logs from your application
- Tagging your container images
- Summary
- 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
- Summary
- Declarative Infrastructure
- Imperative versus declarative commands
- A wall of YAML
- Creating a simple deployment
- Declaring your first application
- ImagePullPolicy
- Audit trail
- Kubernetes resource – Annotations
- Exposing labels and annotations in Pods
- Kubernetes resource – ConfigMap
- Creating a ConfigMap
- Managing ConfigMaps
- Exposing the configuration into your container images
- Environment variables
- Exposing ConfigMap as files inside the container
- Dependencies on ConfigMaps
- Kubernetes resource – Secrets
- Exposing Secrets into a container
- Secrets and security – how secret are the secrets?
- Example – Python/Flask deployment with ConfigMap
- SIDEBAR – JSONPATH
- Using the ConfigMap within Python/Flask
- Summary
- Pod and Container Lifecycles
- Pod lifecycle
- Container lifecycle
- Deployments ReplicaSets and Pods
- Getting a snapshot of the current state
- Probes
- Liveness probe
- Readiness probe
- Adding a probe to our Python example
- Running the Python probes example
- Adding a probe to our Node.js example
- Container lifecycle hooks
- Initialization containers
- Quick interactive testing
- Handling a graceful shutdown
- SIGTERM in Python
- SIGTERM in Node.js
- Summary
- Background Processing in Kubernetes
- Job
- CronJob
- A worker queue example with Python and Celery
- Celery worker example
- RabbitMQ and configuration
- Celery worker
- Persistence with Kubernetes
- Volumes
- PersistentVolume and PersistentVolumeClaim
- Stateful Sets
- A Node.js example using Stateful Set
- Custom Resource Definition
- Summary
- Monitoring and Metrics
- Built-in metrics with Kubernetes
- Kubernetes concept – Quality of Service
- Choosing requests and limits for your containers
- Capturing metrics with Prometheus
- Installing Helm
- Installing Prometheus using Helm
- Viewing metrics with Prometheus
- Installing Grafana
- Using Prometheus to view application metrics
- Flask metrics with Prometheus
- Node.js metrics with Prometheus
- Service signals in Prometheus
- Summary
- Logging and Tracing
- A Kubernetes concept – DaemonSet
- Installing and using Elasticsearch Fluentd and Kibana
- Log aggregation with EFK
- Viewing logs using Kibana
- Filtering by app
- Lucene query language
- Running Kibana in production
- Distributed tracing with Jaeger
- Spans and traces
- Architecture of Jaeger distributed tracing
- Trying out Jaeger
- Example – adding tracing to your application
- Adding a tracing collector to your pod
- Add the libraries and code to generate traces
- Considerations for adding tracing
- Summary
- Integration Testing
- Testing strategies using Kubernetes
- Reviewing resources needed for testing
- Patterns of using Kubernetes with testing
- Tests local and system-under-test in Kubernetes
- Tests local and system-under-test in Kubernetes namespaces
- Tests in Kubernetes and system-under-test in Kubernetes namespaces
- Simple validation with Bats
- Example – integration testing with Python
- PyTest and pytest-dependency
- PyTest fixtures and the python-kubernetes client
- Waiting for state changes
- Accessing the deployment
- Example – integration testing with Node.js
- Node.js tests and dependencies with mocha and chai
- Validating the cluster health
- Deploying with kubectl
- Waiting for the pods to become available
- Interacting with the deployment
- Continuous integration with Kubernetes
- Example – using Minikube with Travis.CI
- Next steps
- Example – using Jenkins and the Kubernetes plugin
- Installing Jenkins using Helm
- Accessing Jenkins
- Updating Jenkins
- Example pipeline
- Next steps with pipelines
- Summary
- Troubleshooting Common Problems and Next Steps
- Common errors and how to resolve them
- Error validating data
- Navigating the documentation
- ErrImagePull
- CrashLoopBackOff
- Starting and inspecting the image
- Adding your own setup to the container
- No endpoints available for service
- Stuck in PodInitializing
- Missing resources
- Emerging projects for developers
- Linters
- Helm
- ksonnet
- Brigade
- skaffold
- img
- Draft
- ksync
- Telepresence
- Interacting with the Kubernetes project
- Slack
- YouTube
- Stack Overflow
- Mailing lists and forums
- Summary
- Other Books You May Enjoy
- Leave a review - let other readers know what you think 更新時間:2021-08-27 19:04:55