initial setup

This commit is contained in:
ari committed 2023-02-18 21:41:57 +00:00
commit 3e4803366b
6 files changed
+153

No files matched your search

+6
View File
@@ -0,0 +1,6 @@
@echo off
REM On Linux/macOS the passed in script will run inside of bash, but on
REM Windows, this will run a batch file with the same script name instead.
%1.cmd
+70
View File
@@ -0,0 +1,70 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/kubernetes-helm
{
"name": "HomeLab",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"image": "mcr.microsoft.com/devcontainers/base:bullseye",
"runArgs": ["--network=host"],
"features": {
"ghcr.io/devcontainers/features/docker-outside-of-docker:1": {
"moby": true,
"version": "latest",
"dockerDashComposeVersion": "v2"
},
"ghcr.io/devcontainers/features/kubectl-helm-minikube:1": {
"version": "latest",
"helm": "latest",
"minikube": "none"
},
"./local-features/tweaks": {},
"ghcr.io/devcontainers/features/common-utils:2": {
"installZsh": true,
"configureZshAsDefaultShell": true,
"installOhMyZsh": true,
"upgradePackages": true,
"username": "vscode",
"userUid": "automatic",
"userGid": "automatic"
},
"ghcr.io/mpriscella/features/helm-chart-testing:1": {
"version": "latest"
},
"ghcr.io/devcontainers-contrib/features/argo-cd:1": {
"version": "latest"
},
"ghcr.io/eitsupi/devcontainer-features/jq-likes:1": {
"jqVersion": "os-provided",
"yqVersion": "latest",
"gojqVersion": "latest"
},
"ghcr.io/dhoeric/features/act:1": {},
"ghcr.io/rio/features/k3d:1": {}
},
// "remoteEnv": {
// "SYNC_LOCALHOST_KUBECONFIG": "true"
// },
// "initializeCommand": "cd .devcontainer && bash ensure-mount-sources",
"mounts": [
{
"source": "${env:HOME}${env:USERPROFILE}/.kube",
"target": "/home/vscode/kube-localhost",
"type": "bind"
},
{
"source": "${env:HOME}${env:USERPROFILE}/.gitconfig",
"target": "/home/vscode/.gitconfig",
"type": "bind"
}
],
"customizations": {
"vscode": {
"extensions": [
"inercia.vscode-k3d",
"tumido.crd-snippets",
"hilleer.yaml-plus-json"
]
}
}
}
@@ -0,0 +1,11 @@
{
"id": "tweaks",
"name": "Additional tweaks to the devcontainer",
"options": {
"username": {
"type": "string",
"default": "",
"description": "Enter name of non-root user to configure or blank to use remoteUser"
}
}
}
@@ -0,0 +1,14 @@
#!/bin/bash
set -e
USERNAME="${USERNAME:-"${_REMOTE_USER}"}"
cat >> /home/${USERNAME}/.zshrc <<- EOM
source <(kubectl completion zsh)
alias k=kubectl
complete -o default -F __start_kubectl k
source <(k3d completion zsh)
source <(helm completion zsh)
EOM
+31
View File
@@ -0,0 +1,31 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "Dev Server - Start",
"type": "shell",
"command": "k3d cluster create -c k3d-default.yaml && docker logs -f k3d-k3s-default-server-0",
"icon": {
"id": "play-circle"
}
},
{
"label": "Dev Server - Logs",
"type": "shell",
"command": "docker logs -f k3d-k3s-default-server-0",
"icon": {
"id": "tree-filter-on-type-off"
}
}
{
"label": "Stop Dev Server",
"type": "shell",
"command": "k3d cluster delete -c k3d-default.yaml",
"icon": {
"id": "stop-circle"
}
}
]
}
+21
View File
@@ -0,0 +1,21 @@
---
apiVersion: k3d.io/v1alpha4
kind: Simple
metadata:
name: k3s-default
servers: 1
agents: 0
image: docker.io/rancher/k3s:v1.25.6-k3s1
kubeAPI:
hostPort: "6443"
ports:
- port: 80:80
nodeFilters:
- loadbalancer
- port: 443:443
nodeFilters:
- loadbalancer
options:
kubeconfig:
updateDefaultKubeconfig: true
switchCurrentContext: true