虽然这样很不符合规范,但这是为了需求,木有办法
遇到问题主要是:没有主要运行的任务,自动杀死重启了.
解决方案: 命令中增加"/bin/bash", "-ce", "tail -f /dev/null"
保证不死
apiVersion: apps/v1
kind: Deployment
metadata:
name: rstudio
labels:
name: rstudio
namespace: default #pod的namespace
spec:
selector:
matchLabels:
name: rstudio #匹配的目标标签
replicas: 1
template:
metadata:
labels:
name: rstudio
spec:
containers:
- name: rstudio
image: hub.westlake.edu.cn:35000/rstudio-centos:v2
command: ["/bin/bash", "-ce", "rstudio-server start;tail -f /dev/null"]
imagePullPolicy: IfNotPresent
ports:
- containerPort: 8787
protocol: TCP #端口协议