Skip to content

Commit 78eb515

Browse files
authored
ROX-31487: Add helm chart (#23)
1 parent 53e4b0b commit 78eb515

15 files changed

Lines changed: 954 additions & 3 deletions

File tree

.github/workflows/style.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,33 @@ jobs:
3636
uses: hadolint/hadolint-action@v3.3.0
3737
with:
3838
dockerfile: Dockerfile
39+
40+
- name: Create ../results directory for SARIF report files
41+
shell: bash
42+
run: mkdir -p ../results
43+
44+
- name: Scan Helm with kube-linter
45+
uses: stackrox/kube-linter-action@v1.0.7
46+
id: kube-linter-helm-scan
47+
with:
48+
directory: charts/stackrox-mcp
49+
format: sarif
50+
output-file: ../results/kube-linter.sarif
51+
# This allows the following upload-sarif action to still upload the results to your GitHub repo.
52+
continue-on-error: true
53+
54+
- name: Upload SARIF report files to GitHub
55+
uses: github/codeql-action/upload-sarif@v4
56+
57+
# Ensure the workflow eventually fails if files did not pass kube-linter checks.
58+
- name: Verify kube-linter-action succeeded
59+
shell: bash
60+
run: |
61+
echo "If this step fails, kube-linter found issues. Check the output of the scan step above."
62+
[[ "${{ steps.kube-linter-helm-scan.outcome }}" == "success" ]]
63+
64+
- name: Set up chart-testing
65+
uses: helm/chart-testing-action@v2.8.0
66+
67+
- name: Run chart-testing (lint)
68+
run: ct lint charts/stackrox-mcp --validate-maintainers=false --all

Dockerfile

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,12 @@ WORKDIR /app
5050
# Copy binary from builder
5151
COPY --from=builder /tmp/stackrox-mcp /app/stackrox-mcp
5252

53-
# Set ownership to non-root user
54-
RUN chown -R 4000:4000 /app
53+
# Set ownership for OpenShift arbitrary UID support
54+
# Files owned by 4000, group 0 (root), with group permissions matching user
55+
RUN chown -R 4000:0 /app && \
56+
chmod -R g=u /app
5557

56-
# Switch to non-root user
58+
# Switch to non-root user (can be overridden by OpenShift SCC)
5759
USER 4000
5860

5961
# Expose port for MCP server

Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@ image: ## Build the docker image
4949
dockerfile-lint: ## Run hadolint for Dockerfile
5050
$(DOCKER_CMD) run --rm -i --env HADOLINT_FAILURE_THRESHOLD=info ghcr.io/hadolint/hadolint < Dockerfile
5151

52+
.PHONY: helm-lint
53+
helm-lint: ## Run helm lint for Helm chart
54+
helm lint charts/stackrox-mcp
55+
5256
.PHONY: test
5357
test: ## Run unit tests
5458
$(GOTEST) -v ./...

README.md

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,82 @@ Images are automatically built and pushed on:
269269

270270
See [.github/workflows/build.yml](.github/workflows/build.yml) for build pipeline details.
271271

272+
## Kubernetes Deployment
273+
274+
Deploy the StackRox MCP server to Kubernetes or OpenShift clusters using Helm.
275+
276+
### Prerequisites
277+
278+
- Kubernetes 1.19+ or OpenShift 4.x+
279+
- Helm 3.0+
280+
- Access to a StackRox Central instance
281+
282+
### Installing with Helm
283+
284+
**Basic installation:**
285+
286+
```bash
287+
helm install stackrox-mcp charts/stackrox-mcp \
288+
--namespace stackrox-mcp \
289+
--create-namespace \
290+
--set config.central.url=central.stackrox:8443
291+
```
292+
293+
**With custom values file:**
294+
295+
Create a `values.yaml` file:
296+
297+
```yaml
298+
config:
299+
central:
300+
url: "central.example.com:443"
301+
```
302+
303+
Install with custom values:
304+
305+
```bash
306+
helm install stackrox-mcp charts/stackrox-mcp \
307+
--namespace stackrox-mcp \
308+
--create-namespace \
309+
--values values.yaml
310+
```
311+
312+
**OpenShift deployment with Route:**
313+
314+
```bash
315+
helm install stackrox-mcp charts/stackrox-mcp \
316+
--namespace stackrox-mcp \
317+
--create-namespace \
318+
--set config.central.url=central.stackrox:8443 \
319+
--set openshift.route.host=stackrox-mcp.apps.example.com
320+
```
321+
322+
### Managing the Deployment
323+
324+
**Upgrade an existing release:**
325+
326+
```bash
327+
helm upgrade stackrox-mcp charts/stackrox-mcp \
328+
--namespace stackrox-mcp \
329+
--reuse-values
330+
```
331+
332+
**Uninstall:**
333+
334+
```bash
335+
helm uninstall stackrox-mcp --namespace stackrox-mcp
336+
```
337+
338+
### Configuration
339+
340+
For complete configuration options including:
341+
- Security contexts and pod security standards
342+
- Resource limits and requests
343+
- High availability setup
344+
- OpenShift-specific configuration
345+
346+
See the [Helm Chart README](charts/stackrox-mcp/README.md).
347+
272348
## Development
273349

274350
For detailed development guidelines, testing standards, and contribution workflows, see [CONTRIBUTING.md](.github/CONTRIBUTING.md).

charts/stackrox-mcp/.helmignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Patterns to ignore when packaging
2+
.git/
3+
.gitignore
4+
*.swp
5+
*.bak
6+
*.tmp
7+
.DS_Store

charts/stackrox-mcp/Chart.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
apiVersion: v2
2+
name: stackrox-mcp
3+
description: A Helm chart for StackRox Model Context Protocol (MCP) Server
4+
type: application
5+
version: 0.1.0
6+
appVersion: "dev"
7+
home: https://github.com/stackrox/stackrox-mcp
8+
sources:
9+
- https://github.com/stackrox/stackrox-mcp
10+
keywords:
11+
- stackrox
12+
- mcp
13+
- security
14+
- vulnerability

0 commit comments

Comments
 (0)