在入口后面配置Websphere Application Server时出现问题 [英] Problem configuring websphere application server behind ingress

查看:162
本文介绍了在入口后面配置Websphere Application Server时出现问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在运行Websphere应用程序服务器部署和服务(类型为LoadBalancer). Websphere管理控制台可以在URL https://svcloadbalancerip:9043/ibm/console/logon.jsp

I am running websphere application server deployment and service (type LoadBalancer). The websphere admin console works fine at URL https://svcloadbalancerip:9043/ibm/console/logon.jsp

NAME         TYPE           CLUSTER-IP    EXTERNAL-IP      PORT(S)                                                                                                                    AGE
was-svc      LoadBalancer   x.x.x.x   x.x.x.x   9080:30810/TCP,9443:30095/TCP,9043:31902/TCP,7777:32123/TCP,31199:30225/TCP,8880:31027/TCP,9100:30936/TCP,9403:32371/TCP   2d5h

但是,如果我使用以下入口文件配置入口后面的Websphere服务:

But if i configure that websphere service behind ingress using ingress file like:

apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
  name: nginx-ingress-check
  annotations:
      kubernetes.io/ingress.class: "nginx"
spec:
  rules:
  - http:
      paths:
      - path: /ibm/console/logon.jsp
        backend:
          serviceName: was-svc
          servicePort: 9043
      - path: /v1
        backend:
          serviceName: web
          servicePort: 8080

URL https://ingressip//ibm/console/logon.jsp不起作用. 我也尝试过重写注释.

The url https://ingressip//ibm/console/logon.jsp doesn't works. I have tried the rewrite annotation too.

任何人都可以使用部署和服务来帮助将ibmcom/websphere-traditional docker映像部署在kubernetes中.服务已映射到入口后面,并且应该以某种方式从入口打开Websphere管理控制台

Can anyone help to just deploy the ibmcom/websphere-traditional docker image in kubernetes using deployment and service. With the service mapped behind the ingress and the websphere admin console should somehow be opened from ingress

推荐答案

IBM团队提供了一个舵图,该舵图也具有入口资源.在代码段中,您也缺少与SSL相关的注释.

There is a helm chart available from IBM team which has the ingress resource as well. In your code snippet, you are missing SSL related annotations as well.

  • https://hub.helm.sh/charts/ibm-charts/ibm-websphere-traditional
  • https://github.com/IBM/charts/tree/master/stable/ibm-websphere-traditional

在以下代码示例中,我为管理控制台添加了虚拟主机配置,以与端口443配合使用.

I have added the Virtual Host configuration for admin console to work with port 443 in the following code sample.

请注意:在入口处暴露管理控制台不是一个好习惯.配置应通过wsadmin或通过扩展基本Dockerfile来完成.重新启动容器后,通过控制台进行的所有更改都将丢失.

Please Note: Exposing admin console on the ingress is not a good practice. Configuration should be done via wsadmin or by extending the base Dockerfile. Any changes done through the console will be lost when the container restarts.

apiVersion: v1
kind: Service
metadata:
  creationTimestamp: null
  name: websphere
spec:
  type: NodePort
  ports:
   - name: admin
     port: 9043
     protocol: TCP
     targetPort: 9043
     nodePort: 30510
   - name: app
     port: 9443
     protocol: TCP
     targetPort: 9443
     nodePort: 30511
  selector:
    run: websphere
status:
  loadBalancer: {}
---
apiVersion: v1
kind: ConfigMap
metadata:
  name: websphere-admin-vh
  namespace: default
data:
  ingress_vh.props: |+
    #
    # Header
    #
    ResourceType=VirtualHost
    ImplementingResourceType=VirtualHost
    ResourceId=Cell=!{cellName}:VirtualHost=admin_host
    AttributeInfo=aliases(port,hostname)
    #

    #   
    #Properties
    #
    443=*

    EnvironmentVariablesSection
    #
    #
    #Environment Variables
    cellName=DefaultCell01
---
apiVersion: v1
kind: Pod
metadata:
  creationTimestamp: null
  labels:
    run: websphere
  name: websphere
spec:
  containers:
  - image: ibmcom/websphere-traditional
    name: websphere
    volumeMounts:
    - name: admin-vh
      mountPath: /etc/websphere/
    ports:
    - name: app
      containerPort: 9443
    - name: admin
      containerPort: 9043
  volumes:
  - name: admin-vh
    configMap:
      name: websphere-admin-vh
---
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
  name: nginx-ingress-check
  annotations:
      kubernetes.io/ingress.class: "nginx"
      nginx.ingress.kubernetes.io/secure-backends: "true" 
      nginx.ingress.kubernetes.io/backend-protocol: "HTTPS"
spec:
  rules:
  - http:
      paths:
      - path: /ibm/console
        backend:
          serviceName: websphere
          servicePort: 9043

这篇关于在入口后面配置Websphere Application Server时出现问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆