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.
- package/README.md +107 -123
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,176 +1,160 @@
|
|
|
1
|
-
|
|
1
|
+
k8s-deploy-helper π
|
|
2
2
|
|
|
3
|
-
|
|
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
|
-
|
|
7
|
+
-----
|
|
9
8
|
|
|
10
|
-
|
|
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
|
-
|
|
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
|
-
|
|
19
|
+
For beginners and even intermediate developers, this process can be confusing, time-consuming, and error-prone.
|
|
21
20
|
|
|
22
|
-
-
|
|
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
|
-
|
|
25
|
+
WHAT THIS TOOL DOES βοΈ
|
|
33
26
|
|
|
34
|
-
|
|
35
|
-
npm install -g k8s-deploy-helper
|
|
27
|
+
k8s-deploy-helper automates the full deployment process by:
|
|
36
28
|
|
|
37
|
-
|
|
38
|
-
|
|
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
|
-
|
|
41
|
-
|
|
36
|
+
You focus on building your application.
|
|
37
|
+
The tool handles the deployment.
|
|
42
38
|
|
|
43
|
-
|
|
39
|
+
-----
|
|
44
40
|
|
|
45
|
-
|
|
41
|
+
REQUIREMENTS (BEGINNER FRIENDLY) π οΈ
|
|
46
42
|
|
|
47
|
-
|
|
43
|
+
Minimum setup for local usage:
|
|
48
44
|
|
|
49
|
-
|
|
45
|
+
β’ Docker Desktop installed
|
|
46
|
+
β’ Kubernetes enabled inside Docker Desktop
|
|
50
47
|
|
|
51
|
-
Docker Desktop
|
|
48
|
+
Docker Desktop already includes:
|
|
49
|
+
β’ Docker
|
|
50
|
+
β’ kubectl
|
|
51
|
+
β’ A local Kubernetes cluster
|
|
52
52
|
|
|
53
|
-
|
|
53
|
+
To verify Kubernetes is running:
|
|
54
54
|
|
|
55
|
-
|
|
55
|
+
kubectl get nodes
|
|
56
56
|
|
|
57
|
-
|
|
57
|
+
-----
|
|
58
58
|
|
|
59
|
-
|
|
60
|
-
Create a k8s.config.json file in your project root.
|
|
59
|
+
INSTALLATION π¦
|
|
61
60
|
|
|
62
|
-
|
|
63
|
-
|
|
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
|
-
|
|
70
|
-
|
|
71
|
-
"tag": "latest",
|
|
72
|
-
"context": ".",
|
|
73
|
-
"dockerfile": "Dockerfile"
|
|
74
|
-
},
|
|
64
|
+
Verify the installation:
|
|
65
|
+
k8s-deploy --version
|
|
75
66
|
|
|
76
|
-
|
|
77
|
-
"replicas": 2,
|
|
78
|
-
"containerPort": 3000,
|
|
79
|
-
"servicePort": 80,
|
|
80
|
-
"serviceType": "ClusterIP"
|
|
81
|
-
},
|
|
67
|
+
-----
|
|
82
68
|
|
|
83
|
-
|
|
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
|
-
|
|
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
|
-
|
|
102
|
-
|
|
103
|
-
k8s-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
|
-
|
|
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
|
-
|
|
82
|
+
You can modify these files later to match your application needs.
|
|
110
83
|
|
|
111
|
-
|
|
84
|
+
STEP 2: DEPLOY LOCALLY (RECOMMENDED FOR BEGINNERS) π§ͺ
|
|
112
85
|
|
|
113
|
-
|
|
86
|
+
For first-time users, deploy without using Docker Hub or any container registry:
|
|
87
|
+
k8s-deploy deploy --local
|
|
114
88
|
|
|
115
|
-
|
|
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
|
-
|
|
95
|
+
No Docker Hub account or login is required.
|
|
118
96
|
|
|
119
|
-
|
|
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
|
-
|
|
127
|
-
|
|
99
|
+
Once you are comfortable and logged into a container registry,
|
|
100
|
+
run:
|
|
101
|
+
k8s-deploy deploy
|
|
128
102
|
|
|
129
|
-
|
|
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
|
-
|
|
108
|
+
-----
|
|
132
109
|
|
|
133
|
-
|
|
110
|
+
FILES CREATED BY THE TOOL π
|
|
134
111
|
|
|
135
|
-
|
|
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
|
-
|
|
138
|
-
|
|
119
|
+
These files can be:
|
|
120
|
+
β’ Reviewed
|
|
121
|
+
β’ Modified
|
|
122
|
+
β’ Committed to Git
|
|
123
|
+
β’ Used independently if needed
|
|
139
124
|
|
|
140
|
-
|
|
125
|
+
-----
|
|
141
126
|
|
|
142
|
-
|
|
127
|
+
WHAT HAPPENS INTERNALLY π
|
|
143
128
|
|
|
144
|
-
|
|
129
|
+
When you run the deploy command, the tool performs the following steps:
|
|
145
130
|
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
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
|
-
|
|
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
|
-
|
|
139
|
+
-----
|
|
163
140
|
|
|
164
|
-
|
|
141
|
+
WHY THIS TOOL IS VALUABLE β
|
|
165
142
|
|
|
166
|
-
|
|
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
|
-
|
|
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
|
-
|
|
155
|
+
-----
|
|
171
156
|
|
|
172
|
-
|
|
173
|
-
MIT License
|
|
157
|
+
AUTHOR π¨βπ»
|
|
174
158
|
|
|
175
|
-
|
|
176
|
-
|
|
159
|
+
Lokesh Shimpi
|
|
160
|
+
Built to simplify Kubernetes deployment and demonstrate real-world DevOps engineering.
|