You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: ADVANCED_README.md
+45-1Lines changed: 45 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,49 @@
1
1
# Advanced README for mcp-server-kubernetes
2
2
3
+
### Non-Destructive Mode
4
+
5
+
You can run the server in a non-destructive mode that disables all destructive operations (delete pods, delete deployments, delete namespaces, etc.) by setting the `ALLOW_ONLY_NON_DESTRUCTIVE_TOOLS` environment variable to `true`:
-**Production environments**: Prevent accidental deletion or modification of critical resources
14
+
-**Shared clusters**: Allow multiple users to safely explore the cluster without risk of disruption
15
+
-**Educational settings**: Provide a safe environment for learning Kubernetes operations
16
+
-**Demonstration purposes**: Show cluster state and resources without modification risk
17
+
18
+
When enabled, the following destructive operations are disabled:
19
+
20
+
-`delete_pod`: Deleting pods
21
+
-`delete_deployment`: Deleting deployments
22
+
-`delete_namespace`: Deleting namespaces
23
+
-`uninstall_helm_chart`: Uninstalling Helm charts
24
+
-`delete_cronjob`: Deleting cronjobs
25
+
-`cleanup`: Cleaning up resources
26
+
27
+
All read-only operations like listing resources, describing pods, getting logs, etc. remain fully functional.
28
+
29
+
For Non destructive mode in Claude Desktop, you can specify the env var like this:
30
+
31
+
```json
32
+
{
33
+
"mcpServers": {
34
+
"kubernetes-readonly": {
35
+
"command": "npx",
36
+
"args": ["mcp-server-kubernetes"],
37
+
"env": {
38
+
"ALLOW_ONLY_NON_DESTRUCTIVE_TOOLS": "true"
39
+
}
40
+
}
41
+
}
42
+
}
43
+
```
44
+
45
+
### SSE Transport
46
+
3
47
To enable [SSE transport](https://modelcontextprotocol.io/docs/concepts/transports#server-sent-events-sse) for mcp-server-kubernetes, use the ENABLE_UNSAFE_SSE_TRANSPORT environment variable.
4
48
5
49
```shell
@@ -35,6 +79,6 @@ If there's no error, you will receive an `event: message` response in the localh
35
79
36
80
Note that normally a client would handle this for you. This is just a demonstration of how to use the SSE transport.
37
81
38
-
## Why is it Unsafe?
82
+
###Why is SSE Transport Unsafe?
39
83
40
84
SSE transport exposes an http endpoint that can be accessed by anyone with the URL. This can be a security risk if the server is not properly secured. It is recommended to use a secure proxy server to proxy to the SSE endpoint. In addition, anyone with access to the URL will be able to utilize the authentication of your kubeconfig to make requests to your Kubernetes cluster. You should add logging to your proxy in order to monitor user requests to the SSE endpoint.
Copy file name to clipboardExpand all lines: Dockerfile
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -14,7 +14,7 @@ RUN chmod 644 /etc/apt/sources.list.d/kubernetes.list
14
14
RUN curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | gpg --dearmor -o /usr/share/keyrings/cloud.google.gpg
15
15
RUN echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" | tee -a /etc/apt/sources.list.d/google-cloud-sdk.list
16
16
RUN apt-get update
17
-
RUN apt-get install -y kubectl google-cloud-cli google-cloud-cli-gke-gcloud-auth-plugin
17
+
RUN apt-get install -y kubectl google-cloud-cli google-cloud-cli-gke-gcloud-auth-plugin awscli
-[x] Non-destructive mode for read-only access to clusters
85
86
86
87
## Local Development
87
88
@@ -143,7 +144,9 @@ See the [CONTRIBUTING.md](CONTRIBUTING.md) file for details.
143
144
144
145
## Advanced
145
146
146
-
For more advanced information like using SSE transport, see the [ADVANCED_README.md](ADVANCED_README.md).
147
+
### Additional Advanced Features
148
+
149
+
For more advanced information like using SSE transport, Non-destructive mode with `ALLOW_ONLY_NON_DESTRUCTIVE_TOOLS`, see the [ADVANCED_README.md](ADVANCED_README.md).
0 commit comments