Skip to content

Commit 593db3e

Browse files
authored
Initial commit
0 parents  commit 593db3e

File tree

185 files changed

+6107
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

185 files changed

+6107
-0
lines changed

.devcontainer/ci/Dockerfile

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Ref: https://github.com/devcontainers/ci/issues/191
2+
FROM mcr.microsoft.com/devcontainers/base:alpine

.devcontainer/ci/devcontainer.json

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"$schema": "https://raw.githubusercontent.com/devcontainers/spec/main/schemas/devContainer.schema.json",
3+
"name": "Flux Cluster Template (CI)",
4+
"build": {
5+
"dockerfile": "./Dockerfile",
6+
"context": "."
7+
},
8+
"features": {
9+
"./features": {}
10+
},
11+
"customizations": {
12+
"vscode": {
13+
"settings": {
14+
"terminal.integrated.profiles.linux": {
15+
"bash": {
16+
"path": "/usr/bin/fish"
17+
}
18+
},
19+
"terminal.integrated.defaultProfile.linux": "fish"
20+
},
21+
"extensions": [
22+
"redhat.ansible",
23+
"redhat.vscode-yaml"
24+
]
25+
}
26+
}
27+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"name": "Flux Cluster Template (Tools)",
3+
"id": "cluster-template",
4+
"version": "1.0.0",
5+
"description": "Install Tools"
6+
}

.devcontainer/ci/features/install.sh

+79
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
#!/usr/bin/env bash
2+
set -e
3+
set -o noglob
4+
5+
apk add --no-cache \
6+
bash bind-tools ca-certificates curl python3 \
7+
py3-pip moreutils jq git iputils openssh-client \
8+
starship fzf fish
9+
10+
apk add --no-cache \
11+
--repository=https://dl-cdn.alpinelinux.org/alpine/edge/community \
12+
age helm kubectl sops
13+
14+
sudo apk add --no-cache \
15+
--repository=https://dl-cdn.alpinelinux.org/alpine/edge/testing \
16+
lsd
17+
18+
for app in \
19+
"budimanjojo/talhelper!" \
20+
"cilium/cilium-cli!!?as=cilium&type=script" \
21+
"cli/cli!!?as=gh&type=script" \
22+
"cloudflare/cloudflared!!?as=cloudflared&type=script" \
23+
"derailed/k9s!!?as=k9s&type=script" \
24+
"direnv/direnv!!?as=direnv&type=script" \
25+
"fluxcd/flux2!!?as=flux&type=script" \
26+
"go-task/task!!?as=task&type=script" \
27+
"helmfile/helmfile!!?as=helmfile&type=script" \
28+
"kubecolor/kubecolor!!?as=kubecolor&type=script" \
29+
"kubernetes-sigs/krew!!?as=krew&type=script" \
30+
"kubernetes-sigs/kustomize!!?as=kustomize&type=script" \
31+
"stern/stern!!?as=stern&type=script" \
32+
"siderolabs/talos!!?as=talosctl&type=script" \
33+
"yannh/kubeconform!!?as=kubeconform&type=script" \
34+
"mikefarah/yq!!?as=yq&type=script"
35+
do
36+
echo "=== Installing ${app} ==="
37+
curl -fsSL "https://i.jpillora.com/${app}" | bash
38+
done
39+
40+
# Create the fish configuration directory
41+
mkdir -p /home/vscode/.config/fish/{completions,conf.d}
42+
43+
# Setup autocompletions for fish
44+
for tool in cilium flux helm helmfile k9s kubectl kustomize talhelper talosctl; do
45+
$tool completion fish > /home/vscode/.config/fish/completions/$tool.fish
46+
done
47+
gh completion --shell fish > /home/vscode/.config/fish/completions/gh.fish
48+
stern --completion fish > /home/vscode/.config/fish/completions/stern.fish
49+
yq shell-completion fish > /home/vscode/.config/fish/completions/yq.fish
50+
51+
# Add hooks into fish
52+
tee /home/vscode/.config/fish/conf.d/hooks.fish > /dev/null <<EOF
53+
if status is-interactive
54+
direnv hook fish | source
55+
starship init fish | source
56+
end
57+
EOF
58+
59+
# Add aliases into fish
60+
tee /home/vscode/.config/fish/conf.d/aliases.fish > /dev/null <<EOF
61+
alias ls lsd
62+
alias kubectl kubecolor
63+
alias k kubectl
64+
EOF
65+
66+
# Custom fish prompt
67+
tee /home/vscode/.config/fish/conf.d/fish_greeting.fish > /dev/null <<EOF
68+
set fish_greeting
69+
EOF
70+
71+
# Add direnv whitelist for the workspace directory
72+
mkdir -p /home/vscode/.config/direnv
73+
tee /home/vscode/.config/direnv/direnv.toml > /dev/null <<EOF
74+
[whitelist]
75+
prefix = [ "/workspaces" ]
76+
EOF
77+
78+
# Set ownership vscode .config directory to the vscode user
79+
chown -R vscode:vscode /home/vscode/.config

.devcontainer/devcontainer.json

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"$schema": "https://raw.githubusercontent.com/devcontainers/spec/main/schemas/devContainer.schema.json",
3+
"name": "Flux Cluster Template",
4+
"image": "ghcr.io/onedr0p/cluster-template/devcontainer:base",
5+
"postCreateCommand": {
6+
"setup": "bash ${containerWorkspaceFolder}/.devcontainer/postCreateCommand.sh"
7+
},
8+
"postStartCommand": {
9+
"git": "git config --global --add safe.directory ${containerWorkspaceFolder}"
10+
}
11+
}

.devcontainer/postCreateCommand.sh

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/usr/bin/env bash
2+
set -e
3+
set -o noglob
4+
5+
# Setup fisher plugin manager for fish and install plugins
6+
/usr/bin/fish -c "
7+
curl -sL https://git.io/fisher | source && fisher install jorgebucaran/fisher
8+
fisher install decors/fish-colored-man
9+
fisher install edc/bass
10+
fisher install jorgebucaran/autopair.fish
11+
fisher install nickeb96/puffer-fish
12+
fisher install PatrickF1/fzf.fish
13+
"
14+
15+
# Create/update virtual environment
16+
if ! grep -q "venv /workspaces/" .venv/pyvenv.cfg; then
17+
rm -rf .venv
18+
fi
19+
task workstation:venv

.editorconfig

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# editorconfig.org
2+
root = true
3+
4+
[*]
5+
indent_style = space
6+
indent_size = 2
7+
end_of_line = lf
8+
charset = utf-8
9+
trim_trailing_whitespace = true
10+
insert_final_newline = true
11+
12+
[*.{bash,py,sh}]
13+
indent_style = space
14+
indent_size = 4

.envrc

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#shellcheck disable=SC2148,SC2155
2+
export KUBECONFIG="$(expand_path ./kubeconfig)"
3+
export SOPS_AGE_KEY_FILE="$(expand_path ./age.key)"
4+
# Venv
5+
PATH_add "$(expand_path ./.venv/bin)"
6+
export VIRTUAL_ENV="$(expand_path ./.venv)"
7+
export PYTHONDONTWRITEBYTECODE="1"
8+
# Ann Seabelle
9+
export ANSIBLE_COLLECTIONS_PATH=$(expand_path ./.venv/galaxy)
10+
export ANSIBLE_ROLES_PATH=$(expand_path ./.venv/galaxy/ansible_roles)
11+
export ANSIBLE_VARS_ENABLED="host_group_vars"
12+
export ANSIBLE_LOCALHOST_WARNING="False"
13+
export ANSIBLE_INVENTORY_UNPARSED_WARNING="False"
14+
export K8S_AUTH_KUBECONFIG="$(expand_path ./kubeconfig)"
15+
# Talos
16+
export TALOSCONFIG="$(expand_path ./kubernetes/bootstrap/talos/clusterconfig/talosconfig)"
17+
# Bin
18+
PATH_add "$(expand_path ./.bin)"

.gitattributes

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
* text=auto eol=lf
2+
*.yaml.j2 linguist-language=YAML
3+
*.sops.* diff=sopsdiffer

.github/labeler.yaml

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
area/ansible:
3+
- changed-files:
4+
- any-glob-to-any-file: ansible/**/*
5+
area/bootstrap:
6+
- changed-files:
7+
- any-glob-to-any-file: bootstrap/**/*
8+
area/github:
9+
- changed-files:
10+
- any-glob-to-any-file: .github/**/*
11+
area/kubernetes:
12+
- changed-files:
13+
- any-glob-to-any-file: kubernetes/**/*
14+
area/taskfile:
15+
- changed-files:
16+
- any-glob-to-any-file: .taskfiles/**/*
17+
- any-glob-to-any-file: Taskfile*

.github/labels.yaml

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
# Area
3+
- { name: "area/ansible", color: "0e8a16" }
4+
- { name: "area/bootstrap", color: "0e8a16" }
5+
- { name: "area/github", color: "0e8a16" }
6+
- { name: "area/kubernetes", color: "0e8a16" }
7+
- { name: "area/taskfile", color: "0e8a16" }
8+
# Distro
9+
- { name: "distro/k3s", color: "ffc300" }
10+
- { name: "distro/talos", color: "ffc300" }
11+
# Renovate
12+
- { name: "renovate/ansible", color: "027fa0" }
13+
- { name: "renovate/container", color: "027fa0" }
14+
- { name: "renovate/github-action", color: "027fa0" }
15+
- { name: "renovate/github-release", color: "027fa0" }
16+
- { name: "renovate/helm", color: "027fa0" }
17+
# Semantic Type
18+
- { name: "type/patch", color: "ffec19" }
19+
- { name: "type/minor", color: "ff9800" }
20+
- { name: "type/major", color: "f6412d" }
21+
- { name: "type/break", color: "f6412d" }
22+
# Uncategorized
23+
- { name: "hold/upstream", color: "ee0701" }

.github/release.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
changelog:
2+
exclude:
3+
authors:
4+
- renovate

0 commit comments

Comments
 (0)