Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
a5493c9
chore: Planning a better ingress
sunib Feb 11, 2026
208c95a
chore: Improvements in the plan
sunib Feb 11, 2026
b09930f
feat: Let's give the audit webhook handling it's own webserver (so th…
sunib Feb 11, 2026
db26a58
chore: Removing the leader election stuff, for now we will run 1 pod
sunib Feb 11, 2026
044f04c
feat: Simplify the services and server configurations
sunib Feb 11, 2026
c05d84f
feat: Spring cleaning of /config
sunib Feb 12, 2026
c2e7a8a
docs: Updating expectations
sunib Feb 12, 2026
e9e1cf6
fix: Never ever commit secrets in their raw form
sunib Feb 12, 2026
471b752
docs: Improving overview docs
sunib Feb 12, 2026
f6ee4b9
chore: Aligning http(s) server names and ports
sunib Feb 12, 2026
9cc2c2f
chore: First steps in testing the helm chart as well
sunib Feb 12, 2026
a45a743
chore: Testing the helm output
sunib Feb 12, 2026
34f8294
Let's give it a try
sunib Feb 12, 2026
8a25db9
Let's try it!
sunib Feb 12, 2026
7a48572
fix: That should resolve it
sunib Feb 12, 2026
3a03f9e
fix: Also make that part simpler please
sunib Feb 12, 2026
d0a8092
fix: That should fix it
sunib Feb 12, 2026
5f2118a
fix: Would this now finally work?
sunib Feb 12, 2026
3476237
fix: linting issues
sunib Feb 12, 2026
fa69cb3
fix: Remove double crds
sunib Feb 12, 2026
4626cc4
ci: Hopefully improving my ci stuff with this
sunib Feb 12, 2026
9dc1e45
ci: More alignment between local builds and remote builds
sunib Feb 12, 2026
ab663dd
ci: Hopefully fixing more issues now
sunib Feb 12, 2026
37a11ff
ci: Let's see if we can now rebuild without errors
sunib Feb 12, 2026
0db7d6f
ci: Rabithole
sunib Feb 12, 2026
8785f02
ci: It's nice if we can simplify this
sunib Feb 12, 2026
39cf2a7
ci: This is what DinD would like like (but it fails with networking o…
sunib Feb 13, 2026
20dace6
ci: Back to docker-outside-of-docker
sunib Feb 13, 2026
c145618
ci: Also switch back here offcourse
sunib Feb 13, 2026
34402f6
fix: Make "--metric-insecure" a reality and local testability of all …
sunib Feb 13, 2026
7c24aef
chore: Updating docs and CI labels
sunib Feb 13, 2026
0f7d48c
docs: Cleaning up
sunib Feb 13, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ RUN curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/i
| sh -s -- -b /usr/local/bin ${GOLANGCI_LINT_VERSION}

# Set working directory
WORKDIR /workspace
WORKDIR /workspaces

# Create godev group for shared Go development directory access
# This allows both root (during build) and vscode user (during dev) to write to /go
Expand Down Expand Up @@ -128,8 +128,8 @@ RUN groupadd -f docker && usermod -aG docker vscode

# Ensure vscode user can write to workspace (empty, so fast)
# Note: /go permissions are already set in CI stage and preserved here
RUN chown -R vscode:vscode /workspace && \
chmod -R 755 /workspace
RUN chown -R vscode:vscode /workspaces && \
chmod -R 755 /workspaces

# Switch back to vscode user for development
USER vscode
Expand All @@ -138,4 +138,4 @@ USER vscode
ENV DEBIAN_FRONTEND=dialog

# Default command
CMD ["/bin/bash"]
CMD ["/bin/bash"]
72 changes: 72 additions & 0 deletions .devcontainer/SETUP_CLUSTER_TROUBLESHOOTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# Troubleshooting `make setup-cluster` in DevContainer

## Symptom

`make setup-cluster` fails and Kind waits for the control-plane API server, with logs like:

```
Get "https://172.19.0.2:6443/livez?timeout=10s": dial tcp 172.19.0.2:6443: connect: connection refused
```

## Root cause (current setup)

`test/e2e/kind/start-cluster.sh` generates `test/e2e/kind/cluster.ignore.yaml` from `HOST_PROJECT_PATH`.

In the current devcontainer config, `HOST_PROJECT_PATH` is set from `${localWorkspaceFolder}`.
That produced:

```
hostPath: /home/simon/git/gitops-reverser2/test/e2e/kind/audit
```

But that mounted directory exists and is empty in the container, while the real audit files are under:

```
/workspaces/gitops-reverser2/test/e2e/kind/audit
```

Because the mount source is wrong/empty, kube-apiserver cannot read:

- `/etc/kubernetes/audit/policy.yaml`
- `/etc/kubernetes/audit/webhook-config.yaml`

Then kube-apiserver fails startup, and Kind reports API server connection refused on `:6443`.

## Why this happens

The path strategy differs by Docker mode:

- Host Docker socket mode: daemon needs host-visible paths.
- Docker-in-Docker mode: daemon needs container-visible paths.

Your current config mixes modes and path assumptions, so Kind mount path resolution is inconsistent.

## Fix options

1. Use Docker-in-Docker only (recommended)
- Remove host socket mount from `.devcontainer/devcontainer.json`.
- Set `HOST_PROJECT_PATH` to container workspace path (for example `/workspaces/${localWorkspaceFolderBasename}`).

2. Use host Docker socket only
- Remove `docker-in-docker` feature.
- Keep `HOST_PROJECT_PATH` as host path.

## Quick verification

Before running `make setup-cluster`, verify generated config points to a path with files:

```bash
cat test/e2e/kind/cluster.ignore.yaml
ls -la <hostPath-from-generated-file>
```

Expected: `policy.yaml` and `webhook-config.yaml` are present.

## Immediate workaround

Run setup with a container-visible path explicitly:

```bash
HOST_PROJECT_PATH=/workspaces/$(basename "$PWD") make setup-cluster
```

25 changes: 14 additions & 11 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,20 @@
"context": "..",
"target": "dev"
},
"workspaceMount": "source=${localWorkspaceFolder},target=/workspaces/${localWorkspaceFolderBasename},type=bind",
"workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}",
"features": {
"ghcr.io/devcontainers/features/docker-outside-of-docker:1": {},
"ghcr.io/devcontainers/features/common-utils:2": {
"userUid": "automatic",
"userGid": "automatic",
"username": "vscode"
},
"ghcr.io/devcontainers/features/docker-in-docker:2": {
"moby": false,
"dockerDashComposeVersion": "v2"
},
"ghcr.io/devcontainers/features/git:1": {}
},
"runArgs": [
"--network=host",
"--group-add=docker"
"--group-add=docker",
"--add-host=host.docker.internal:host-gateway"
],
"forwardPorts": [
13000,
Expand Down Expand Up @@ -58,17 +57,21 @@
"golang.go",
"ms-kubernetes-tools.vscode-kubernetes-tools",
"ms-azuretools.vscode-docker",
"kilocode.kilo-code"
"openai.chatgpt"
]
}
},
"postCreateCommand": "sudo chmod 666 /var/run/docker.sock || true && docker network create -d=bridge --subnet=172.19.0.0/24 kind || true && sudo chown -R vscode:vscode /workspace || true",
"postCreateCommand": "bash .devcontainer/post-create.sh '${containerWorkspaceFolder}'",
"remoteUser": "vscode",
"mounts": [
"source=/var/run/docker.sock,target=/var/run/docker.sock,type=bind"
"source=ghconfig,target=/home/vscode/.config/gh,type=volume",
"source=${localEnv:HOME}${localEnv:USERPROFILE}/.gitconfig,target=/home/vscode/.gitconfig-host,type=bind,readonly,consistency=cached",
"source=gomodcache,target=/go/pkg/mod,type=volume",
"source=gobuildcache,target=/home/vscode/.cache/go-build,type=volume",
"source=codexconfig,target=/home/vscode/.codex,type=volume"
],
"containerEnv": {
"HOST_PROJECT_PATH": "${localWorkspaceFolder}",
"DOCKER_API_VERSION": "1.44"
"PROJECT_PATH": "/workspaces/${localWorkspaceFolderBasename}"
}
}
}
42 changes: 42 additions & 0 deletions .devcontainer/post-create.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#!/usr/bin/env bash

set -euo pipefail

log() {
echo "[post-create] $*"
}

# Resolve workspace path in a way that works both inside and outside
# VS Code-specific shell variable injection.
workspace_dir="${1:-${containerWorkspaceFolder:-${WORKSPACE_FOLDER:-$(pwd)}}}"
log "Using workspace directory: ${workspace_dir}"

# Keep ~/.gitconfig writable inside the container while still importing host settings.
if [ -f /home/vscode/.gitconfig-host ]; then
log "Configuring git to include /home/vscode/.gitconfig-host"
touch /home/vscode/.gitconfig
if git config --global --get-all include.path | grep -Fxq "/home/vscode/.gitconfig-host"; then
log "Host gitconfig include already present"
else
git config --global --add include.path /home/vscode/.gitconfig-host
log "Added host gitconfig include"
fi
fi

# Ensure Go-related caches exist and are writable by vscode
log "Ensuring Go cache directories exist"
sudo mkdir -p \
/home/vscode/.cache/go-build \
/home/vscode/.cache/goimports \
/home/vscode/.cache/golangci-lint

# Fix ownership for workspace and cache roots used by tooling
if [ -d "${workspace_dir}" ]; then
log "Fixing ownership for workspace and cache directories"
sudo chown -R vscode:vscode "${workspace_dir}" /home/vscode || true
else
log "Workspace directory not found; fixing ownership for cache only"
sudo chown -R vscode:vscode /home/vscode || true
fi

log "post-create completed"
Loading