k8s部署redis
1、redis-rc文件内容如下:cat redis-rc.yamlapiVersion: v1kind: ReplicationControllermetadata:name: redisspec:replicas: 1selector:app: redistemplate:metadata:labels:...
·
1、redis-rc文件内容如下:
cat redis-rc.yaml
apiVersion: v1
kind: ReplicationController
metadata:
name: redis
spec:
replicas: 1
selector:
app: redis
template:
metadata:
labels:
app: redis
spec:
containers:
- name: redis
image: redis
resources:
requests:
cpu: 100m #限制cpu的数量为0.1个
memory: 100Mi #限制内存为100M
ports:
- containerPort: 6379
2、redis-svc内容如下:
cat redis-svc.yaml
apiVersion: v1
kind: Service
metadata:
name: redis
spec:
type: NodePort
ports:
- port: 6379
nodePort: 30003
selector:
app: redis
更多推荐
已为社区贡献45条内容
所有评论(0)