DevOps Classroom notes 28/Jan/2024

K8s contd

Exercise- Replicaset

  • create a replicaset with pod spec running alpine container without any args
    Preview
  • I want to create a replicaset with nginx and want to access them from browser

Service

Trail 1:

  • Create a service to forward the request to 80 port of nginx pods with label app:nginx
  • Refer Here for the manifest
    Preview
  • Access the svc as discussed in the class

Trail 2:

  • Create a replica set with 3 httpd pods
  • create a service with some matching labels
  • Refer Here for the changes and apply manifests
    Preview
  • When we create a service, service creates endpoint which all the ip-addresses of matching pods
    Preview
  • If we want to access the svc from outside or use node-network we have two options
    • temporary: kubectl port-forward
    • continued access: for this we need to understand service types in k8s

Service Types

  • k8s service is of 4 types Refer Here
    • cluster ip:
      • this gives private access with in k8s cluster
    • nodeport:
      • k8s service can be exposed on a specific port (30000-32767) on all nodes of k8s cluster
    • load balancer: This is used generally by managed k8s clusters (EKS, AKS), This creates a cloud load balancer
    • externalName:

Trail 2 Continued:

  • Modify the service to expose the apache service on port 30000
  • Refer Here for the changes
    Preview
    Preview

Trail3

  • Create a replica set with spring petclinic image shaikkhajaibrahim/spcjan2024:1.0
    • This runs on 8080 port
    • Now create 3 replicas of this
    • label suggestions:
      • app: spc
      • env: dev
      • version: v3.4.0
  • Create a service of type cluster ip
  • expose this to the outside world on port 31000 using node port
  • Refer Here for the manifests
    Preview

Exercises

  • figure out the purpose of /etc/resolve.conf

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