<p>I have created the pod, namespace and service with below yaml file but I am not able to access the application running in that pod.</p>
<pre><code>---
apiVersion: v1
kind: Namespace
metadata:
  name: applicare1
  labels:
    name: applicare1
---
apiVersion: v1
data:
  app.properties: |
    applicare.dbVendor=MySql
    applicare.autoPersist=true
    applicare.useSNMP=0
    applicare.stuckthread.max=600
    applicare.updateUrl=http\://support.arcturustech.com
    applicare.systemUser=JFUuyKJT1Ls\=
    applicare.smtp_auth_pwd=Ni2Bih3nCUU\=
    applicare.useRSTATD=1
    applicare.blackboxSaveType=all
    applicare.invokeRSTATD=1
    applicare.enableChartScrollbar=true
    heapTracker.interval=240
    applicare.serverPort=8880
    applicare.dbDriverClass=com.mysql.jdbc.Driver
    applicare.SMTPSSL=false 
    applicare.adminName=AdminServer
    applicare.dbPassword=Applicare01$1
    applicare.alertDuration=3
    applicare.dbUsername=applicare01
    applicare.smtp_host=localhost
    applicare.dburl=jdbc\:mysql\://192.168.1.209\:3306/applicarenew?allowPublicKeyRetrieval\=true&amp;useSSL\=false
    applicare.smtp_auth_user=test
    applicare.custAlertClass=
    applicare.serverIP=192.168.1.209
    applicare.agentJobInterval=1
    applicare.dbTestSQL=SELECT 1
     applicare.smtp_from=
    applicare.enable_readonly_mode=false
    applicare.sendMailTo=test@localhost.com
    applicare.alertMonitorJobInterval=1
    applicare.alertOn=1
    applicare.intellitrace.auto_refresh=60000
    applicare.SMTPPort=25
    applicare.enable_server_time=false
    applicare.systemPassword=JFUuyKJT1Ls\=
    applicare.serverName=
    applicare.httpErrorCode=400
    applicare.monitorOn=1
    applicare.ipLocUpdate.jobInterval=60
    applicare.alertClearanceNotificationDuration=3
    applicare.logDir=/usr/local/Applicare/logs
    applicare.dataSource=Applicare-DataSource
    applicare.minTimeBetweenAlerts=5
kind: ConfigMap
metadata:
  name: applicare-config
  namespace: applicare1

---
apiVersion: apps/v1
kind: Deployment
metadata:
  namespace: applicare1
  labels:
    run: applicare1
  name: applicare1
spec:
  replicas: 3
  selector:
    matchLabels:
      run: applicare1
  template:
    metadata:
      annotations:
      labels:
        run: applicare1
    spec:
      containers:
      - image: applicare:latest
        imagePullPolicy: Never
        name: applicare1
        resources:
          requests:
            memory: &quot;2000Mi&quot;
            cpu: &quot;200m&quot;
          limits:
            memory: &quot;5000Mi&quot;
            cpu: &quot;2000m&quot;
        volumeMounts:
        - name: app-config
          mountPath: /usr/local/Applicare/Applicare.props
          subPath: app.properties
        livenessProbe:
          httpGet:
            path: /applicare/login/console.jsp
            port: 8880
          failureThreshold: 5
          periodSeconds: 60
         #  terminationGracePeriodSeconds: 200
          initialDelaySeconds: 180
        startupProbe:
          httpGet:
            path: /applicare/login/console.jsp
            port: 8880
          failureThreshold: 3
          periodSeconds: 90
      volumes:
      - name: app-config
        configMap:
          name: applicare-config



---
apiVersion: v1
kind: Service
metadata:
  namespace: applicare1
  name: applicare-service
spec:
  selector:
    run: applicare1
  ports:
    - port: 8811
      targetPort: 8880
      name: port

---

apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
  name: applicare1
  namespace: applicare1
spec:
  maxReplicas: 3
  minReplicas: 1
  scaleTargetRef:
    apiVersion: apps/v1
    kind: Deployment
    name: applicare1
  metrics:
  - type: Resource
    resource:
      name: cpu
      target:
        type: Utilization
        averageUtilization: 80
  - type: Resource
    resource:
      name: memory
      target:
        type: Utilization
        averageUtilization: 97

---
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
  name: applicare-pdb
  namespace: applicare1
spec:
  minAvailable: 1
  selector:
    matchLabels:
      run: applicare1
</code></pre>
<p>3 I create a service for the application running in pod and expose that service to 8811 port, but I am not able to access it in browser, I can see the log of that pod, I am able to go inside the pod. After execute service describe commmand i got below message.</p>
<pre><code>kubectl describe service -n applicare1

Name:              applicare-service
Namespace:         applicare1
Labels:            &lt;none&gt;
Annotations:       &lt;none&gt;
Selector:          run=applicare1
Type:              ClusterIP
IP Family Policy:  SingleStack
IP Families:       IPv4
IP:                10.109.86.137
IPs:               10.109.86.137
Port:              port  8811/TCP
TargetPort:        8880/TCP
Endpoints:         10.1.0.153:8880,10.1.0.154:8880,10.1.0.155:8880
Session Affinity:  None
Events:            &lt;none&gt;
</code></pre>

anandarc
<p>To access an application inside kubernetes you shoud use:</p>
<ul>
<li>Service type NodePort : <a href="https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport" rel="nofollow noreferrer">https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport</a></li>
<li>Service type Loadbalancer (if you are deploying in the Cloud) <a href="https://kubernetes.io/docs/concepts/services-networking/service/#loadbalancer" rel="nofollow noreferrer">https://kubernetes.io/docs/concepts/services-networking/service/#loadbalancer</a></li>
<li>Or use an Ingress with ingress controller deployed in your cluster: <a href="https://kubernetes.io/docs/concepts/services-networking/ingress/" rel="nofollow noreferrer">https://kubernetes.io/docs/concepts/services-networking/ingress/</a></li>
</ul>
<p>Here you deployed a service of type ClusterIP ( the default type if we didn't specify one) wich is accesible only inside the cluster.</p>
