Configuring ports to connect Client Masters

Occasionally administrators need to connect existing masters to a CloudBees Core cluster. Existing masters connected to a CloudBees Core cluster are called "Client Masters" to distinguish them from Managed Masters. A master running on Windows is one example that requires a Client Master.

Before you can add a Client Master, you must configure the ports that enable the connection.

The instructions for configuring ports vary depending on whether or not Helm was used to install NGINX Ingress Controller.

Select the appropriate configuration option:

Using the values.yaml file to configure ports for Client Master connection

Use this procedure only if Helm was used to install NGINX Ingress Controller. If Helm was not used to install NGINX Ingress Controller, you should manually configure the ports.

To use the values.yaml file to configure ports:

  1. Confirm Operations Center is ready to answer internal JNLP requests:

    $ kubectl exec -ti cjoc-0 -- curl localhost:50000
    Jenkins-Agent-Protocols: Diagnostic-Ping, JNLP4-connect, OperationsCenter2, Ping
    Jenkins-Version: 2.176.1.4
    Jenkins-Session: 3fa70d75
    Client: 0:0:0:0:0:0:0:1
    Server: 0:0:0:0:0:0:0:1
    Remoting-Minimum-Version: 3.4
  2. Copy and paste the following to the values.yaml file that was used when creating the NGINX Ingress Controller (replace cloudbees-core with the namespace where CloudBees Core was installed):

    tcp:
      50000: "cloudbees-core/cjoc:50000"
  3. Apply the configuration:

    helm upgrade nginx-ingress stable/nginx-ingress \
                --namespace ingress-nginx \
                --values values.yaml

Configuring ports manually for Client Master connection

Use this procedure if Helm was not used to install NGINX Ingress Controller. If Helm was used to install NGINX Ingress Controller, you should use the values.yaml file.

To configure ports manually for Client Master connection:

  1. Confirm Operations Center is ready to answer internal JNLP requests:

    $ kubectl exec -ti cjoc-0 -- curl localhost:50000
    Jenkins-Agent-Protocols: Diagnostic-Ping, JNLP4-connect, OperationsCenter2, Ping
    Jenkins-Version: 2.176.1.4
    Jenkins-Session: 3fa70d75
    Client: 0:0:0:0:0:0:0:1
    Server: 0:0:0:0:0:0:0:1
    Remoting-Minimum-Version: 3.4
  2. Open the JNLP port (50000) in the Kubernetes cluster.

  3. Copy and paste the following to a new file, replace cloudbees-core with your namespace, and save it as tcp-services.yaml.

    apiVersion: v1
    kind: ConfigMap
    metadata:
      name: tcp-services
      namespace: ingress-nginx
    data:
      50000: "cloudbees-core/cjoc:50000"
  4. Copy and paste the following to a new file and save it as deployment-patch.yaml.

    spec:
      template:
        spec:
          containers:
            - name: nginx-ingress-controller
              ports:
              - containerPort: 50000
                name: 50000-tcp
                protocol: TCP
  5. Copy and paste the following to a new file and save it as service-patch.yaml.

    spec:
      ports:
      - name: 50000-tcp
        port: 50000
        protocol: TCP
        targetPort: 50000-tcp
  6. Apply these fragments using the following commands:

    kubectl apply -f tcp-services.yaml
    kubectl patch deployment nginx-ingress-controller -n ingress-nginx -p "$(cat deployment-patch.yaml)"
    kubectl patch service ingress-nginx -n ingress-nginx -p "$(cat service-patch.yaml)"

Testing the connection to Client Masters

After you have configured ports, you can confirm that Operations Center is ready to receive external JNLP requests.

To test the connection to Client Masters:

  1. Type the following command:

$ curl $DOMAIN_NAME:50000
Jenkins-Agent-Protocols: Diagnostic-Ping, JNLP4-connect, MultiMaster, OperationsCenter2, Ping
Jenkins-Version: 2.176.1.4
Jenkins-Session: b02dc475
Client: 10.20.4.12
Server: 10.20.5.10
Remoting-Minimum-Version: 2.60

After you have confirmed that ports and security are correctly configured in your cloud and on your Client Master, you can add Client Masters.