Shinyproxy/Java not starting R container in k8s cluster

Hello all,
We are running a shinyproxy server, sidecar, apps and NGINX ingress controller inside an Azure kubernetes cluster. We are not able to get Java to start our R container.

We are getting the following error:

Error Status code: 500 Message: Container did not respond in time

We did a docker run ... of our containerized app, the 01_hello and 06_tabsets demo apps. All the manually run R sessions successfully loaded the apps and showed no errors.

Our setup:

  • We are using Azure to host our app in an AKS cluster with the containers being referenced from Azure Container Registry.
  • We have a containerized NGINX ingress controller in front of shinyproxy.
  • We are authenticating with Azure Active Directory (AAD) and openID.

We can sign-in and get the landing page with no problem, but selecting a link to one of the apps results in the Container did not respond in time error. This is true of both our app as well as the example apps included with shinyproxy.

We’d be grateful for any ideas as to why we’re running into this problem.

Steve Lehman

YAML files…

Below are the application.yml, sp-deployment.yaml and the sp-service.yaml.

application.yml

proxy:
  port: 8080
  container-backend: kubernetes
  authentication: openid 
  openid:  
    roles-claim: https://shinyproxy.io/shinyproxy_roles
    auth-url: https://login.microsoftonline.com/<subscriptionID>/oauth2/authorize
    token-url: https://login.microsoftonline.com/<subscriptionID>/oauth2/token
    jwks-url: https://login.microsoftonline.com/common/discovery/keys
    client-id: <clientID>
    client-secret: "<client-secret>" 
  kubernetes:
    internal-networking: true
    url: http://localhost:8001
    namespace: default  
    image-pull-policy: Always 
    image-pull-secret: regcred 
    container-protocol: https
  specs:
  - id: 01_hello
    display-name: Hello Application
    description: Application which demonstrates the basics of a Shiny app
    container-cmd: ["R", "-e", "shinyproxy::run_01_hello()"]
    container-image: openanalytics/shinyproxy-demo
  - id: 06_tabsets
    description: Shinyproxy demo app
    container-cmd: ["R", "-e", "shinyproxy::run_06_tabsets()"]
    container-image: openanalytics/shinyproxy-demo
  - id: edAI-tidy
    display-name: Jeffco Analytics - tidyverse
    description: Live analytics for the district
    container-cmd: ["R", "-e", "shiny::runApp('/srv/shiny-server/coalesce/')"]
    container-image: <ACR.azurecr.io>/edai-tidy:latest
logging:
  file:
    shinyproxy.log
server:
  useForwardHeaders: true 

sp-deployment.yaml

apiVersion: apps/v1
kind: Deployment
metadata:
name: shinyproxy
spec:
selector:
  matchLabels:
    run: shinyproxy
replicas: 1
template:
  metadata:
    labels:
      run: shinyproxy
  spec:
    containers:
    - name: shinyproxy
      image: <ACR.azurecr.io>/shinyproxy-server:latest 
      imagePullPolicy: Always
      ports:
      - containerPort: 8080
    - name: kube-proxy-sidecar
      image: <ACR.azurecr.io>/kube-proxy-sidecar:latest
      imagePullPolicy: Always
      ports:
      - containerPort: 8001
    imagePullSecrets:
      - name: regcred

sp-service.yaml

kind: Service
apiVersion: v1
metadata:
  name: shinyproxy
spec:
  type: ClusterIP
  selector:
    run: shinyproxy
  ports:
  - protocol: TCP
    port: 8080
    targetPort: 8080

We were able to get it working by removing container-protocol: https from the kubernetes: section of application.yml.

2 Likes