What is Spring Boot with Kubernetes?
Why Interviewers Ask This
Interviewers ask this to evaluate whether you have the depth of knowledge needed to mentor others and lead technical decisions. The expected answer goes beyond definitions into practical implications and real-world consequences.
Answer
Deploying Spring Boot applications on Kubernetes: Actuator for Kubernetes probes: management.endpoint.health.probes.enabled=true management.health.livenessState.enabled=true management.health.readinessState.enabled=true. K8s YAML: livenessProbe: httpGet: path: /actuator/health/liveness port: 8080 initialDelaySeconds: 30 periodSeconds: 10 readinessProbe: httpGet: path: /actuator/health/readiness port: 8080 initialDelaySeconds: 20 periodSeconds: 5. Graceful shutdown: server.shutdown=graceful spring.lifecycle.timeout-per-shutdown-phase=30s. K8s terminationGracePeriodSeconds: 60. Resource limits: resources: requests: memory: "512Mi" cpu: "250m" limits: memory: "1Gi" cpu: "500m". ConfigMaps and Secrets: spring.config.import=configtree:/etc/config/ — load from ConfigMap-mounted files: envFrom: - configMapRef: name: app-config - secretRef: name: app-secrets. Horizontal Pod Autoscaler: scale based on CPU: kubectl autoscale deployment myapp --cpu-percent=70 --min=2 --max=10. Spring Boot Actuator's /actuator/metrics exposed to Prometheus enables custom HPA metrics. Spring Cloud Kubernetes: service discovery using Kubernetes API instead of Eureka — auto-discover services by Kubernetes service names. Rolling deployment: strategy: type: RollingUpdate rollingUpdate: maxSurge: 1 maxUnavailable: 0 — zero-downtime deployments. Startup command with profiles: env: - name: SPRING_PROFILES_ACTIVE value: production - name: JAVA_TOOL_OPTIONS value: "-XX:MaxRAMPercentage=75".
Common Mistake
Rushing to answer is a common mistake. Take two seconds to structure your response: definition → example → trade-off. This structure makes complex Spring Boot answers easy to follow.
Previous
What is Spring Boot performance optimization?
Next
What is Spring Boot reactive programming with R2DBC?
More Spring Boot Questions
View all →- Advanced What is Spring Boot auto-configuration internals?
- Advanced What is Spring Security OAuth2 and JWT implementation?
- Advanced What is Spring Boot performance optimization?
- Advanced What is Spring Boot reactive programming with R2DBC?
- Advanced What is Spring Boot GraalVM native image compilation?