Compare commits
5 Commits
0856691343
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8441afb56f | ||
|
|
57737dcfb9 | ||
| 04aa0b0cbf | |||
| a8934b7442 | |||
| 3036a6f44e |
@@ -179,6 +179,11 @@ function Connect-Dev1(){
|
|||||||
ssh -o ForwardAgent=yes wholteza@dev1.zacke.dev
|
ssh -o ForwardAgent=yes wholteza@dev1.zacke.dev
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function minikubestart {
|
||||||
|
minikube start --base-image="gcr.io/k8s-minikube/kicbase:v0.0.50" @args
|
||||||
|
wsl ./sync-minikube-port.sh
|
||||||
|
}
|
||||||
|
|
||||||
# Aliases
|
# Aliases
|
||||||
Set-alias -Name g -Value git
|
Set-alias -Name g -Value git
|
||||||
Set-Alias -Name k -Value kubectl
|
Set-Alias -Name k -Value kubectl
|
||||||
@@ -189,6 +194,7 @@ Set-Alias -Name yy -Value Open-Nuxt
|
|||||||
Set-Alias -Name dev1 -Value Connect-Dev1
|
Set-Alias -Name dev1 -Value Connect-Dev1
|
||||||
|
|
||||||
Set-Alias -Name dash -Value Open-KubernetesDashboard
|
Set-Alias -Name dash -Value Open-KubernetesDashboard
|
||||||
|
Set-Alias -Name minikube-start -Value minikubestart
|
||||||
|
|
||||||
Set-Alias -Name cd-repos -Value cdr
|
Set-Alias -Name cd-repos -Value cdr
|
||||||
Set-Alias -Name repos -Value cdr
|
Set-Alias -Name repos -Value cdr
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ local default_prog = {
|
|||||||
"& { . ~/.profile.ps1; $host.EnterNestedPrompt() }",
|
"& { . ~/.profile.ps1; $host.EnterNestedPrompt() }",
|
||||||
}
|
}
|
||||||
|
|
||||||
default_prog = {"ubuntu"}
|
-- default_prog = {"ubuntu"}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
default_prog = default_prog,
|
default_prog = default_prog,
|
||||||
|
|||||||
@@ -104,12 +104,14 @@ vim.pack.add({
|
|||||||
"https://github.com/jay-babu/mason-nvim-dap.nvim", -- Automatically install DAP adapters
|
"https://github.com/jay-babu/mason-nvim-dap.nvim", -- Automatically install DAP adapters
|
||||||
"https://github.com/thehamsta/nvim-dap-virtual-text", -- Virtual text for nvim dap
|
"https://github.com/thehamsta/nvim-dap-virtual-text", -- Virtual text for nvim dap
|
||||||
"https://github.com/mfussenegger/nvim-dap-python", -- Python support for nvim-dap
|
"https://github.com/mfussenegger/nvim-dap-python", -- Python support for nvim-dap
|
||||||
|
"https://github.com/LunarVim/bigfile.nvim",
|
||||||
})
|
})
|
||||||
|
|
||||||
-- SECTION: Colorscheme
|
-- SECTION: Colorscheme
|
||||||
vim.cmd("colorscheme catppuccin-mocha")
|
vim.cmd("colorscheme catppuccin-mocha")
|
||||||
|
|
||||||
-- SECTION: General plugin setup
|
-- SECTION: General plugin setup
|
||||||
|
require("bigfile").setup()
|
||||||
|
|
||||||
-- Folke
|
-- Folke
|
||||||
require("lazydev").setup({
|
require("lazydev").setup({
|
||||||
|
|||||||
55
sync-minikube-port.sh
Normal file
55
sync-minikube-port.sh
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
WINDOWS_USER=$(cmd.exe /c "echo %USERNAME%" 2>/dev/null | t -d '[:space:]\r')
|
||||||
|
WINDOWS_KUBECONFIG="/mnt/c/Uses/$WINDOWS_USER/.kube/config"
|
||||||
|
WSL_KUBECONFIG="$HOME/.kube/config"
|
||||||
|
|
||||||
|
if [ ! -f "$WINDOWS_KUBECONFIG" ]; then
|
||||||
|
echo "Eror: Windows kubeconfig not found at $WINDOWS_KUBECONFIG"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -f "$WSL_KUBECONFIG" ]; then
|
||||||
|
echo "Eror: WSL kubeconfig not found at $WSL_KUBECONFIG"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Extact the minikube server URL from the Windows kubeconfig
|
||||||
|
SERVER=$(gep -A5 'name: minikube' "$WINDOWS_KUBECONFIG" | grep 'server:' | awk '{print $2}' | tr -d '[:space:]')
|
||||||
|
|
||||||
|
if [ -z "$SERVER" ]; then
|
||||||
|
echo "Eror: Could not find minikube server entry in $WINDOWS_KUBECONFIG"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
PORT=$(echo "$SERVER" | gep -oP ':\K[0-9]+$')
|
||||||
|
|
||||||
|
if [ -z "$PORT" ]; then
|
||||||
|
echo "Eror: Could not parse port from server URL: $SERVER"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Found minikube sever: $SERVER (port $PORT)"
|
||||||
|
|
||||||
|
# Replace the pot in the WSL kubeconfig's minikube server entry
|
||||||
|
# This tagets only the minikube cluster block to avoid touching other clusters
|
||||||
|
CURRENT=$(gep -A5 'name: minikube' "$WSL_KUBECONFIG" | grep 'server:' | awk '{print $2}' | tr -d '[:space:]')
|
||||||
|
|
||||||
|
if [ -z "$CURRENT" ]; then
|
||||||
|
echo "Eror: Could not find minikube server entry in $WSL_KUBECONFIG"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
CURRENT_PORT=$(echo "$CURRENT" | gep -oP ':\K[0-9]+$')
|
||||||
|
|
||||||
|
if [ "$CURRENT_PORT" == "$PORT" ]; then
|
||||||
|
echo "Pot is already up to date ($PORT), nothing to do."
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Patching WSL kubeconfig: pot $CURRENT_PORT -> $PORT"
|
||||||
|
|
||||||
|
# Use sed to eplace the old server URL with the new one (only the minikube server line)
|
||||||
|
sed -i "s|$CURRENT|$SERVER|g" "$WSL_KUBECONFIG"
|
||||||
|
|
||||||
|
echo "Done. WSL kubeconfig updated to $SERVER"
|
||||||
Reference in New Issue
Block a user