【发布时间】:2020-11-26 21:14:53
【问题描述】:
我正在运行一个名为 RSPM 的应用程序。在 kubectl apply -f
deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: rspm-db-deployment
spec:
selector:
matchLabels:
app: rspm
template:
metadata:
labels:
app: rspm
spec:
containers:
- env:
- name: RSPM_LICENSE
value: MY LICENSE
image: rstudio/rstudio-package-manager:latest
name: rstudio-package-manager
ports:
- containerPort: 4242
volumeMounts:
- name: test-config
mountPath: /etc/rstudio-pm/
resources: {}
securityContext:
privileged: true
volumes:
- name: test-config
configMap:
name: test-config
restartPolicy: Always
status: {}
---
kind: Service
apiVersion: v1
metadata:
name: rstudio-pm
spec:
selector:
app: rspm
ports:
- protocol: TCP
port: 4242
targetPort: 4242
nodePort: 31040
type: NodePort
这里是 config.yaml 文件
apiVersion: v1
kind: ConfigMap
metadata:
name: test-config
labels:
app: rspm
data:
rstudio-pm.gcfg: |
[Server]
Address = http://testserver.local
RVersion = /usr/lib64/R
[HTTP]
Listen = :4242
任何帮助将不胜感激! 谢谢!
【问题讨论】:
-
很奇怪,因为没有任何意义将
kubectl exec运行到 pod 中以使其可访问。我认为您需要查看如何构建主映像,看看您是否错过了 Dockefile 中产生此行为的任何步骤。你能分享一个产生相同行为的示例图像吗? -
我使用的是默认图片。没有对默认图像进行任何更改。 @koopakiller
标签: linux docker kubernetes deployment yaml