User Tools

Site Tools


devops:docker:kubernetes:tutorial-springboot

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
devops:docker:kubernetes:tutorial-springboot [2024/03/05 21:45] skipidardevops:docker:kubernetes:tutorial-springboot [2024/03/05 21:51] (current) skipidar
Line 183: Line 183:
  
  
 +
 +
 +Now finally you can run a container with image 'image: springguides/demo'
 +
 +<sxh>
 +skip@desktop:/mnt/d/1PROJEKTE/Kubernete-tutorials-springboot$ kubectl apply -f deployment.yaml
 +deployment.apps/demo created
 +service/demo created
 +skip@desktop:/mnt/d/1PROJEKTE/Kubernete-tutorials-springboot$ kubectl get all
 +NAME                        READY   STATUS    RESTARTS   AGE
 +pod/demo-6f64658b59-swj5z   1/    Running            3s
 +
 +NAME                 TYPE        CLUSTER-IP   EXTERNAL-IP   PORT(S)    AGE
 +service/demo         ClusterIP   10.97.44.9   <none>        8080/TCP   3s
 +service/kubernetes   ClusterIP   10.96.0.1    <none>        443/TCP    26h
 +
 +NAME                   READY   UP-TO-DATE   AVAILABLE   AGE
 +deployment.apps/demo   1/               1           3s
 +
 +NAME                              DESIRED   CURRENT   READY   AGE
 +replicaset.apps/demo-6f64658b59                         3s
 +
 +</sxh>
 +
 +
 +Forwarding port 
 +
 +<sxh>
 +kubectl port-forward svc/demo 8080:8080
 +</sxh>
 +
 +
 +
 +kubectl: This is the command-line tool used to interact with a Kubernetes cluster.
 +
 +port-forward: This is a subcommand of kubectl specifically designed for forwarding ports from Pods or Services within the cluster to your local machine.
 +
 +svc/demo: This specifies the target resource for port forwarding. It indicates a Service named demo in the current namespace.
 +
 +8080:8080: This defines the port mapping. The first 8080 represents the local port on your machine that will be used to access the forwarded service. The second 8080 indicates the port on the target service within the cluster.
 +
 +
 +
 +You can now reach the service on 8080
 +<sxh>
 +curl localhost:8080/actuator/health
 +</sxh>
  
devops/docker/kubernetes/tutorial-springboot.1709675150.txt.gz · Last modified: by skipidar