What is Spring Boot with Kubernetes?

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".