<p>I have a docker image from I am doing </p>

<pre><code>docker run --name test -h test -p 9043:9043 -p 9443:9443 -d ibmcom/websphere-traditional:install
</code></pre>

<p>I am trying to put into a kubernetes deploy file and I have this: </p>

<pre><code>apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: websphere
spec:
  replicas: 1
  template:
    metadata:
      labels:
        app: websphere
    spec:
      containers:
      - name: websphere
        image: ibmcom/websphere-traditional:install
        ports:
        - containerPort: 9443
        resources:
          requests: 
            memory: 500Mi
            cpu: 0.5
          limits:
            memory: 500Mi
            cpu: 0.5
        imagePullPolicy: Always
</code></pre>

<p>my service.yaml</p>

<pre><code>apiVersion: v1
kind: Service
metadata:
  name: websphere
  labels:
    app: websphere
spec:
  type: NodePort #Exposes the service as a node ports
  ports:
  - port: 9443
    protocol: TCP
    targetPort: 9443
  selector:
    app: websphere
</code></pre>

<p>May I have guidance on how to map 2 ports in my deployment file?</p>

<p>You can add as many ports as you need.</p>

<p>Here your <code>deployment.yml</code>:</p>

<pre><code>apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: websphere
spec:
  replicas: 1
  template:
    metadata:
      labels:
        app: websphere
    spec:
      containers:
      - name: websphere
        image: ibmcom/websphere-traditional:install
        ports:
        - containerPort: 9043
        - containerPort: 9443
        resources:
          requests: 
            memory: 500Mi
            cpu: 0.5
          limits:
            memory: 500Mi
            cpu: 0.5
        imagePullPolicy: IfNotPresent
</code></pre>

<p>Here your <code>service.yml</code>:</p>

<pre><code>apiVersion: v1
kind: Service
metadata:
  name: websphere
  labels:
    app: websphere
spec:
  type: NodePort #Exposes the service as a node ports
  ports:
  - port: 9043
    name: hello
    protocol: TCP
    targetPort: 9043
    nodePort: 30043
  - port: 9443
    name: privet
    protocol: TCP
    targetPort: 9443
    nodePort: 30443
  selector:
    app: websphere
</code></pre>

<p>Check on your kubernetes <code>api-server</code> configuration what is the range for nodePorts (usually <code>30000-32767</code>, but it's configurable).</p>

<p><strong>EDIT</strong></p>

<p>If I remove from deployment.yml the <code>resources</code> section, it starts correctly (after about 5 mins).
Here a snippet of the logs:</p>

<blockquote>
  <p>[9/10/18 8:08:06:004 UTC] 00000051 webcontainer  I
  com.ibm.ws.webcontainer.VirtualHostImpl addWebApplication SRVE0250I:
  Web Module Default Web Application has been bound to
  default_host[<em>:9080,</em>:80,<em>:9443,</em>:506 0,<em>:5061,</em>:443].</p>
</blockquote>

<p>Problems come connecting to it (I use ingress with traefik), because of certificates (I suppose):</p>

<blockquote>
  <p>[9/10/18 10:15:08:413 UTC] 000000a4 SSLHandshakeE E   SSLC0008E:
  Unable to initialize SSL connection.  Unauthorized access was denied
  or security settings have expired.  Exception is
  javax.net.ssl.SSLException: Unrecognized SSL message, plaintext
  connection?</p>
</blockquote>

<p>To solve that (I didn't go further) this may help: <a href="https://stackoverflow.com/questions/37025096/sslhandshakee-e-sslc0008e-unable-to-initialize-ssl-connection-unauthorized-acc">SSLHandshakeE E SSLC0008E: Unable to initialize SSL connection. Unauthorized access was denied or security settings have expired</a></p>

<p>Trying to connect with <code>port-forward</code>:</p>

<p><a href="https://i.stack.imgur.com/8G1K2.png" rel="noreferrer"><img src="https://i.stack.imgur.com/8G1K2.png" alt="enter image description here"></a></p>

<p>and using dthe browser to connect, I land on this page:</p>

<p><a href="https://i.stack.imgur.com/qYGXW.png" rel="noreferrer"><img src="https://i.stack.imgur.com/qYGXW.png" alt="enter image description here"></a></p>
