Mock Kubernetes Manifest Generator
Generates example Kubernetes YAML manifests for learning and testing
Generated 201 words · 2,576 characters
See 3 examples
- Example 1
apiVersion: apps/v1 kind: Deployment metadata: name: ivory-sync labels: app.kubernetes.io/name: ivory-sync app.kubernetes.io/version: "0.9.0" spec: selector: matchLabels: app.kubernetes.io/name: ivory-sync template: metadata: labels: app.kubernetes.io/name: ivory-sync app.kubernetes.io/version: "0.9.0" spec: containers: - name: ivory-sync image: ghcr.io/labs/ivory-sync:0.9.0 ports: - name: http containerPort: 3001 envFrom: - configMapRef: name: ivory-sync-config resources: requests: { cpu: 225m, memory: 768Mi } limits: { cpu: 675m, memory: 1536Mi } readinessProbe: httpGet: path: /readyz port: http periodSeconds: 10 livenessProbe: httpGet: path: /healthz port: http initialDelaySeconds: 10 --- apiVersion: v1 kind: Service metadata: name: ivory-sync labels: app.kubernetes.io/name: ivory-sync app.kubernetes.io/version: "0.9.0" spec: type: ClusterIP selector: app.kubernetes.io/name: ivory-sync ports: - name: http port: 80 targetPort: http --- apiVersion: v1 kind: ConfigMap metadata: name: ivory-sync-config labels: app.kubernetes.io/name: ivory-sync app.kubernetes.io/version: "0.9.0" data: S3_BUCKET: "labs-ivory-backups" WORKER_CONCURRENCY: "21" FEATURE_BULK_EXPORT: "true" LOG_FORMAT: "text" LOG_LEVEL: "warn" --- apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: ivory-sync labels: app.kubernetes.io/name: ivory-sync app.kubernetes.io/version: "0.9.0" spec: ingressClassName: nginx tls: - hosts: [ivory-sync.apps.example.com] secretName: ivory-sync-tls rules: - host: ivory-sync.apps.example.com http: paths: - path: / pathType: Prefix backend: service: name: ivory-sync port: name: http --- apiVersion: autoscaling/v2 kind: HorizontalPodAutoscaler metadata: name: ivory-sync labels: app.kubernetes.io/name: ivory-sync app.kubernetes.io/version: "0.9.0" spec: scaleTargetRef: apiVersion: apps/v1 kind: Deployment name: ivory-sync minReplicas: 2 maxReplicas: 30 metrics: - type: Resource resource: name: cpu target: type: Utilization averageUtilization: 72 - Example 2
apiVersion: apps/v1 kind: Deployment metadata: name: iris-auth labels: app.kubernetes.io/name: iris-auth app.kubernetes.io/version: "3.17.2" spec: selector: matchLabels: app.kubernetes.io/name: iris-auth template: metadata: labels: app.kubernetes.io/name: iris-auth app.kubernetes.io/version: "3.17.2" spec: containers: - name: iris-auth image: 123456789012.dkr.ecr.us-east-1.amazonaws.com/labs/iris-auth:3.17.2 ports: - name: http containerPort: 9090 envFrom: - configMapRef: name: iris-auth-config resources: requests: { cpu: 100m, memory: 128Mi } limits: { cpu: 400m, memory: 512Mi } readinessProbe: httpGet: path: /readyz port: http periodSeconds: 10 livenessProbe: httpGet: path: /healthz port: http initialDelaySeconds: 10 --- apiVersion: v1 kind: Service metadata: name: iris-auth labels: app.kubernetes.io/name: iris-auth app.kubernetes.io/version: "3.17.2" spec: type: ClusterIP selector: app.kubernetes.io/name: iris-auth ports: - name: http port: 80 targetPort: http --- apiVersion: v1 kind: ConfigMap metadata: name: iris-auth-config labels: app.kubernetes.io/name: iris-auth app.kubernetes.io/version: "3.17.2" data: FEATURE_BETA_SEARCH: "false" REQUEST_TIMEOUT_MS: "3000" PAGE_SIZE_DEFAULT: "50" SESSION_TTL_MINUTES: "210" WORKER_CONCURRENCY: "60" --- apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: iris-auth labels: app.kubernetes.io/name: iris-auth app.kubernetes.io/version: "3.17.2" spec: ingressClassName: nginx tls: - hosts: [iris-auth.example.com] secretName: iris-auth-tls rules: - host: iris-auth.example.com http: paths: - path: / pathType: Prefix backend: service: name: iris-auth port: name: http --- apiVersion: autoscaling/v2 kind: HorizontalPodAutoscaler metadata: name: iris-auth labels: app.kubernetes.io/name: iris-auth app.kubernetes.io/version: "3.17.2" spec: scaleTargetRef: apiVersion: apps/v1 kind: Deployment name: iris-auth minReplicas: 2 maxReplicas: 28 metrics: - type: Resource resource: name: cpu target: type: Utilization averageUtilization: 62 - Example 3
apiVersion: apps/v1 kind: Deployment metadata: name: summit-ingest labels: app.kubernetes.io/name: summit-ingest app.kubernetes.io/version: "1.13.0" spec: selector: matchLabels: app.kubernetes.io/name: summit-ingest template: metadata: labels: app.kubernetes.io/name: summit-ingest app.kubernetes.io/version: "1.13.0" spec: containers: - name: summit-ingest image: docker.io/acme/summit-ingest:1.13.0 ports: - name: http containerPort: 8000 envFrom: - configMapRef: name: summit-ingest-config resources: requests: { cpu: 425m, memory: 768Mi } limits: { cpu: 850m, memory: 3072Mi } readinessProbe: httpGet: path: /readyz port: http periodSeconds: 10 livenessProbe: httpGet: path: /healthz port: http initialDelaySeconds: 10 --- apiVersion: v1 kind: Service metadata: name: summit-ingest labels: app.kubernetes.io/name: summit-ingest app.kubernetes.io/version: "1.13.0" spec: type: ClusterIP selector: app.kubernetes.io/name: summit-ingest ports: - name: http port: 80 targetPort: http --- apiVersion: v1 kind: ConfigMap metadata: name: summit-ingest-config labels: app.kubernetes.io/name: summit-ingest app.kubernetes.io/version: "1.13.0" data: S3_BUCKET: "acme-summit-uploads" WORKER_CONCURRENCY: "47" REDIS_URL: "redis://redis:6379/10" LOG_FORMAT: "text" LOG_LEVEL: "debug" --- apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: summit-ingest labels: app.kubernetes.io/name: summit-ingest app.kubernetes.io/version: "1.13.0" spec: ingressClassName: nginx tls: - hosts: [summit-ingest.example.net] secretName: summit-ingest-tls rules: - host: summit-ingest.example.net http: paths: - path: / pathType: Prefix backend: service: name: summit-ingest port: name: http --- apiVersion: autoscaling/v2 kind: HorizontalPodAutoscaler metadata: name: summit-ingest labels: app.kubernetes.io/name: summit-ingest app.kubernetes.io/version: "1.13.0" spec: scaleTargetRef: apiVersion: apps/v1 kind: Deployment name: summit-ingest minReplicas: 2 maxReplicas: 14 metrics: - type: Resource resource: name: cpu target: type: Utilization averageUtilization: 68
About this generator
Writing Kubernetes manifests from memory is slow and error-prone — the YAML nesting is deep, the selector must match the template labels exactly, and a single indentation mistake breaks the parse. This tool generates realistic, valid example YAML in seconds, built around a generated app name (such as ledger-api or harbor-worker), a versioned registry image, standard app.kubernetes.io labels, and ports, resources and config values that hang together. There are no inputs — click Generate for a new sample. About two clicks in three produce a full web-app bundle: a Deployment (selector, pod template, named http port, resource requests and limits, readiness and liveness probes), a ClusterIP Service, a ConfigMap loaded with envFrom, an Ingress with a TLS host, and a HorizontalPodAutoscaler. The other clicks produce one of eight focused sets: a StatefulSet with a headless Service and volumeClaimTemplates; a CronJob; a Job with the PersistentVolumeClaim it mounts; a DaemonSet with tolerations and a hostPath volume; a Secret; a ServiceAccount with a Role and RoleBinding; a NetworkPolicy; or a Namespace with a ResourceQuota. Multi-document results are separated by --- so the whole file applies in one go. Use the output to study how the pieces reference each other, test a manifest parser or linter, or scaffold a new workload. Before applying anything to a real cluster, replace the names, image, hosts, secret values and resource numbers with your own, and keep real credentials in a secret manager rather than in a file.
How to use
- Click Generate to produce a manifest.
- Copy the YAML into a file or doc.
- Adapt the names and image to your app.
- Apply only after tailoring it.
Use Cases
- •Learning Kubernetes manifests
- •Documenting a deployment
- •Demoing manifest structure
- •Seeding example YAML
- •Testing a manifest parser
Tips
- →Mind YAML's significant indentation.
- →The selector must match template labels.
- →Adapt the image and ports to your app.
- →Use it to learn the structure.
FAQ
what does the generated manifest include
Most results are an app bundle: Deployment, ClusterIP Service, ConfigMap, Ingress and HorizontalPodAutoscaler, all referencing the same app name. The rest are focused examples of other kinds: StatefulSet plus headless Service, CronJob, Job plus PersistentVolumeClaim, DaemonSet, Secret, ServiceAccount plus Role and RoleBinding, NetworkPolicy, or Namespace plus ResourceQuota.
is the generated YAML valid and ready to apply
The YAML structure and indentation are valid, selectors match template labels, and related objects reference each other by name (the Service, Ingress and autoscaler point at the Deployment; the RoleBinding binds the ServiceAccount to the Role; the Job mounts its claim). Images, hosts, secret values and config are placeholders, so replace them and review resource limits before running kubectl apply on a real cluster.
why must the selector match the template labels
Kubernetes uses the selector to identify which pods belong to the Deployment. If the matchLabels in the selector do not match the labels on the pod template, the Deployment controller cannot find its pods, and the resource will not work. The generated manifest gets this right, so it illustrates the correct relationship.
what resource types can this generator produce
Seventeen kinds in total: Deployment, Service, ConfigMap, Ingress, HorizontalPodAutoscaler, StatefulSet, CronJob, Job, PersistentVolumeClaim, DaemonSet, Secret, ServiceAccount, Role, RoleBinding, NetworkPolicy, Namespace and ResourceQuota. There is no way to choose a kind; click Generate again until the one you need comes up (each focused set appears on roughly one click in twenty-two, the app bundle on about two in three).
You might also like
Popular tools from other categories that share themes with this one.