Thursday 30 June 2022

Creating and Configuring the Deployment in Kubernetes using OpenShift


Creating the Deployment


kubectl create deployment myapp1 --image=docker.io/openshift/hello-openshift 

deployment.apps/myapp1 created


kubectl get deployment

NAME     READY   UP-TO-DATE   AVAILABLE   AGE

myapp1   1/1     1            1           14s


kubectl get po

NAME                     READY   STATUS    RESTARTS       AGE

myapp1-bcb89d7dd-hvxgk   1/1     Running   0              101s


Accessing the Pod


kubectl expose deployment myapp1 --port=8080

service/myapp1 exposed


kubectl get svc

NAME              TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)        AGE

kubernetes        ClusterIP   10.96.0.1       <none>        443/TCP        5d6h

myapp1            ClusterIP   10.111.40.120   <none>        8080/TCP       33s


curl 10.111.40.120:8080

Hello OpenShift!


No comments:

Post a Comment