AI generated prompt for Kubernetes Deployment Manifest
**Context**:
Kubernetes is an open-source container orchestration system for automating the deployment, scaling, and management of containerized applications. A deployment manifest is a YAML or JSON file that defines the desired state of a Kubernetes deployment, including the container images, ports, environment variables, and other settings. The goal is to create a comprehensive deployment manifest that ensures reliable, scalable, and maintainable deployment of a containerized application.
**Detailed Instructions**:
Create a Kubernetes deployment manifest for a web application that consists of a frontend and a backend service. The frontend is built using Node.js and exposed on port 3000, while the backend is built using Python and exposed on port 5000. The application requires a PostgreSQL database for data storage. The manifest should include the following specifications:
- Use the latest available version of the Node.js and Python images from Docker Hub.
- Set environment variables for the database connection, including `DB_HOST`, `DB_PORT`, `DB_USERNAME`, and `DB_PASSWORD`.
- Configure the deployment to use a Persistent Volume Claim (PVC) for data persistence.
- Define a service for the frontend and backend, with the correct port mappings and target ports.
- Implement liveness and readiness probes to ensure the application is healthy and responsive.
- Specify resource requests and limits for the containers to ensure efficient resource utilization.
- Use a ConfigMap to store configuration data for the application.
**Output Format**:
The output should be a valid YAML file that can be applied to a Kubernetes cluster using the `kubectl apply` command. The manifest should include the following sections:
- `apiVersion` and `kind` to specify the Kubernetes API version and the type of resource being defined.
- `metadata` to provide metadata about the deployment, such as the name and namespace.
- `spec` to define the specification of the deployment, including the containers, services, and other settings.
**Examples**:
For reference, the following is an example of a simple deployment manifest:
```yml
apiVersion: apps/v1
kind: Deployment
metadata:
name: example-deployment
spec:
replicas: 3
selector:
matchLabels:
app: example
template:
metadata:
labels:
app: example
spec:
containers:
- name: example-container
image: example/image
ports:
- containerPort: 80
```
However, the output should be a more comprehensive manifest that includes all the specifications outlined in the detailed instructions.This coding prompt is designed to help you get better results from AI assistants like ChatGPT, Claude, and Gemini. Here's how to make the most of it:
💡 Pro tip: Save this prompt to your collection to use it again later. Well-crafted prompts can save hours of back-and-forth with AI.
Adjust the prompt to match your specific industry, audience, or use case. Adding relevant context improves output quality.
Specify your desired output length (e.g., "in 200 words" or "in 3 bullet points") to get more targeted responses.
Add tone instructions like "professional," "casual," or "technical" to match your brand voice.
Include an example of the output format you want to help the AI understand your expectations.
This prompt has been tested and optimized for all major AI models. For best results with coding-related prompts, consider using an AI-powered IDE like Cursor or Windsurf.
Learn more about using prompts effectively with our comprehensive guides:
0 people found this prompt helpful
Based on 0 reviews
Be the first to share your experience with this prompt!
This prompt was reviewed and verified to work with current AI models.
Tested with ChatGPT, Claude & Gemini. Reviewed by community users.
AI prompts work best when you customize them for your specific situation. Follow these steps to get the most out of Kubernetes Deployment Manifest.