Video Thumbnail for Lesson
4.16: Out of Scope

Out of Scope (Built in Resources)

Kubernetes includes many more built‑in resources than we covered in this section. Below are a few that are useful to know about, even though we won't dive into them in the course.

LimitRange

A LimitRange sets default resource requests and limits for Pods and Containers within a namespace, preventing a single workload from consuming the entire cluster.

apiVersion: v1
kind: LimitRange
metadata:
  name: default-limits
spec:
  limits:
    - default:
        cpu: 500m
        memory: 256Mi
      defaultRequest:
        cpu: 100m
        memory: 128Mi
      type: Container

Official docs: https://kubernetes.io/docs/concepts/policy/limit-range/

NetworkPolicy

A NetworkPolicy controls which Pods are allowed to communicate with each other. By default all traffic is allowed, but policies let you restrict ingress and egress connections.

apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
  name: allow-frontend
spec:
  podSelector:
    matchLabels:
      role: frontend
  policyTypes:
    - Ingress
    - Egress
  ingress:
    - from:
        - podSelector:
            matchLabels:
              role: backend

Official docs: https://kubernetes.io/docs/concepts/services-networking/network-policies/

Admission Webhooks

ValidatingWebhookConfiguration and MutatingWebhookConfiguration are admission controllers that run before objects are persisted. They can enforce standards (validate) or modify resources (mutate) automatically, such as injecting sidecars into a Pod spec.

Official docs: https://kubernetes.io/docs/reference/access-authn-authz/extensible-admission-controllers/

HorizontalPodAutoscaler

The Horizontal Pod Autoscaler (HPA) adjusts the number of Pod replicas based on metrics like CPU or custom metrics.

apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
  name: myapp-hpa
spec:
  scaleTargetRef:
    apiVersion: apps/v1
    kind: Deployment
    name: myapp
  minReplicas: 1
  maxReplicas: 5
  metrics:
    - type: Resource
      resource:
        name: cpu
        target:
          type: Utilization
          averageUtilization: 60

Official docs: https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/

Custom Resource Definitions (CRDs)

Custom Resource Definitions extend the Kubernetes API with your own resource types, enabling tools like cert-manager or the Prometheus Operator.

Official docs: https://kubernetes.io/docs/tasks/extend-kubernetes/custom-resources/custom-resource-definitions/


While these resources are outside the scope of this beginner course, exploring them will help you tackle more advanced Kubernetes scenarios.