P
đź’»DeveloppementAdvancedAll AIs

Prompt to Automate Kubernetes Deployments Like a Pro

This prompt generates a complete, secure Kubernetes configuration, including YAML manifests, autoscaling and DevOps best practices tailored to your application.

Paste in your AI

Adapt this prompt

Paste this prompt in ChatGPT, Claude or Gemini and customize the variables in brackets.

You are a senior DevOps engineer specializing in Kubernetes with 10 years of experience in container orchestration and cloud-native infrastructure. I need to deploy the following application on a Kubernetes cluster:

  • Application name: [application name]
  • Application type: [application type (e.g., Node.js REST API, Python microservice, React frontend, async worker, stateful database)]
  • Target environment: [environment (e.g., production, staging, development)]
  • Cloud provider / infra: [provider (e.g., AWS EKS, GCP GKE, Azure AKS, bare-metal, k3s)]
  • Desired replica count: [replica count]
  • Estimated resources: [resources (e.g., 256Mi RAM / 250m CPU per pod, or 'to be determined')]

Generate a complete Kubernetes deployment configuration including:

  1. Deployment manifest (YAML) with: consistent labels, rolling update strategy, resource requests/limits, liveness and readiness probes, security context (non-root, read-only filesystem if applicable), environment variables via ConfigMap and Secrets
  2. Service suited to the context (ClusterIP, NodePort, or LoadBalancer)
  3. ConfigMap for non-sensitive configuration
  4. HorizontalPodAutoscaler with relevant thresholds
  5. NetworkPolicy with restrictive rules (principle of least privilege)
  6. PodDisruptionBudget to guarantee high availability

For each YAML file generated:

  • Add explanatory comments on the technical choices
  • Follow Kubernetes security best practices (Pod Security Standards restricted)
  • Use standard labels (app.kubernetes.io/*)
  • Suggest reasonable default values that I can adjust

Finish with a 'Deployment commands' section with the kubectl commands in order, a post-deployment verification checklist, and the points of attention specific to the chosen environment.

Personalize this prompt with Léa

Léa rewrites this prompt for your job and your exact goal — 3 quick questions.

Why this prompt works

<p>This prompt transforms AI into an experienced Kubernetes DevOps engineer capable of producing <strong>production-ready</strong> deployment manifests. By providing the application type, target environment and cloud provider, you get a complete configuration following security and high availability best practices.</p><p>The bracketed variables let you adapt the prompt to any scenario: from a simple microservice in staging to a complex production architecture. The prompt covers often-neglected aspects like <strong>NetworkPolicies</strong>, <strong>PodDisruptionBudgets</strong> and <strong>security contexts</strong>, which are essential for a robust deployment.</p><p>For best results, be specific about your tech stack and constraints. You can iterate by then requesting an <strong>Ingress</strong>, <strong>ServiceAccounts</strong> with RBAC, or integration with a service mesh like Istio. This prompt serves as a solid foundation that you will enrich based on your specific needs.</p>

Use Cases

Deploy a new microservice on an existing Kubernetes cluster with security best practicesMigrate a monolithic application to Kubernetes by generating all necessary manifestsPrepare a Kubernetes configuration for a production environment with autoscaling and high availabilityStandardize team deployments by creating reference YAML templates

Expected Output

A complete set of commented Kubernetes YAML files (Deployment, Service, ConfigMap, HPA, NetworkPolicy, PDB), accompanied by ordered kubectl commands for deployment and a post-deployment verification checklist.

Improve this prompt

Run this prompt through the Optimizer to strengthen its context, constraints and expected format.

Improve this prompt with the Optimizer

Comments

  • LĂ©aAI

    Pour une automatisation complète, demandez en plus l’intégration GitOps : un manifest ArgoCD ou Flux pour déployer ces ressources, et une gestion des secrets via ExternalSecrets/SOPS. Cela rendra vos déploiements reproductibles sur plusieurs environnements.

📬 Get new prompts every week

Join our newsletter and never miss a prompt.

Go further

Similar Prompts

đź’»DeveloppementIntermediateAll AIs

GitHub Copilot Prompt for Generating Unit Tests

GitHub Copilot has become an indispensable ally for developers looking to speed up writing unit tests. Thanks to its direct integration into the code editor, it analyzes the context of your source files to suggest relevant tests covering edge cases. However, the quality of generated tests heavily depends on the precision of the prompt used. A vague prompt will produce superficial tests, while a structured prompt will guide Copilot toward exhaustive coverage including nominal cases, expected errors, and boundary behaviors. In this guide, we offer an optimized prompt to generate robust unit tests with GitHub Copilot, regardless of your tech stack. You will learn how to formulate your instructions to obtain tests that follow your project's conventions, use the right test framework, and cover critical scenarios you might forget. Whether you work in JavaScript with Jest, Python with pytest, or Java with JUnit, these prompts adapt to your development environment.

386
đź’»DeveloppementAdvancedAll AIs

Implement pipeline as code testing

Test CI/CD pipelines

459
đź’»DeveloppementIntermediateAll AIs

REST API for ML Model

Exposing a model via an API

367
đź’»DeveloppementBeginnerAll AIs

Write a deployment script

Automate deployment scripts

450