Skip to content

Commit 80b1d94

Browse files
committed
reliable workspace and kubeconfig path for template repo and k8s plugin
1 parent 62c0163 commit 80b1d94

2 files changed

Lines changed: 23 additions & 19 deletions

File tree

.github/devcontainer/devcontainer.json

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@
66
"privileged": true,
77
"overrideCommand": false,
88
"updateRemoteUserUID": true,
9-
"workspaceFolder": "/home/vscode",
109
"shutdownAction": "stopContainer",
1110
"securityOpt": ["seccomp=unconfined"],
1211
"runArgs": ["--network=host"],
1312
"mounts": ["source=dind-var-lib-docker,target=/var/lib/docker,type=volume"],
1413
"features": {"ghcr.io/devcontainers/features/docker-outside-of-docker:1": {}},
1514
"postCreateCommand": "devcontainer-links",
1615
//"workspaceMount": "source=.,target=/home/vscode/konductor,type=bind,consistency=cached",
16+
//"workspaceFolder": "/home/vscode/konductor",
1717
"forwardPorts": [1313, 2222, 6000, 7681, 8080],
1818
"customizations": {
1919
"vscode": {
@@ -90,9 +90,9 @@
9090
"lineNumbers": "relative",
9191
"formatOnSave": true,
9292
"insertSpaces": true,
93-
"tabFocusMode": true,
9493
"tabScrolling": "auto",
95-
"tabMovesFocus": false,
94+
//"tabFocusMode": false,
95+
//"tabMovesFocus": false,
9696
"tabCompletion": "on",
9797
"tabDecoration": true,
9898
"fontLigatures": true,
@@ -116,7 +116,7 @@
116116
"inlineSuggest.enabled": true,
117117
"parameterHints.enabled": true,
118118
"trimTrailingWhitespace": true,
119-
"lineHighlightBackground": "30BFBF",
119+
"lineHighlightBackground": "#30BFBF",
120120
"highlightActiveIndentGuide": true,
121121
"fontFamily": "'FiraMono Nerd Font Mono', monospace",
122122
"gotoLocation": {
@@ -151,11 +151,13 @@
151151
"ignoreLegacyWarning": true,
152152
"autoRepositoryDetection": "openEditors",
153153
"defaultCloneParentDirectory": "/home/vscode",
154-
"path": "/usr/local/bin/git",
155154
"scanRepositories": [
156155
"/home/vscode",
156+
"/home/vscode/konductor",
157+
"/home/vscode/konductor/.github/devcontainer",
157158
"/workspaces"
158-
]
159+
],
160+
"path": "/usr/local/bin/git"
159161
},
160162
"go": {
161163
"testTags": "all",
@@ -174,9 +176,9 @@
174176
},
175177
"terminal": {
176178
"integrated": {
179+
//"cwd": "/home/vscode/Konductor",
177180
"fontSize": 14,
178181
"scrollback": 10000,
179-
"cwd": "/home/vscode",
180182
"cursorStyle": "outline",
181183
"hideOnStartup": false,
182184
"cursorBlinking": true,
@@ -197,9 +199,10 @@
197199
"vs-kubernetes.namespace": "*",
198200
"vs-kubernetes.outputFormat": "yaml",
199201
"vs-kubernetes.helm-path": "/usr/local/bin/helm",
200-
"vs-kubernetes.kubeconfig": "/home/vscode/*/.kube/config",
202+
"vs-kubernetes.kubeconfig": "/home/vscode/.kube/config",
201203
"vs-kubernetes.kubectl-path": "/usr/local/bin/kubectl",
202204
"vs-kubernetes.knownKubeconfigs": [
205+
"/workspaces/*/.kube/config",
203206
"/home/vscode/*/.kube/config",
204207
"/home/vscode/.kube/config"
205208
]

Makefile

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,8 @@ wait-all-pods:
102102
# --- Talos Configuration ---
103103
talos-gen-config:
104104
@echo "Generating Talos Config..."
105-
@mkdir -p .kube .pulumi .talos
106-
@touch ${KUBE_CONFIG_FILE} ${TALOS_CONFIG_FILE}
105+
@mkdir -p ${HOME}/.kube .kube .pulumi .talos
106+
@touch ${HOME}/.kube/config ${KUBE_CONFIG_FILE} ${TALOS_CONFIG_FILE}
107107
@sudo talosctl gen config kargo https://10.5.0.2:6443 \
108108
--config-patch @.talos/patch/machine.yaml --output .talos/manifest
109109
@sudo talosctl validate --mode container \
@@ -118,7 +118,7 @@ talos-cluster: detect-arch talos-gen-config
118118
--workers 1 \
119119
--controlplanes 1 \
120120
--provisioner docker
121-
@pulumi config set kubernetes talos
121+
@pulumi config set kubernetes talos || true
122122
@echo "Talos Cluster provisioning..."
123123

124124
# --- Wait for Talos Cluster Ready ---
@@ -141,17 +141,18 @@ talos: clean-all talos-cluster talos-ready wait-all-pods
141141
kind-cluster:
142142
@echo "Creating Kind Cluster..."
143143
@direnv allow || true
144-
@mkdir -p .kube || true
145-
@touch .kube/config || true
146-
@chmod 600 .kube/config || true
144+
@mkdir -p ${HOME}/.kube .kube || true
145+
@touch ${HOME}/.kube/config .kube/config || true
146+
@chmod 600 ${HOME}/.kube/config .kube/config || true
147147
@sudo docker volume create cilium-worker-n01
148148
@sudo docker volume create cilium-worker-n02
149149
@sudo docker volume create cilium-control-plane-n01
150150
@sudo kind create cluster --wait 1m --retain --config=hack/kind.yaml
151151
@sudo kind get clusters
152152
@sudo kind get kubeconfig --name cilium | tee ${KUBE_CONFIG_FILE} 1>/dev/null
153+
@sudo kind get kubeconfig --name cilium | tee ${HOME}/.kube/config 1>/dev/null
153154
@sudo chown -R $(id -u):$(id -g) ${KUBE_CONFIG_FILE}
154-
@pulumi config set kubernetes kind
155+
@pulumi config set kubernetes kind || true
155156
@echo "Created Kind Cluster."
156157

157158
# --- Wait for Kind Cluster Ready ---
@@ -163,7 +164,7 @@ kind-ready:
163164
@bash -c 'until kubectl --kubeconfig ${KUBE_CONFIG_FILE} wait --for=condition=Ready pod -l component=kube-controller-manager --namespace=kube-system --timeout=180s; do echo "Waiting for kube-controller-manager to be ready..."; sleep 5; done'
164165
@echo "Kind Cluster is ready."
165166

166-
kind: login kind-cluster kind-ready
167+
kind: clean kind-cluster kind-ready
167168

168169
# ----------------------------------------------------------------------------------------------
169170
# --- Maintenance ---
@@ -209,14 +210,14 @@ konductor:
209210
@echo "Konductor Devcontainer is up to date."
210211

211212
# --- Testing ---
212-
test-kind: kind pulumi-up
213+
test-kind: clean kind pulumi-up
213214
@echo "Kind test complete."
214215

215-
test-talos: talos pulumi-up
216+
test-talos: clean talos pulumi-up
216217
@echo "Talos test complete."
217218

218219
# --- Stop Codespaces ---
219-
stop:
220+
stop: clean
220221
@echo "Stopping Codespaces..."
221222
@gh codespace --codespace ${CODESPACE_NAME} stop
222223
@echo "Codespaces stopped."

0 commit comments

Comments
 (0)