1

我按照官方的说明在 Docker 上运行 kie server 和 workbench 没有问题。但是,当我尝试使用 Kubernetes 时,我遇到了一些问题。列表中没有执行服务器(业务中心 -> 部署 -> 执行服务器)。它们都已启动并运行,我可以访问 Business Central,http://localhost:31002/kie-server/services/rest/server/ 响应正确:

<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>

这是我用来创建部署和服务的 yaml 文件

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

部署到 Docker 时,我使用 --link drools-wb:kie-wb

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

在 Kubernetes 中,我创建了名为 kie-wb 的服务,但这无济于事。我在这里想念什么?

4

1 回答 1

1

我正在做一个类似的设置并使用您的 YAML 文件作为开始(谢谢)!

我必须将以下代码段添加到kia-server-showcase容器中:

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

它现在确实有效,至少据我所知。

于 2021-02-12T02:29:42.380 回答