agentsclimarketplace

Deployment patterns

Skill taipt1504/agent-skills/skills/deployment-patterns

Deployment patterns for Java Spring Boot — Docker, Kubernetes, CI/CD, health probes, graceful shutdown. Use when writing Dockerfiles, K8s manifests (Deployment/Service/HPA/ConfigMap), CI/CD pipelines (GitHub Actions, GitLab CI), configuring health probes (liveness/readiness/startup), setting up graceful shutdown, sizing container resources, or containerizing Spring Boot applications.From its SKILL.md

Install
npx -y skills add taipt1504/agent-skills --skill deployment-patterns

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

2 things to look at

  • no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
  • 3 stars3 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

SKILL.md

5.0 KB, as published. Nobody here has run it

Deployment Patterns — Docker, K8s, CI/CD

Quick Decision Matrix

NeedReferenceWhen to read
Dockerfilereferences/dockerfile.mdCreating/reviewing Docker images
K8s manifestsreferences/kubernetes.mdWriting Deployment, Service, HPA, ConfigMap
CI/CD pipelinereferences/cicd.mdSetting up GitHub Actions or GitLab CI
Health probesreferences/health-probes.mdConfiguring liveness/readiness/startup probes
Generate Dockerfilescripts/generate-dockerfile.shScaffold a production Dockerfile

Core Principles

  1. Separate build/runtime — multi-stage builds (JDK build, JRE runtime)
  2. Never root — USER appuser in production images
  3. Container-aware JVM — -XX:+UseContainerSupport -XX:MaxRAMPercentage=75.0
  4. Probe semantics — liveness = internal only, readiness = external deps
  5. Graceful shutdown — terminationGracePeriodSeconds > timeout-per-shutdown-phase
  6. No secrets in images — K8s Secrets, SealedSecrets, or Vault

Dockerfile Essentials

# Build
FROM eclipse-temurin:17-jdk-jammy AS builder
WORKDIR /app
COPY gradle/ gradle/
COPY gradlew build.gradle.kts settings.gradle.kts ./
RUN ./gradlew dependencies --no-daemon || true
COPY src/ src/
RUN ./gradlew bootJar --no-daemon -x test

# Runtime
FROM eclipse-temurin:17-jre-jammy
RUN groupadd -r appuser && useradd -r -g appuser appuser
WORKDIR /app
COPY --from=builder /app/build/libs/*.jar app.jar
USER appuser
ENV JAVA_OPTS="-XX:+UseContainerSupport -XX:MaxRAMPercentage=75.0 -XX:InitialRAMPercentage=50.0"
EXPOSE 8080
ENTRYPOINT ["sh", "-c", "java $JAVA_OPTS -jar app.jar"]

Layered JAR, Maven, JVM flags → references/dockerfile.md.

Health Probes Summary

# application.yml
management:
  endpoint.health:
    probes.enabled: true
    group:
      liveness:
        include: livenessState
      readiness:
        include: readinessState, db, redis
server:
  shutdown: graceful
spring:
  lifecycle:
    timeout-per-shutdown-phase: 30s
ProbeEndpointChecksFailure →
Liveness/actuator/health/livenessApp alivePod restart
Readiness/actuator/health/readinessDB, RedisRemove from Service
Startup/actuator/health/livenessInit doneWait

Custom HealthIndicators, composite readiness, shutdown sequence → references/health-probes.md.

Resource Sizing

TypeMem RequestMem LimitCPU RequestCPU Limit
Lightweight API256Mi512Mi100m500m
Standard API512Mi1Gi250m1000m
Heavy Processing1Gi2Gi500m2000m

Full K8s manifests (Deployment, Service, HPA, ConfigMap, NetworkPolicy) → references/kubernetes.md.

CI/CD Pipeline Quick Reference

Stages: build & test → security scan → Docker build + Trivy scan → deploy staging → deploy production. Full YAML, strategies → references/cicd.md.

Graceful Shutdown Checklist

  1. server.shutdown: graceful
  2. spring.lifecycle.timeout-per-shutdown-phase: 30s
  3. terminationGracePeriodSeconds: 45 (must be > shutdown timeout)
  4. Readiness probe fails first → K8s stops new traffic
  5. In-flight requests drain within timeout
  6. Kafka consumers commit offsets, DB pool drains

Related Skills

  • observability-patterns — Prometheus metrics, structured logging, tracing
  • spring-webflux-patterns — Spring Boot configuration, profiles
  • architecture — Hexagonal structure mapping to Docker layers

Keep looking

Skills are one crate of 626,194. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.