Skip to content

Commit

Permalink
whoop
Browse files Browse the repository at this point in the history
  • Loading branch information
nklmilojevic committed Nov 26, 2024
1 parent ef038b8 commit a0a3033
Show file tree
Hide file tree
Showing 27 changed files with 747 additions and 1,263 deletions.
94 changes: 0 additions & 94 deletions .config.sample.env

This file was deleted.

5 changes: 1 addition & 4 deletions .envrc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,4 @@ export ANSIBLE_CONFIG=$(expand_path ./ansible.cfg)
export ANSIBLE_HOST_KEY_CHECKING="False"
export SOPS_AGE_KEY_FILE=$(expand_path ~/.config/sops/age/keys.txt)

uv venv --python 3.11 --allow-existing -q
export VIRTUAL_ENV=.venv
layout python
uv sync -q
use flake
4 changes: 0 additions & 4 deletions .sops.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,3 @@ creation_rules:
key_groups:
- age:
- age1dn0elwr6a32pdjspgz733zgwdmyur98wcmcadhdhkzwudp7g4uuq8ty9ff
- path_regex: terraform/.*\.sops\.ya?ml
key_groups:
- age:
- age1dn0elwr6a32pdjspgz733zgwdmyur98wcmcadhdhkzwudp7g4uuq8ty9ff
35 changes: 35 additions & 0 deletions .taskfiles/flux.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
# yaml-language-server: $schema=https://taskfile.dev/schema.json
version: "3"

tasks:
ks:list:
desc: List all Flux kustomizations
cmds:
- flux get kustomizations

ks:suspend:
desc: Suspend a Flux kustomization
cmds:
- |
if [ -z "{{.CLI_ARGS}}" ]; then
echo "Usage: task flux:ks:suspend -- <kustomization-name>"
echo "Available kustomizations:"
flux get kustomizations --no-header | awk '{print $1}'
exit 1
fi
flux suspend kustomization {{.CLI_ARGS}}
silent: true

ks:resume:
desc: Resume a Flux kustomization
cmds:
- |
if [ -z "{{.CLI_ARGS}}" ]; then
echo "Usage: task flux:ks:resume -- <kustomization-name>"
echo "Available kustomizations:"
flux get kustomizations --no-header | awk '{print $1}'
exit 1
fi
flux resume kustomization {{.CLI_ARGS}}
silent: true
48 changes: 48 additions & 0 deletions .taskfiles/k8s.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
# yaml-language-server: $schema=https://taskfile.dev/schema.json
version: "3"

tasks:
cleanup-pods:
desc: Clean up pods with a Failed/Pending/Succeeded phase
preconditions:
- which kubectl
requires:
cmds:
- for:
matrix:
PHASE:
- Failed
- Pending
- Succeeded
cmd: kubectl delete pods --field-selector status.phase={{.ITEM.PHASE}} -A --ignore-not-found=true

sync-externalsecrets:
desc: Force sync all ExternalSecret resources
preconditions:
- which kubectl
vars:
SECRETS:
sh: kubectl get externalsecret --all-namespaces --no-headers --output=jsonpath='{range .items[*]}{.metadata.namespace},{.metadata.name}{"\n"}{end}'
cmds:
- for:
var: SECRETS
split: "\n"
cmd: kubectl --namespace {{splitList "," .ITEM | first}} annotate externalsecret {{splitList "," .ITEM | last}} force-sync="{{now | unixEpoch}}" --overwrite

sync-externalsecret:
desc: Force sync specific ExternalSecret resource
preconditions:
- which kubectl
cmds:
- |
if [ -z "{{.CLI_ARGS}}" ]; then
echo "Usage: task sync-externalsecret -- <namespace/secret-name>"
echo "Available externalsecrets:"
kubectl get externalsecret --all-namespaces
exit 1
fi
NAMESPACE=$(echo {{.CLI_ARGS}} | cut -d'/' -f1)
SECRET=$(echo {{.CLI_ARGS}} | cut -d'/' -f2)
kubectl -n $NAMESPACE annotate externalsecret $SECRET force-sync="$(date +%s)" --overwrite
silent: true
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@
"editor.guides.highlightActiveBracketPair": true,
"editor.hover.delay": 1500,
"files.trimTrailingWhitespace": true,
"ansible.python.interpreterPath": "/Users/nkl/dev/personal/home/.venv/bin/python",
}
21 changes: 0 additions & 21 deletions LICENSE

This file was deleted.

34 changes: 2 additions & 32 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,40 +19,10 @@ includes:
precommit: .taskfiles/PrecommitTasks.yml
terraform: .taskfiles/TerraformTasks.yml
sops: .taskfiles/SopsTasks.yml
flux: .taskfiles/flux.yaml
k8s: .taskfiles/k8s.yaml

tasks:

init:
desc: Initialize workstation dependencies with Brew
cmds:
- brew install {{.DEPS}} {{.CLI_ARGS}}
preconditions:
- sh: command -v brew
msg: |
Homebrew is not installed. Using MacOS, Linux or WSL?
Head over to https://brew.sh to get up and running.
vars:
DEPS: >-
age
ansible
direnv
fluxcd/tap/flux
go-task/tap/go-task
helm
ipcalc
jq
kubernetes-cli
kustomize
pre-commit
prettier
sops
stern
terraform
tflint
weaveworks/tap/gitops
yamllint
yq
verify:
desc: Verify env settings
cmds:
Expand Down
Loading

0 comments on commit a0a3033

Please sign in to comment.