Skip to content

harimau99/k8s-manifest-generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

Kubernetes Manifest Generator Project Overview

Project Description

The Kubernetes Manifest Generator is a cross-platform desktop application built with Electron, designed to simplify the creation of Kubernetes manifests for various resource types. It provides a user-friendly interface for developers, Site Reliability Engineer, and DevOps engineers to input parameters, select desired Kubernetes resources, and generate YAML manifests, enhanced by a string database for validation and optimization. The application is packaged as executable binaries for Windows (EXE), macOS (DMG), and Debian-based Linux (DEB), ensuring broad accessibility.

Release

Coming Soon

Features and Functionality

1. User-Friendly Interface for Input Parameters

  • What It Does: The application features a clean, form-based interface where users can input essential parameters: application name, container image (e.g., nginx:latest), and the number of replicas. The form uses Tailwind CSS for responsive and modern styling, ensuring an intuitive user experience across Windows, macOS, and Linux.
  • Purpose: Allows users to specify the core details needed to define Kubernetes resources, making it easy to customize manifests without manually editing YAML.

2. Checkbox Selection for Kubernetes Resource Types

  • What It Does: Users can select one or more Kubernetes resource types via checkboxes: Deployment, StatefulSet, DaemonSet, Job, ConfigMap, and Secret. The interface ensures at least one resource is selected before generating manifests, preventing invalid submissions.
  • Purpose: Enables flexible manifest generation, allowing users to create multiple resource types in a single operation, tailored to their application’s needs (e.g., a Deployment for stateless apps, a ConfigMap for configuration).

3. Mock AI Database Integration

  • What It Does: Before generating manifests, the app queries a mock AI database (simulating an LLM) to validate inputs and provide optimized configurations. For example:
    • Suggests resource limits/requests (e.g., CPU: 500m, Memory: 512Mi) for workloads like Deployments or Jobs.
    • Generates sample ConfigMap data (e.g., app.conf with app-specific settings).
    • Creates base64-encoded Secret data (e.g., api-key for secure credentials).
    • Adjusts suggestions based on resource type (e.g., lower CPU for Jobs).
  • Purpose: Enhances manifests with intelligent defaults and validations, mimicking real-world LLM capabilities (e.g., xAI’s Grok API) to improve resource efficiency and security.

4. Generation of Multiple Kubernetes Manifests

  • What It Does: Based on user inputs and selected resources, the app generates YAML manifests for each chosen resource type (e.g., Deployment, ConfigMap). Each manifest is tailored to the resource’s requirements:
    • Deployment: Includes replicas, labels, and container specs.
    • StatefulSet: Adds serviceName for stable network IDs.
    • DaemonSet: Omits replicas (runs on all nodes).
    • Job: Sets restartPolicy: Never for one-time tasks.
    • ConfigMap: Includes AI-generated key-value data.
    • Secret: Includes AI-generated base64-encoded data.
    • Manifests are combined into a single YAML file with --- separators.
  • Purpose: Produces ready-to-use Kubernetes manifests, reducing manual YAML authoring and ensuring consistency across resource types.

5. File Output to Desktop

  • What It Does: The generated YAML file (e.g., myapp-manifests.yaml) is saved to the user’s desktop, with a success message displayed in the UI (e.g., “Manifests saved to…”). The file name incorporates the app name for easy identification.
  • Purpose: Provides a convenient way to access and apply manifests using tools like kubectl, streamlining deployment workflows.

6. Cross-Platform Executables

  • What It Does: The application is packaged as standalone executables for:
    • Windows: An NSIS-based EXE installer.
    • macOS: A DMG installer.
    • Debian-based Linux: A DEB package for systems like Ubuntu.
    • Users can install and run the app natively on their preferred OS, with optional custom icons for a polished look.
  • Purpose: Ensures the app is accessible to users across major operating systems, supporting diverse development environments.

7. Secure Electron Architecture

  • What It Does: The app uses Electron’s secure configuration:
    • contextIsolation: true and nodeIntegration: false to isolate the renderer process.
    • A preload.js script to safely expose IPC communication via contextBridge.
    • Restricted IPC channels (e.g., only generate-manifest) to prevent unauthorized access.
  • Purpose: Protects the application from potential security vulnerabilities, ensuring safe execution even with user inputs.

How It Works

  1. Users launch the app and enter parameters (app name, image, replicas) in the form.
  2. They select desired Kubernetes resources via checkboxes (e.g., Deployment, Secret).
  3. Upon submission, the app validates inputs and queries the mock AI database for optimized configurations.
  4. It generates YAML manifests for each selected resource, combining them into a single file.
  5. The file is saved to the desktop, and a status message confirms success or displays errors.
  6. Users can apply the generated manifests to a Kubernetes cluster using kubectl.

Benefits

  • Simplicity: Eliminates manual YAML editing with an intuitive UI.
  • Flexibility: Supports multiple Kubernetes resource types in one tool.
  • Intelligence: Mock AI enhances manifests with optimized settings.
  • Portability: Runs on Windows, macOS, and Debian-based Linux.
  • Security: Built with Electron’s best practices for safe operation.

This application is ideal for developers, DevOps engineers, or anyone looking to streamline Kubernetes manifest creation with a desktop tool that balances ease of use and powerful functionality.

Example

nginx-deployment.yaml were created base on the parameter fill up.

Example of fill up information

apiVersion: apps/v1
kind: Deployment
metadata:
  name: myapp
  labels:
    app: myapp
spec:
  replicas: 3
  selector:
    matchLabels:
      app: myapp
  template:
    metadata:
      labels:
        app: myapp
    spec:
      containers:
      - name: myapp
        image: nginx:latest
        resources:
          limits:
            cpu: 500m
            memory: 512Mi
          requests:
            cpu: 200m
            memory: 256Mi
---
apiVersion: v1
kind: ConfigMap
metadata:
  name: myapp-config
data:
  app.conf: appName=myapp,image=nginx:latest
---
apiVersion: v1
kind: Secret
metadata:
  name: myapp-secret
type: Opaque
data:
  api-key: c2VjcmV0LW15YXBw

About

A K8s manifest generator application that designed to simplify creation of kubernetes manifest for various type.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors