Failed to access perforce server when using ingress(Kubernetes) to route the service

10/4/2017

I am getting "partner is not a Perforce client/server" when using ingress to route the service, but I am able to directly query the perforce server in the Kubernetes cluster.

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: ingress-notls
  namespace: default
  annotations:
    kubernetes.io/ingress.class: "gce"
spec:
  rules:
  - host: perforce.domain.com
    http:
      paths:
      - path: /*
        backend:
          serviceName: p4-server
          servicePort: 80

p4 service

apiVersion: v1
kind: Service
metadata: 
  name: p4-server
spec:
  type: NodePort
  ports:
    - port: 80
      targetPort: 1666
      nodePort: 30166
      name: p4-server

  selector: 
    run: p4-server

if I am in the cluster:

$ p4 -p p4-server:80 info       
User name: root
Client name: platform-3101934619-wtxs5
Client host: platform-3101934619-wtxs5
Client unknown.
Current directory: /
Peer address: 10.4.0.218:49924
Client address: 10.4.0.218
Server address: p4-server-1400441787-fcmd9:1666
Server root: /codelingo
Server date: 2017/10/04 02:19:17 +0000 UTC
Server uptime: 380:53:52
Server version: P4D/LINUX26X86_64/2017.1/1511680 (2017/05/05)
Server license: none
Case Handling: sensitive

p4 logs:

Perforce server info:
    2017/10/04 02:19:17 pid 23038 root@platform-3101934619-wtxs5 10.4.0.218 [p4/2017.1/LINUX26X86_64/1511680] 'user-info'

Failed attempt via ingress:

$ p4 -p perforce.domain.com:80 info 
(hangs)

p4 logs:

Perforce server error:
    Date 2017/10/04 02:18:30:
    Pid 23012
    Connection from 10.4.0.1:38622 broken.
    RpcTransport: partner is not a Perforce client/server.
    RpcTransport: partner is not a Perforce client/server.
    RpcTransport: partner is not a Perforce client/server.
-- Junyu
google-compute-engine
kubernetes
perforce

1 Answer

10/4/2017

Peer address: 10.4.0.218:49924

looks suspiciously like a bi-directional protocol, meaning that client and server expect to have unfettered access to one another, ala (non-passive mode) ftp

http: paths: - path: /*

I don't believe that http: stanza is an accurate statement, as I doubt super, super seriously that Perforce speaks http between the client and the server. There are ongoing discussions around teaching Ingress about TCP, but for the time being I think you've gotten most of the way to where you want to go by already having a NodePort for :1666

Create a GCE tcp load balancer (which effectively is just a firewall to keep the wild Internet away from your cluster) and point its 1666 to port 30166 on every Node in your cluster. It's unclear if anything further needs to happen around Perforce, but from the "establishing tcp/ip connectivity between outsiders and your in-cluster P4" point of view, I think that would do it

-- mdaniel
Source: StackOverflow