DevOps Classroom notes 20/Oct/2024

Running applications in Pods

spring petclinic

  • This application is developed in java using spring boot
  • this application runs on port 8080
  • image: shaikkhajaibrahim/spcjan2024:1.0
  • port: 8080
  • docker command
docker run --name spc -d -P shaikkhajaibrahim/spcjan2024:1.0

Preview
* Refer Here for pod specification with port info added
Preview
* Note: Exposing Pod directly to external world is not a recommended practice, we are using the following only for evaluation
* Generally while creating containers it is a good idea to define the cpu and memory limits Refer Here for article

docker run --name spc -d -P --memory "512m" --cpus="0.5" shaikkhajaibrahim/spcjan2024:1.0
  • Kubernetes also has limits and requests to support allocating upper and lower bound for memory, cpu and other restrictions Refer Here
  • Refer Here for the changes done in the specification to include
    • lower limits for cpu and memory
    • upper limits for cpu and memory
  • Label selector Refer Here
  • Lets create multiple pods i.e. lets use replicaset Refer Here for changes done
    Preview
    Preview

Service

  • Service is a k8s object which creates a virtual ip address and a DNS Name which is fixed.
  • To make this service accessible kube-proxy and CORE DNS will do the job of forwarding/making service accessible
  • in every container we have a file /etc/resolve.conf
  • Services are of different types
    • Cluster Ip (ip address within k8s cluster)
    • Node Port (Expose service on some port on all nodes of k8s cluster)
    • Load Balancer (Used in Managed k8s clusters)
    • ExternalName (It gives a DNS Record)
  • when we create a service, it creates endpoints, Each endpoint represents a podip with port
  • Refer Here for service
  • Refer Here for the changes done
    Preview
  • Overview
    Preview

Published
Categorized as Uncategorized Tagged

By continuous learner

devops & cloud enthusiastic learner

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Please turn AdBlock off
Plugin for Social Media by Acurax Wordpress Design Studio

Discover more from Direct DevOps from Quality Thought

Subscribe now to keep reading and get access to the full archive.

Continue reading

Visit Us On FacebookVisit Us On LinkedinVisit Us On Youtube