kubernetes實踐之二十三:ReplicationController
一:體系結構圖
二:舉例
1. deployment.yaml
2.daemonSet.yaml
二:舉例
1. deployment.yaml
點選(此處)摺疊或開啟
-
apiVersion: extensions/v1beta1
-
kind: Deployment
-
metadata:
-
name: desktop
-
labels:
-
app: desktop
-
spec:
- replicas: 2
-
selector:
-
matchLabels:
-
app: desktop
-
template:
-
metadata:
-
labels:
-
app: desktop
-
spec:
-
containers:
-
- name: desktop
-
image: 127.0.0.1:5000/tomcat:desktop
-
volumeMounts:
-
- name: jdkdir
-
mountPath: /usr/local/jdk
-
- name: uploaddir
-
mountPath: /mnt/upload
-
ports:
-
- containerPort: 8080
-
volumes:
-
- name: jdkdir
-
hostPath:
-
path: /mnt/devops/jdk1.8
-
- name: uploaddir
-
hostPath:
- path: /mnt/upload
點選(此處)摺疊或開啟
-
apiVersion: extensions/v1beta1
-
kind: DaemonSet
-
metadata:
-
name: desktop
-
labels:
-
app: desktop
-
spec:
-
selector:
-
matchLabels:
-
app: desktop
-
template:
-
metadata:
-
labels:
-
app: desktop
-
spec:
-
containers:
-
- name: desktop
-
image: 127.0.0.1:5000/tomcat:desktop
-
volumeMounts:
-
- name: jdkdir
-
mountPath: /usr/local/jdk
-
- name: uploaddir
-
mountPath: /mnt/upload
-
ports:
-
- containerPort: 8080
-
volumes:
-
- name: jdkdir
-
hostPath:
-
path: /mnt/devops/jdk1.8
-
- name: uploaddir
-
hostPath:
- path: /mnt/upload
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/28624388/viewspace-2153290/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- kubernetes實踐之二十六:GlusterFS
- kubernetes實踐之二十七:Harbor
- kubernetes實踐之二十:網路原理
- kubernetes實踐之二十二:Pod
- kubernetes實踐之二十四:Service
- kubernetes實踐之六十三:使用技巧
- kubernetes實踐之三十三:基本概念
- kubernetes實踐之四十三: Service詳解
- kubernetes實踐之二:建立TLS證書和金鑰TLS
- kubernetes實踐之五十三:Service中的故障排查
- kubernetes實踐之二十一:物件與元件簡介物件元件
- kubernetes實踐之七十三:Istio之配置請求路由路由
- kubernetes實踐之十三: 負載均衡機制Ingress負載
- kubernetes實踐之二十五:儲存卷 PV&PVC
- kubernetes實踐之二十九:Kubernetes+Harbor+Gitlab+Jenkins+Maven DevOpsGitlabJenkinsMavendev
- kubernetes實踐之二十八:使用Harbor作為私有映象倉庫
- Kubernetes(k8s)控制器(三):ReplicationControllerK8SController
- Kubernetes監控實踐
- Serverless Kubernetes 落地實踐Server
- Kubernetes Deployment 最佳實踐
- Docker進階與實踐之二:NamespaceDockernamespace
- Kubernetes 微服務最佳實踐微服務
- Kubernetes 最佳安全實踐指南
- kubernetes實踐之十一:EFK
- kubernetes實踐之六十:Cabin-Manage Kubernetes
- 28-replicationcontrollerController
- 企業BI實踐系列之二:企業定位
- VPGAME的Kubernetes遷移實踐GAM
- VPGAME 的 Kubernetes 遷移實踐GAM
- 華為雲的Kubernetes實踐之路
- Kubernetes在宜信落地實踐
- kubernetes1.13.X實踐-部署
- Kubernetes YAML最佳實踐和策略YAML
- kubernetes實踐之五十二:Helm
- kubernetes實踐之五十七:PodPreset
- kubernetes實踐之五十八:CronJob
- kubernetes實踐之十七:架構架構
- kubernetes實踐之三十一:kubectl