k8s安装nacos(简易版)
apiVersion: apps/v1kind: Deploymentmetadata:name: nacosnamespace: liyuanlabels:app: nacosspec:selector:matchLabels:app: nacostemplate:metadata:labels:app: nacosspec:volumes:- name:
·
apiVersion: apps/v1
kind: Deployment
metadata:
name: nacos
namespace: liyuan
labels:
app: nacos
spec:
selector:
matchLabels:
app: nacos
template:
metadata:
labels:
app: nacos
spec:
volumes:
- name: application-conf
configMap:
name: nacos-application-conf
containers:
- name: nacos
image: nacos/nacos-server
imagePullPolicy: IfNotPresent
ports:
- containerPort: 8848
name: nacos-port
env:
# 此处写成脱机版就可以使用内置的数据源,无需远程连接数据源
- name: MODE
value: "standalone"
resources:
requests:
cpu: "0.5"
memory: "1024Mi"
limits:
cpu: "0.5"
memory: "1024Mi"
---
apiVersion: v1
kind: Service
metadata:
labels:
app: nacos
name: nacos-svc
namespace: liyuan
spec:
ports:
- port: 8848
targetPort: 8848
nodePort: 30009
selector:
app: nacos
type: NodePort
更多推荐
已为社区贡献16条内容
所有评论(0)