1

I followed the official instruction and had no problem with running kie server and workbench on Docker. However, when I try with Kubernetes I bump into some problem. There is no Execution server in the list (Business Central -> Deploy -> Execution Servers). Both of them are up and running, I can access Business Central, http://localhost:31002/kie-server/services/rest/server/ is responding correctly :

<response type="SUCCESS" msg="Kie Server info">
<kie-server-info>
<capabilities>KieServer</capabilities>
<capabilities>BRM</capabilities>
<capabilities>BPM</capabilities>
<capabilities>CaseMgmt</capabilities>
<capabilities>BPM-UI</capabilities>
<capabilities>BRP</capabilities>
<capabilities>DMN</capabilities>
<capabilities>Swagger</capabilities>
<location>http://localhost:8080/kie-server/services/rest/server</location>
<messages>
<content>Server KieServerInfo{serverId='kie-server-kie-server-7fcc96f568-2gf29', version='7.45.0.Final', name='kie-server-kie-server-7fcc96f568-2gf29', location='http://localhost:8080/kie-server/services/rest/server', capabilities=[KieServer, BRM, BPM, CaseMgmt, BPM-UI, BRP, DMN, Swagger]', messages=null', mode=DEVELOPMENT}started successfully at Tue Oct 27 10:36:09 UTC 2020</content>
<severity>INFO</severity>
<timestamp>2020-10-27T10:36:09.433Z</timestamp>
</messages>
<mode>DEVELOPMENT</mode>
<name>kie-server-kie-server-7fcc96f568-2gf29</name>
<id>kie-server-kie-server-7fcc96f568-2gf29</id>
<version>7.45.0.Final</version>
</kie-server-info>
</response>

Here is my yaml file that I am using to create deployments and services

apiVersion: apps/v1
kind: Deployment
metadata:
  name: kie-wb
spec:
  replicas: 1
  selector:
    matchLabels:
      app: kie-wb
  template:
    metadata:
      labels:
        app: kie-wb
    spec:
      containers:
        - name: kie-wb
          image: jboss/drools-workbench-showcase:latest
          ports:
            - containerPort: 8080
            - containerPort: 8001
          securityContext:
            privileged: true
---
kind: Service
apiVersion: v1
metadata:
  name: kie-wb
spec:
  selector:
    app: kie-wb
  ports:
    - name: "8080"
      port: 8080
      targetPort: 8080
    - name: "8001"
      port: 8001
      targetPort: 8001
#  type: LoadBalancer
---
apiVersion: v1
kind: Service
metadata:
  name: kie-wb-np
spec:
  type: NodePort
  ports:
    - port: 8080
      targetPort: 8080
      nodePort: 31001
  selector:
    app: kie-wb
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: kie-server
spec:
  replicas: 1
  selector:
    matchLabels:
      app: kie
  template:
    metadata:
      labels:
        app: kie
    spec:
      containers:
        - name: kie
          image: jboss/kie-server-showcase:latest
          ports:
            - containerPort: 8080
          securityContext:
            privileged: true
---
kind: Service
apiVersion: v1
metadata:
  name: kie-server
spec:
  selector:
    app: kie
  ports:
    - name: "8080"
      port: 8080
      targetPort: 8080
---
apiVersion: v1
kind: Service
metadata:
  name: kie-server-np
spec:
  type: NodePort
  ports:
    - port: 8080
      targetPort: 8080
      nodePort: 31002
  selector:
    app: kie
#  type: LoadBalancer

When deploying to Docker I am using --link drools-wb:kie-wb

docker run -p 8180:8080 -d --name kie-server --link drools-wb:kie-wb jboss/kie-server-showcase:latest

In Kubernetes I created service called kie-wb, but that doesn't help. What am I missing here?

baxter
  • 11
  • 5

1 Answers1

1

I was working on a similar set up and used your YAML file as a start (thanks for that)!

I had to add the following snippet to the kia-server-showcase container:

 env:
          - name: KIE_WB_ENV_KIE_CONTEXT_PATH
            value: "business-central"

It does work now, at least as far as I can tell.

  • could you share your yamls? – Gabe Feb 22 '21 at 18:29
  • 1
    Gabe, its the exact YAML baxter posted with my snippet added under the `kia-server` container. – Eugene Shvartsman Feb 24 '21 at 02:34
  • Thank you for confirmation. Curious how you determined to add the env var? Good find! – Gabe Feb 24 '21 at 15:06
  • Also is there a significance with the naming? for example i replaced "kie-wb" with "drools-wb", "kie-server" with "drools-server", and "kie" with "drools". When I do that it no longer sees the exe server, I can route to both the controller and server doing a port forward in kubectl tho... – Gabe Feb 24 '21 at 16:26
  • 1
    I checked the kie-server start up script and saw that it was using that var name. The naming shouldn't matter as long the selectors match the labels. Check the KieServer logs to see if it's connecting to the correct URL. – Eugene Shvartsman Mar 02 '21 at 16:52