<p>I have deployed a gerrit container and exposed the ports but unable to reach the UI.
This is deployed on microk8s on AWS. I'm not using ingress</p>
<p>The Image is an official image from the docker hub.</p>
<p><a href="https://hub.docker.com/r/k8sgerrit/gerrit-master" rel="nofollow noreferrer">https://hub.docker.com/r/k8sgerrit/gerrit-master</a></p>
<p>My code</p>
<pre class="lang-yaml prettyprint-override"><code>apiVersion: apps/v1
kind: Deployment
metadata:
  name: gerrit-deployment
  labels:
    app: gerrit-meta
spec:
  replicas: 1
  selector:
    matchLabels:
      app: gerrit
      type: frontend
  template:
    metadata:
      labels:
        app: gerrit
        type: frontend
    spec:
      containers:
      - name: gerrit
        image: k8sgerrit/gerrit
        ports:
        - containerPort: 80
        - containerPort: 29418

</code></pre>
<p>Services File</p>
<pre class="lang-yaml prettyprint-override"><code>apiVersion: v1
kind: Service
metadata:
  name: gerrit-service

spec:
  type: NodePort
  ports:
    - port: 80
      targetPort: 80
      nodePort: 30010
  selector:
      app: gerrit
      type: frontend

</code></pre>
<pre class="lang-sh prettyprint-override"><code>root@ip-172-31-3-35:~/microk8s/gerrit312# kubectl get deployments
NAME                READY   UP-TO-DATE   AVAILABLE   AGE
gerrit-deployment   1/1     1            1           21m
root@ip-172-31-3-35:~/microk8s/gerrit312# kubectl get services
NAME             TYPE        CLUSTER-IP       EXTERNAL-IP   PORT(S)        AGE
gerrit-service   NodePort    10.152.183.210   &lt;none&gt;        80:30010/TCP   6m6s
kubernetes       ClusterIP   10.152.183.1     &lt;none&gt;        443/TCP        34
</code></pre>
<pre class="lang-yaml prettyprint-override"><code>root@ip-172-31-3-35:~/microk8s/gerrit312# kubectl describe deployment gerrit-deployment
Name:                   gerrit-deployment
Namespace:              default
CreationTimestamp:      Thu, 23 Jul 2020 20:37:47 +0000
Labels:                 app=gerrit-meta
Annotations:            deployment.kubernetes.io/revision: 1
Selector:               app=gerrit,type=frontend
Replicas:               1 desired | 1 updated | 1 total | 1 available | 0 unavailable
StrategyType:           RollingUpdate
MinReadySeconds:        0
RollingUpdateStrategy:  25% max unavailable, 25% max surge
Pod Template:
  Labels:  app=gerrit
           type=frontend
  Containers:
   gerrit:
    Image:        k8sgerrit/gerrit
    Ports:        80/TCP, 29418/TCP
    Host Ports:   0/TCP, 0/TCP
    Environment:  &lt;none&gt;
    Mounts:       &lt;none&gt;
  Volumes:        &lt;none&gt;
Conditions:
  Type           Status  Reason
  ----           ------  ------
  Progressing    True    NewReplicaSetAvailable
  Available      True    MinimumReplicasAvailable
OldReplicaSets:  &lt;none&gt;
NewReplicaSet:   gerrit-deployment-854ccc4d97 (1/1 replicas created)
Events:
  Type    Reason             Age   From                   Message
  ----    ------             ----  ----                   -------
  Normal  ScalingReplicaSet  21m   deployment-controller  Scaled up replica set gerrit-deployment-854ccc4d97 to 1
root@ip-172-31-3-35:~/microk8s/gerrit312#
root@ip-172-31-3-35:~/microk8s/gerrit312# kubectl describe services gerrit-service
Name:                     gerrit-service
Namespace:                default
Labels:                   &lt;none&gt;
Annotations:              &lt;none&gt;
Selector:                 app=gerrit,type=frontend
Type:                     NodePort
IP:                       10.152.183.210
Port:                     &lt;unset&gt;  80/TCP
TargetPort:               80/TCP
NodePort:                 &lt;unset&gt;  30010/TCP
Endpoints:                10.1.88.88:80
Session Affinity:         None
External Traffic Policy:  Cluster
Events:                   &lt;none&gt;
</code></pre>
<p>Any help to understand why the UI is not accessible is greatly appreciated.</p>
<p>Thank you,
Anish</p>

anish anil
<p>Managed to fix it. It was a problem with the port and the nodes were cordoned since it was running short of space</p>
