Skip to main content
InterviewHubPRO
Section Overview
Q4

Question 4 of 50

Part 1: Basic & Foundational Concepts (Junior / Entry-Level)

8%
Kubernetes (K8s) (50 Qs)•Part 1: Basic & Foundational Concepts (Junior / Entry-Level)

Imperative (`kubectl create/run`) vs. Declarative (`kubectl apply -f`) Management.

junior LevelMost AskedCode ExamplekubernetesBasic

In Simple Words:

  • Imperative Management: You tell Kubernetes what actions to perform step-by-step:
    bash
    kubectl run nginx --image=nginx --port=80
    kubectl scale deployment web --replicas=5
    
    Hard to track in Git, prone to configuration drift, and not reproducible.
  • Declarative Management (The Kubernetes Way / GitOps): You write YAML files describing the desired end state and let the Kubernetes reconciliation loop figure out how to achieve it:
    bash
    kubectl apply -f deployment.yaml
    
    Kubernetes compares the desired state in the file with the live state in etcd and applies the minimum required delta.