基礎(chǔ)
提示:此篇幫助朋友們,養(yǎng)成從0到1不斷延伸知識的一種方法
- 最簡單的創(chuàng)建pod入手
訪問官方文檔,直接使用案例,進行修改即可!
官網(wǎng)地址:https://kubernetes.io/zh-cn/docs/tasks/configure-pod-container/assign-pods-nodes/
文章來源:http://www.zghlxwxcb.cn/news/detail-824000.html
- 刪除不需要的部分,根據(jù)規(guī)則添加需要的參數(shù)即可得到需要的,代碼如下:
注意:區(qū)分大小寫,相同層級的要對齊
編輯文件 vim drain.yml文章來源地址http://www.zghlxwxcb.cn/news/detail-824000.html
apiVersion: v1
kind: Pod
metadata:
name: drain
spec:
containers:
- name: nginx
image: nginx
imagePullPolicy: IfNotPresent
- name: redis
image: redis
imagePullPolicy: IfNotPresent
- name: memcached
image: memcached
imagePullPolicy: IfNotPresent
- name: consul
image: consul
到了這里,關(guān)于【Kubernetes】 從基礎(chǔ)認(rèn)識 k8s核心pod相關(guān)概念的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!