欧美一区二区三区,国内熟女精品熟女A片视频小说,日本av网,小鲜肉男男GAY做受XXX网站

k8s安裝mongo

洪振霞2年前14瀏覽0評論

k8s安裝mongo?

vi mongodb.yaml

apiVersion: apps/v1

kind: Deployment

metadata:

namespace: asmongo

name: mongodb

labels:

app: mongodb

spec:

replicas: 1

selector:

matchLabels:

app: mongodb

template:

metadata:

labels:

app: mongodb

spec:

nodeName: k8s-node1 # 固定在 k8s-node1 節點

containers:

- name: mongodb

image: mongo:4.2.9

resources:

limits: # 限定資源

cpu: 2000m

memory: 8Gi

requests:

cpu: 100m

memory: 8Gi

env:

- name: MONGO_INITDB_ROOT_USERNAME # 設置用戶名

value: root

- name: MONGO_INITDB_ROOT_PASSWORD # 設置密碼

value: 'root@123'

volumeMounts:

- mountPath: /data/db

name: mongodb-volume

volumes:

- name: mongodb-volume

hostPath: path: /data/mongodb-volume # 映射的宿主機目錄

type: DirectoryOrCreate

---

apiVersion: v1

kind: Service

metadata:

namespace: asmongo

name: mongodb

spec:

type: ClusterIP

selector:

app: mongodb

ports:

- port: 27018

targetPort: 27018