k8s-deploy-helper 1.0.0 β†’ 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +107 -123
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,176 +1,160 @@
1
- # k8s-deploy-helper
1
+ k8s-deploy-helper πŸš€
2
2
 
3
- A production-grade CLI tool that automates Docker image builds and Kubernetes deployments using a single command.
4
- Designed for real-world CI/CD pipelines and local developer workflows.
3
+ k8s-deploy-helper is a simple and beginner-friendly CLI tool that helps you build Docker images and deploy applications to Kubernetes using a guided and automated workflow.
5
4
 
6
- ---
5
+ It is designed to reduce the learning curve of Kubernetes while still supporting real-world DevOps practices.
7
6
 
8
- ## ✨ Overview
7
+ -----
9
8
 
10
- `k8s-deploy-helper` simplifies the process of:
11
- - Building Docker images
12
- - Pushing images to container registries
13
- - Generating Kubernetes manifests
14
- - Deploying applications to Kubernetes clusters
9
+ PROBLEM THIS TOOL SOLVES 🧩
15
10
 
16
- The tool is **configuration-driven**, **CI/CD-friendly**, and uses **native Docker and kubectl** instead of opaque SDK abstractions.
11
+ Deploying an application to Kubernetes usually involves many manual steps:
17
12
 
18
- ---
13
+ β€’ Creating and maintaining a Dockerfile
14
+ β€’ Writing Kubernetes YAML files (Deployment, Service, etc.)
15
+ β€’ Understanding kubectl commands
16
+ β€’ Managing Docker registry authentication
17
+ β€’ Debugging unclear or low-level runtime errors
19
18
 
20
- ## πŸš€ Features
19
+ For beginners and even intermediate developers, this process can be confusing, time-consuming, and error-prone.
21
20
 
22
- - Docker image build automation
23
- - Registry push support (Docker Hub, ECR, GHCR, etc.)
24
- - Kubernetes Deployment & Service YAML generation
25
- - Automatic `kubectl apply`
26
- - Graceful handling of partial failures
27
- - Idempotent deployments
28
- - Works locally and in CI pipelines
21
+ k8s-deploy-helper removes this complexity by automating these steps and guiding the user through a clear, predictable workflow.
29
22
 
30
- ---
23
+ -----
31
24
 
32
- ## πŸ“¦ Installation
25
+ WHAT THIS TOOL DOES βš™οΈ
33
26
 
34
- Install globally from npm:
35
- npm install -g k8s-deploy-helper
27
+ k8s-deploy-helper automates the full deployment process by:
36
28
 
37
- Verify installation:
38
- k8s-deploy --version
29
+ β€’ Automatically generating missing Docker and Kubernetes configuration files
30
+ β€’ Building Docker images for your application
31
+ β€’ Supporting local deployments without pushing images to Docker Hub
32
+ β€’ Generating Kubernetes Deployment and Service YAML files automatically
33
+ β€’ Applying Kubernetes resources using kubectl
34
+ β€’ Detecting missing setup early and displaying clear, actionable error messages
39
35
 
40
- πŸ›  Prerequisites
41
- Ensure the following are installed and configured:
36
+ You focus on building your application.
37
+ The tool handles the deployment.
42
38
 
43
- Node.js (v18+)
39
+ -----
44
40
 
45
- Docker (running)
41
+ REQUIREMENTS (BEGINNER FRIENDLY) πŸ› οΈ
46
42
 
47
- kubectl
43
+ Minimum setup for local usage:
48
44
 
49
- Kubernetes cluster:
45
+ β€’ Docker Desktop installed
46
+ β€’ Kubernetes enabled inside Docker Desktop
50
47
 
51
- Docker Desktop Kubernetes
48
+ Docker Desktop already includes:
49
+ β€’ Docker
50
+ β€’ kubectl
51
+ β€’ A local Kubernetes cluster
52
52
 
53
- Minikube
53
+ To verify Kubernetes is running:
54
54
 
55
- EKS / GKE / AKS
55
+ kubectl get nodes
56
56
 
57
- Container registry access (Docker Hub, ECR, GHCR, etc.)
57
+ -----
58
58
 
59
- πŸ“„ Configuration
60
- Create a k8s.config.json file in your project root.
59
+ INSTALLATION πŸ“¦
61
60
 
62
- Example configuration:
63
- json
64
- Copy code
65
- {
66
- "appName": "my-app",
67
- "namespace": "default",
61
+ Install the package globally using npm:
62
+ npm install -g k8s-deploy-helper
68
63
 
69
- "docker": {
70
- "image": "username/my-app",
71
- "tag": "latest",
72
- "context": ".",
73
- "dockerfile": "Dockerfile"
74
- },
64
+ Verify the installation:
65
+ k8s-deploy --version
75
66
 
76
- "kubernetes": {
77
- "replicas": 2,
78
- "containerPort": 3000,
79
- "servicePort": 80,
80
- "serviceType": "ClusterIP"
81
- },
67
+ -----
82
68
 
83
- "resources": {
84
- "limits": {
85
- "cpu": "500m",
86
- "memory": "512Mi"
87
- },
88
- "requests": {
89
- "cpu": "250m",
90
- "memory": "256Mi"
91
- }
92
- },
69
+ HOW TO USE (STEP-BY-STEP) ▢️
93
70
 
94
- "env": {
95
- "NODE_ENV": "production"
96
- }
97
- }
98
- ▢️ Usage
99
- Deploy your application using a single command:
71
+ STEP 1: INITIALIZE THE PROJECT ⭐
100
72
 
101
- bash
102
- Copy code
103
- k8s-deploy deploy
104
- What this command does:
105
- Builds the Docker image
73
+ If your project does not already have a Dockerfile or k8s.config.json,
74
+ run:
75
+ k8s-deploy init
106
76
 
107
- Pushes the image to the registry (if authorized)
77
+ This command will:
78
+ β€’ Create a basic Dockerfile
79
+ β€’ Create a k8s.config.json configuration file
80
+ β€’ Prepare your project for Kubernetes deployment
108
81
 
109
- Generates Kubernetes manifests:
82
+ You can modify these files later to match your application needs.
110
83
 
111
- deployment.yaml
84
+ STEP 2: DEPLOY LOCALLY (RECOMMENDED FOR BEGINNERS) πŸ§ͺ
112
85
 
113
- service.yaml
86
+ For first-time users, deploy without using Docker Hub or any container registry:
87
+ k8s-deploy deploy --local
114
88
 
115
- Applies the resources to the Kubernetes cluster using kubectl
89
+ What happens during local deployment:
90
+ β€’ The Docker image is built locally
91
+ β€’ Image push to a registry is skipped
92
+ β€’ Kubernetes uses the local image
93
+ β€’ The application is deployed to the local Kubernetes cluster
116
94
 
117
- If the image push fails, deployment continues using the existing image tag.
95
+ No Docker Hub account or login is required.
118
96
 
119
- πŸ“ Generated Files
120
- text
121
- Copy code
122
- deployment.yaml
123
- service.yaml
124
- These files can be reviewed, committed to version control, or applied independently.
97
+ STEP 3: STANDARD DEPLOYMENT (OPTIONAL) 🌐
125
98
 
126
- πŸ” Authentication
127
- This tool does not manage credentials.
99
+ Once you are comfortable and logged into a container registry,
100
+ run:
101
+ k8s-deploy deploy
128
102
 
129
- Authentication must be handled externally:
103
+ This will:
104
+ β€’ Build the Docker image
105
+ β€’ Push the image to the configured registry
106
+ β€’ Deploy the application to Kubernetes
130
107
 
131
- docker login for container registries
108
+ -----
132
109
 
133
- kubectl config for Kubernetes clusters
110
+ FILES CREATED BY THE TOOL πŸ“
134
111
 
135
- This mirrors real-world CI/CD environments and avoids secret leakage.
112
+ After running the commands, the following files will exist in your project:
113
+
114
+ Dockerfile
115
+ k8s.config.json
116
+ deployment.yaml
117
+ service.yaml
136
118
 
137
- 🧠 Design Principles
138
- Explicit over implicit β€” no hidden magic
119
+ These files can be:
120
+ β€’ Reviewed
121
+ β€’ Modified
122
+ β€’ Committed to Git
123
+ β€’ Used independently if needed
139
124
 
140
- Fail loud, fail early β€” CI-friendly logs
125
+ -----
141
126
 
142
- Idempotent operations β€” safe re-runs
127
+ WHAT HAPPENS INTERNALLY πŸ”
143
128
 
144
- No vendor lock-in β€” relies on standard tools
129
+ When you run the deploy command, the tool performs the following steps:
145
130
 
146
- πŸ§ͺ Example Output
147
- text
148
- Copy code
149
- 🐳 Building Docker image: username/my-app:latest
150
- πŸ“€ Pushing Docker image: username/my-app:latest
151
- ⚠️ Image push failed β€” continuing deployment
131
+ β€’ Checks for required files
132
+ β€’ Verifies Docker and Kubernetes availability
133
+ β€’ Builds the Docker image
134
+ β€’ Generates Kubernetes YAML files
135
+ β€’ Applies resources using kubectl
152
136
 
153
- ☸️ Deploying to Kubernetes namespace: default
154
- πŸ“¦ Applying deployment.yaml
155
- deployment.apps/my-app created
156
- πŸ“¦ Applying service.yaml
157
- service/my-app created
158
- βœ… Kubernetes resources applied successfully
159
- πŸ—Ί Roadmap
160
- Planned enhancements:
137
+ Each step is logged clearly so you can understand what is happening.
161
138
 
162
- --dry-run mode
139
+ -----
163
140
 
164
- Rollback support
141
+ WHY THIS TOOL IS VALUABLE ⭐
165
142
 
166
- Helm chart generation
143
+ Without this tool:
144
+ β€’ You manually write Kubernetes YAML
145
+ β€’ You manage Docker commands yourself
146
+ β€’ You deal with registry authentication issues
147
+ β€’ Kubernetes feels complex and fragile
167
148
 
168
- Deployment health checks
149
+ With this tool:
150
+ β€’ One-command deployment
151
+ β€’ Beginner-safe defaults
152
+ β€’ Hands-on Kubernetes experience
153
+ β€’ Production-ready deployment workflow
169
154
 
170
- GitHub Actions CI template
155
+ -----
171
156
 
172
- πŸ“œ License
173
- MIT License
157
+ AUTHOR πŸ‘¨β€πŸ’»
174
158
 
175
- πŸ‘¨β€πŸ’» Author
176
- Lokesh Shimpi
159
+ Lokesh Shimpi
160
+ Built to simplify Kubernetes deployment and demonstrate real-world DevOps engineering.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "k8s-deploy-helper",
3
- "version": "1.0.0",
3
+ "version": "1.2.0",
4
4
  "description": "CLI tool to build, push and deploy applications to Kubernetes",
5
5
  "type": "module",
6
6
  "bin": {