DevOps Classroom Series – 16/Nov/2020

Labels

  • Basic workflow of creating replicas Preview

  • As k8s is used and application microservices run in the cluster, number of pods running of nodes might grow in size and complexity. Preview

  • K8s has added foundational concepts of Labels and annotations to organization, mark and cross-index all of your resources to represent the groups.

  • Labels are key/value pairs that can be attached to k8s objects such as pods and ReplicaSets. Labels are used by k8s cluster to group pods/other objects

  • _Annotations provide storage mechanism similar to labels which information that can be used by tools & libraries

  • Labels provide identifying metadata

  • Refer Here for the changeset created with labels Preview Preview

  • Lets create one more replicaset with jenkins running in it Refer Here Preview

  • Pods can be selected by writing selectors Preview

  • Some selector examples

---
selector:
  matchLabels:
    app: jenkins
---
selector:
  matchExpressions:
    - {key: app, operator: In, values: ['jenkins', 'gol']}
---
selector:
  matchExpressions:
    - {key: ver, operator: NotIn, values: ['1.0', '2.0']}
  • If you want to all the api-resources in k8s cluster
kubectl api-resources

Preview

Service Discovery

  • We are able to run our applications in pods
  • We can dynamically scale pods by using autoscale command
  • How do i access my application which is running in pods
  • Service-discovery helps solving the problem of finding which processses are listening at which address for each service.
  • We need to expose our services to the external world. As of now w.r.t networking we know each pod is having its own ip address.
  • Excercise: Ensure you go through
    • Single host docker networking
    • Multi host docker networking.
    • Ensure you have atleast AWS/Azure free account created.

Leave a Reply

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

About learningthoughtsadmin