3

We are considering moving our ColdFusion servers to AKS, and have been messing around with a test deployment to see how things work. To handle scaling of the CF servers we would like to setup a Redis pod to handle session management for the CF cluster.

Following the instructions I've found at https://helpx.adobe.com/coldfusion/using/docker-images-coldfusion.html and https://github.com/kubernetes/examples/blob/master/staging/storage/redis/redis-master.yaml, modified as I was getting errors with straight copy/paste, I've come up with the following yaml file:

    apiVersion: apps/v1beta1
    kind: Deployment
    metadata:
      name: cfsample
    spec:
      replicas: 1
      strategy:
        rollingUpdate:
          maxSurge: 1
          maxUnavailable: 1
      minReadySeconds: 5 
      template:
        metadata:
          labels:
            app: cfsample
        spec:
          containers:
          - name: cfsample
            image: cftest.azurecr.io/coldfusion:v1
            ports:
            - containerPort: 8500
            volumeMounts:
              - name: code
                mountPath: /app
            resources:
              requests:
                cpu: 250m
              limits:
                cpu: 500m
            env:
            - name: acceptEULA
              value: "YES"
            - name: password
              value: "testCF321"
            - name: configureExternalSessions
              value: "true"
            - name: externalSessionsHost
              value: "cfredis"
            - name: externalSessionsPort
              value: "6379"

          - name: cfredis
            image: redis:latest
            ports:
            - containerPort: 6379
            volumeMounts:
              - name: redis
                mountPath: /redis-master-data

          imagePullSecrets:
            - name: registrycreds
          volumes:
          - name: code
            azureFile:
              secretName: azure-secret
              shareName: code
              readOnly: false
          - name: redis
            azureFile:
              secretName: azure-secret
              shareName: redis
              readOnly: false
    ---
    apiVersion: v1
    kind: Service
    metadata:
      name: cfsample
    spec:
      type: LoadBalancer
      ports:
      - port: 80
        targetPort: 8500
      selector:
        app: cfsample

When I hit a test page (any of my test pages) I have on this server in my browser, it does work and will even set a session variable and dump the session scope. However, the next page I try to hit reports an error:

    Message coldfusion.server.ServiceFactory$ServiceNotAvailableException: The Runtime service is not available.

    Description The server encountered an unexpected condition that prevented it from fulfilling the request.

    Exception

    javax.servlet.ServletException: coldfusion.server.ServiceFactory$ServiceNotAvailableException: The Runtime service is not available.
        coldfusion.bootstrap.ClassloaderHelper.initServletClass(ClassloaderHelper.java:129)
        coldfusion.bootstrap.BootstrapServlet.init(BootstrapServlet.java:111)
        org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:491)
        org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
        org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:357)
        org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408)
        org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
        org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:764)
        org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1388)
        org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
        java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
        java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
        org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
        java.base/java.lang.Thread.run(Thread.java:834)

I would normally check the CF logs at this point, but I don't know how to access them within a pod. In any case, it looks to me like ColdFusion is crashing, likely because of some incorrect settings in the yaml when setting up Redis as a session datastore (since I just cobbled this yaml together via trial and error). Unfortunately, searching Google for "kubernetes yaml redis coldfusion" returns a staggering 7 results.

What is the correct way to define a Redis container within the yaml and have ColdFusion use it as a session datastore?

Nicholas
  • 131
  • 3

1 Answers1

1

A runtime service not being available typically means an invalid XML config file in your server home or a fatal error during the creation of the services. Check the full servlet out/error logs when the server first boots as well as the application.log for potential details. I don't know anything about the Redis part of your question, but that may help you troubleshoot the CF error.

Brad Wood
  • 180
  • 1
  • 7
  • Thanks. However, this error only occurs when I add the configureExternalSessions=true line. In other words, when I remove Redis from the equation everything works as expected. – Nicholas May 13 '19 at 16:58
  • That doesn't change my reply to you. You'll need to troubleshoot WHY the service isn't coming up. It's sort of obvious that the issue is specific to Redis. And that is why i told you to look in the application log. Or, alternatively you can contact Adobe's support and see if they will help you. – Brad Wood May 13 '19 at 20:04
  • I just noticed you mentioned not knowing how to access the server logs. You need to sort that out. I would recommend testing this locally to simplify the setup where you have full access to your logs. – Brad Wood May 13 '19 at 20:06