generated from onedr0p/cluster-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit d3c395b
Showing
168 changed files
with
4,871 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Ref: https://github.com/devcontainers/ci/issues/191 | ||
FROM mcr.microsoft.com/devcontainers/base:alpine |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"$schema": "https://raw.githubusercontent.com/devcontainers/spec/main/schemas/devContainer.schema.json", | ||
"name": "Flux Cluster Template (CI)", | ||
"build": { | ||
"dockerfile": "./Dockerfile", | ||
"context": "." | ||
}, | ||
"features": { | ||
"./features": {} | ||
}, | ||
"customizations": { | ||
"vscode": { | ||
"settings": { | ||
"terminal.integrated.profiles.linux": { | ||
"bash": { | ||
"path": "/usr/bin/fish" | ||
} | ||
}, | ||
"terminal.integrated.defaultProfile.linux": "fish" | ||
}, | ||
"extensions": [ | ||
"redhat.vscode-yaml" | ||
] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"name": "Cluster Template", | ||
"id": "cluster-template", | ||
"version": "1.0.0", | ||
"description": "Work environment for the Cluster Template project" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
#!/usr/bin/env bash | ||
set -e | ||
set -o noglob | ||
|
||
apk add --no-cache \ | ||
age bash bind-tools ca-certificates curl direnv fish fzf \ | ||
gettext git github-cli helm iputils jq k9s python3 py3-pip \ | ||
moreutils openssh-client openssl starship yq | ||
|
||
apk add --no-cache \ | ||
--repository=https://dl-cdn.alpinelinux.org/alpine/edge/community \ | ||
flux kubectl kustomize go-task sops | ||
|
||
apk add --no-cache \ | ||
--repository=https://dl-cdn.alpinelinux.org/alpine/edge/testing \ | ||
cloudflared cilium-cli helmfile kubeconform kubectl-krew lsd stern | ||
|
||
for app in \ | ||
"budimanjojo/talhelper!!?as=talhelper&type=script" \ | ||
"kubecolor/kubecolor!!?as=kubecolor&type=script" \ | ||
"siderolabs/talos!!?as=talosctl&type=script" | ||
do | ||
echo "=== Installing ${app} ===" | ||
curl -fsSL "https://i.jpillora.com/${app}" | bash | ||
done | ||
|
||
# Create the fish configuration directory | ||
mkdir -p /home/vscode/.config/fish/{completions,conf.d} | ||
|
||
# Setup autocompletions for fish | ||
gh completion --shell fish > /home/vscode/.config/fish/completions/gh.fish | ||
kubectl completion fish > /home/vscode/.config/fish/completions/kubectl.fish | ||
talhelper completion fish > /home/vscode/.config/fish/completions/talhelper.fish | ||
talosctl completion fish > /home/vscode/.config/fish/completions/talosctl.fish | ||
|
||
# Add hooks into fish | ||
tee /home/vscode/.config/fish/conf.d/hooks.fish > /dev/null <<EOF | ||
if status is-interactive | ||
direnv hook fish | source | ||
starship init fish | source | ||
end | ||
EOF | ||
|
||
# Add aliases into fish | ||
tee /home/vscode/.config/fish/conf.d/aliases.fish > /dev/null <<EOF | ||
alias ls lsd | ||
alias kubectl kubecolor | ||
alias k kubectl | ||
alias task go-task | ||
EOF | ||
|
||
# Custom fish prompt | ||
tee /home/vscode/.config/fish/conf.d/fish_greeting.fish > /dev/null <<EOF | ||
set fish_greeting | ||
EOF | ||
|
||
# Add direnv whitelist for the workspace directory | ||
mkdir -p /home/vscode/.config/direnv | ||
tee /home/vscode/.config/direnv/direnv.toml > /dev/null <<EOF | ||
[whitelist] | ||
prefix = [ "/workspaces" ] | ||
EOF | ||
|
||
# Set ownership vscode .config directory to the vscode user | ||
chown -R vscode:vscode /home/vscode/.config |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"$schema": "https://raw.githubusercontent.com/devcontainers/spec/main/schemas/devContainer.schema.json", | ||
"name": "Flux Cluster Template", | ||
"image": "ghcr.io/onedr0p/cluster-template/devcontainer:latest", | ||
"initializeCommand": "docker pull ghcr.io/onedr0p/cluster-template/devcontainer:latest", | ||
"postCreateCommand": { | ||
"setup": "bash ${containerWorkspaceFolder}/.devcontainer/postCreateCommand.sh" | ||
}, | ||
"postStartCommand": { | ||
"git": "git config --global --add safe.directory ${containerWorkspaceFolder}" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/usr/bin/env bash | ||
set -e | ||
set -o noglob | ||
|
||
# Setup fisher plugin manager for fish and install plugins | ||
/usr/bin/fish -c " | ||
curl -sL https://git.io/fisher | source && fisher install jorgebucaran/fisher | ||
fisher install decors/fish-colored-man | ||
fisher install edc/bass | ||
fisher install jorgebucaran/autopair.fish | ||
fisher install nickeb96/puffer-fish | ||
fisher install PatrickF1/fzf.fish | ||
" | ||
|
||
# Create/update virtual environment | ||
if ! grep -q "venv /workspaces/" .venv/pyvenv.cfg; then | ||
rm -rf .venv | ||
fi | ||
task workstation:venv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# editorconfig.org | ||
root = true | ||
|
||
[*] | ||
indent_style = space | ||
indent_size = 2 | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
|
||
[*.{bash,py,sh}] | ||
indent_style = space | ||
indent_size = 4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#shellcheck disable=SC2148,SC2155 | ||
export KUBECONFIG="$(expand_path ./kubeconfig)" | ||
export SOPS_AGE_KEY_FILE="$(expand_path ./age.key)" | ||
# Venv | ||
PATH_add "$(expand_path ./.venv/bin)" | ||
export VIRTUAL_ENV="$(expand_path ./.venv)" | ||
export PYTHONDONTWRITEBYTECODE="1" | ||
# Talos | ||
export TALOSCONFIG="$(expand_path ./kubernetes/bootstrap/talos/clusterconfig/talosconfig)" | ||
# Bin | ||
PATH_add "$(expand_path ./.bin)" | ||
# Taskfile | ||
export TASK_X_ENV_PRECEDENCE=1 | ||
export TASK_X_MAP_VARIABLES=0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
* text=auto eol=lf | ||
*.yaml.j2 linguist-language=YAML | ||
*.sops.* diff=sopsdiffer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- | ||
area/bootstrap: | ||
- changed-files: | ||
- any-glob-to-any-file: bootstrap/**/* | ||
area/github: | ||
- changed-files: | ||
- any-glob-to-any-file: .github/**/* | ||
area/kubernetes: | ||
- changed-files: | ||
- any-glob-to-any-file: kubernetes/**/* | ||
area/taskfile: | ||
- changed-files: | ||
- any-glob-to-any-file: .taskfiles/**/* | ||
- any-glob-to-any-file: Taskfile* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
--- | ||
# Area | ||
- { name: "area/bootstrap", color: "0e8a16" } | ||
- { name: "area/github", color: "0e8a16" } | ||
- { name: "area/kubernetes", color: "0e8a16" } | ||
- { name: "area/taskfile", color: "0e8a16" } | ||
# Distro | ||
- { name: "distro/talos", color: "ffc300" } | ||
# Renovate | ||
- { name: "renovate/container", color: "027fa0" } | ||
- { name: "renovate/github-action", color: "027fa0" } | ||
- { name: "renovate/github-release", color: "027fa0" } | ||
- { name: "renovate/helm", color: "027fa0" } | ||
# Semantic Type | ||
- { name: "type/patch", color: "ffec19" } | ||
- { name: "type/minor", color: "ff9800" } | ||
- { name: "type/major", color: "f6412d" } | ||
- { name: "type/break", color: "f6412d" } | ||
# Uncategorized | ||
- { name: "hold/upstream", color: "ee0701" } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
changelog: | ||
exclude: | ||
authors: | ||
- renovate |
Oops, something went wrong.