当前位置: 首页 > 知识库问答 >
问题:

kubectl apply命令后,应用程序未在网页上查看

商璞
2023-03-14

我正在运行一个名为RSPM的应用程序。在kubectl apply-f之后,pod正在成功创建

部署。亚马尔

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

这里是配置。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

任何帮助都将不胜感激!谢谢

共有1个答案

上官和惬
2023-03-14

部署的清单文件格式不好,您缺少-在容器中,尝试:

apiVersion: apps/v1 
kind: Deployment
metadata:
  name: rspm-db-deployment
spec:
  selector:
    matchLabels:
      app: rspm
  template:
    metadata:
      labels:
        app: rspm
    spec:
      containers:
      - 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

对我来说,pod没有启动,我在pod中获取这些日志:

kubectl日志rspm-db部署-54f66fb6f8-k9845

+ trap deactivate EXIT
+ '[' -z '' ']'
+ '[' -z '' ']'
+ test -f /etc/rstudio-pm/license.lic
+ unset RSPM_LICENSE
+ unset RSPM_LICENSE_SERVER
+ /opt/rstudio-pm/bin/rstudio-pm --config /etc/rstudio-pm/rstudio-pm.gcfg
2020/08/06 15:42:50 Resource limits: {"nofile":{"soft":1048576,"hard":1048576}}
2020/08/06 15:42:50 Starting RStudio Package Manager v1.1.6.1-5
2020/08/06 15:42:50 Using cache version 8
2020/08/06 15:42:50 Using metrics cache version 1
2020/08/06 15:42:50 Loading server configuration from /etc/rstudio-pm/rstudio-pm.gcfg
2020/08/06 15:42:50 Warning: clearing log region activation reloaded. Any temporary log output activation/deactivation has been reset.
2020/08/06 15:42:50 Using data directory: /var/lib/rstudio-pm
2020/08/06 15:42:50 Creating database directory: /var/lib/rstudio-pm/db
2020/08/06 15:42:50 Creating packages directory: /var/lib/rstudio-pm/packages
2020/08/06 15:42:50 Creating cran directory: /var/lib/rstudio-pm/cran
2020/08/06 15:42:50 Creating binaries directory: /var/lib/rstudio-pm/binaries
2020/08/06 15:42:50 Creating cache directory: /var/lib/rstudio-pm/cache
2020/08/06 15:42:50 Creating launcher directory: /var/lib/rstudio-pm/launcher
2020/08/06 15:42:50 Creating metrics directory: /var/lib/rstudio-pm/metrics
2020/08/06 15:42:50 Using launcher directory: /var/lib/rstudio-pm/launcher
2020/08/06 15:42:50 Creating launcher_logs directory: /var/lib/rstudio-pm/launcher/custom_logs
2020/08/06 15:42:50 Creating launcher_logs_user directory: /var/lib/rstudio-pm/launcher/custom_logs/rstudio-pm
2020/08/06 15:42:51 Updating owner to rstudio-pm for launcher directory: /var/lib/rstudio-pm/launcher
2020/08/06 15:42:51 Creating git directory: /var/lib/rstudio-pm/git
2020/08/06 15:42:51 Creating staging directory: /var/lib/rstudio-pm/packages/staging
2020/08/06 15:42:51 Using CRAN.SystemReqsRulesURL: https://rspm-sync.rstudio.com/sysreqs
2020/08/06 15:42:51 Warning: SSL is not configured. Using Package Manager over insecure HTTP is not recommended.
2020/08/06 15:42:51 A new RSPM encryption key was created at '/var/lib/rstudio-pm/rstudio-pm.key'.
2020/08/06 15:42:51 Using HTTP access log: /var/log/rstudio-pm.access.log
2020/08/06 15:42:51 Added trailing slash to the configured server address: http://testserver.local/
2020/08/06 15:42:51 Starting HTTP listener on :4242
2020/08/06 15:42:51 Starting admin service using sock file /var/run/rstudio-pm/rstudio-pm.sock
2020/08/06 15:42:51 Service ready to listen for requests
2020/08/06 15:42:51 Service mode file not found
2020/08/06 15:42:51 Starting RStudio Package Manager Services
2020/08/06 15:42:51 Starting licensing...
2020/08/06 15:42:51 Unable to obtain a valid license: Your RStudio Package Manager license has expired. Please contact your customer success representative or email sales@rstudio.com to obtain a current license.
2020/08/06 15:42:51 Unable to obtain a valid license: Your RStudio Package Manager license has expired. Please contact your customer success representative or email sales@rstudio.com to obtain a current license.
2020/08/06 15:42:51 Usage data enabled.
2020/08/06 15:42:51 R version specified in Server.RVersion cannot be analyzed: /usr/lib64/R: stat /usr/lib64/R: no such file or directory
2020/08/06 15:42:51 Stopping: metrics buffer...
2020/08/06 15:42:51 Stopping: license manager...
2020/08/06 15:42:51 Done Stopping: license manager
2020/08/06 15:42:51 Stopping: metrics janitor...
2020/08/06 15:42:51 Done Stopping: metrics janitor
2020/08/06 15:42:51 Done Stopping: metrics buffer
2020/08/06 15:42:51 Stopped RStudio Package Manager Online Services
2020/08/06 15:42:51 Error running services: Error: Unable to use R on this system: Could not locate an R installation
2020/08/06 15:42:51 Gracefully shutting down, received signal to terminate
2020/08/06 15:42:51 Stopping: signal dumper...
2020/08/06 15:42:51 Done Stopping: signal dumper
2020/08/06 15:42:51 Exited RStudio Package Manager
+ deactivate
+ echo 'Deactivating license ...'
Deactivating license ...
+ /opt/rstudio-pm/bin/license-manager deactivate
 类似资料:
  • 问题内容: 我需要构建一个Android应用程序,使您可以在我的应用程序内部查看网页。我需要这不是在浏览器中,而是在我的应用中。我找到了页面加载时的答案和一些选项。我想当然要在测试之后分享我在这里找到的信息..... 问题答案: 首先需要向清单添加INTERNET权限。 然后,使用WebView类显示网页。首先,创建一个包含Web视图的布局: 在您的“活动”(可能是onCreate)中,使用您创建

  • 问题内容: 我正在尝试构建一个使用CoreBluetooth的命令行应用程序。问题是,它在命令行应用程序上不起作用。 我已将我的代码(实现CBCentralManagerDelegate协议的类- 称为此类)从命令行应用程序项目移至另一个Mac OS GUI应用程序。 我在--supersample中运行了一些测试,我只是初始化了一个创建on 实例的实例,然后调用。 这是我在CLI和GUI项目中所

  • 运行此命令时,“create react app myapp”被卡住,如下面的屏幕截图所示:它已在目录“D:\usr\local\myapp”中创建了3个文件,如下所示 1)node_modules-文件夹 2) 包裹。json 3) 包裹锁。json D:\usr\本地 在D:\usr\local\myapp中创建新的React应用。 安装软件包。这可能需要几分钟。正在使用cra模板安装reac

  • 问题内容: 我想在Java swing应用程序中显示一个网页。与使用HTML时类似,但在Java Swing中。这可能吗?如果可以,怎么办? 问题答案: 使用:

  • 问题内容: 嗨,我正在开发一个需要我运行一些bash代码的应用程序,有没有一种方法可以将脚本硬编码到我的应用程序中然后运行它?例如(这是一个非常简化的示例) 我有以下方法来运行一行bash命令,但需要在多行中运行类似的内容。同样,上面的代码是一个非常简化的示例,我实际上在执行的操作必须通过脚本运行,而不能通过Java完成。我也想对它进行硬编码,因为我知道可以将脚本存储在手机上并使用以下命令运行它,

  • 用gdb调试多线程程序时,如果想查看线程信息,可以使用“i threads”命令(i是info命令缩写),例如: (gdb) i threads 106 process 2689429 0xff04af84 in __lwp_park () from /lib/libc.so.1 105 process 2623893 0xff04af84 in __lwp_park () f