- Kubernetes for Serverless Applications
- Russ McKendrick
- 183字
- 2021-07-02 19:16:47
Deployments
One thing you may be thinking you will be able to do with a ReplicaSet is rolling upgrades and rollbacks. Unfortunately, ReplicaSets can only replicate the same version of a pod; luckily, this is where deployments come in.
A deployment controller is designed to update a ReplicaSet or pod. Lets use NGINX as an example. As you can see from the following definition, we have 3 replicas all running NGINX version 1.9.14:
apiVersion: apps/v1beta1
kind: Deployment
metadata:
name: nginx-deployment
spec:
replicas: 3
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx:1.9.14
ports:
- containerPort: 80
kubectl is the command-line client for Kubernetes; we will be looking at this in more detail in our next chapter.
We could deploy this using the following command:
$ kubectl create -f nginx-deployment.yaml
Now say we want to update the version of the NGINX image used. We simply need to run the following command:
$ kubectl set image deployment/nginx-deployment nginx=nginx:1.13.5 deployment "nginx-deployment" image updated
This will update each pod in turn until all of the pods are running the new version of NGINX.
- Unreal Engine:Game Development from A to Z
- Word 2000、Excel 2000、PowerPoint 2000上機(jī)指導(dǎo)與練習(xí)
- Mastering Spark for Data Science
- 計(jì)算機(jī)應(yīng)用基礎(chǔ)·基礎(chǔ)模塊
- 機(jī)器自動(dòng)化控制器原理與應(yīng)用
- Mastering Elastic Stack
- 計(jì)算機(jī)網(wǎng)絡(luò)技術(shù)基礎(chǔ)
- Windows內(nèi)核原理與實(shí)現(xiàn)
- JavaScript典型應(yīng)用與最佳實(shí)踐
- Google SketchUp for Game Design:Beginner's Guide
- 激光選區(qū)熔化3D打印技術(shù)
- 云計(jì)算和大數(shù)據(jù)的應(yīng)用
- 學(xué)練一本通:51單片機(jī)應(yīng)用技術(shù)
- 貫通開(kāi)源Web圖形與報(bào)表技術(shù)全集
- PostgreSQL 10 High Performance