Skip to content

Commit

Permalink
add kind and k8s steps (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
nolte authored Jan 23, 2024
1 parent 4ae268f commit 1727c77
Show file tree
Hide file tree
Showing 7 changed files with 85 additions and 4 deletions.
20 changes: 17 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,36 @@

<!--intro-start-->
Collection of reusable [Taskfile](https://github.com/go-task/task).

* [mkdocs](), for local usage and generate the docs
* [kind](), for control local development cluster
* [pre-commit](), for local linting
* [k8s](), for base commands useful for bootstrapping


<!--intro-end-->

## Usage

<!--usage-start-->
Include this task collection into your [Taskfile](https://taskfile.dev/experiments/remote-taskfiles/)

```yaml
version: '3'

vars:
TASK_COLLECTION_BASE: https://raw.githubusercontent.com/nolte/taskfiles/feature/k8s-tasks/src

includes:
mkdocs: https://raw.githubusercontent.com/nolte/taskfiles/develop/src/taskfile-include-mkdocs.yaml
...
mkdocs: "{{.TASK_COLLECTION_BASE}}/taskfile-include-mkdocs.yaml"
pre-commit: "{{.TASK_COLLECTION_BASE}}/taskfile-include-pre-commit.yaml"
...
...
```

<!--usage-end-->

## Links

<!--links-start-->
* [nolte/workstation](https://github.com/nolte/workstation), for configure our Workstation.
<!--links-end-->
11 changes: 11 additions & 0 deletions Taskfile.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
version: '3'

includes:
mkdocs: ./src/taskfile-include-mkdocs.yaml

tasks:
default:
cmds:
- task -l
silent: true
6 changes: 6 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,9 @@
start="<!--intro-start-->"
end="<!--intro-end-->"
%}

{%
include-markdown "../README.md"
start="<!--usage-start-->"
end="<!--usage-end-->"
%}
23 changes: 23 additions & 0 deletions src/taskfile-include-k8s.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# https://taskfile.dev

version: '3'

vars:
ARGOCD_EXTRA_ARGS: ""

tasks:
bootstrap:
desc: bootstrap minimal set of k8s services
dir: '{{.USER_WORKING_DIR}}'
cmds:
- task: install-argocd

install-argocd:
desc: Install ArgoCD into Cluster
dir: '{{.USER_WORKING_DIR}}'
cmds:
- |
kubectl create namespace argocd | true
helm repo add argo https://argoproj.github.io/argo-helm
helm repo update
helm template argocd argo/argo-cd {{.ARGOCD_EXTRA_ARGS}} --namespace=argocd | kubectl apply -n argocd -f -
25 changes: 25 additions & 0 deletions src/taskfile-include-kind.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# https://taskfile.dev

version: '3'

tasks:
start:
desc: kind create cluster
dir: '{{.USER_WORKING_DIR}}'
cmds:
- |
kind create cluster
destroy:
desc: kind delete cluster
dir: '{{.USER_WORKING_DIR}}'
cmds:
- |
kind delete cluster
recreate:
desc: recreate cluster
dir: '{{.USER_WORKING_DIR}}'
cmds:
- task: destroy
- task: start
3 changes: 2 additions & 1 deletion src/taskfile-include-mkdocs.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# https://taskfile.dev

---
version: '3'

vars:
PYTHON_VENVS_BASEDIR: ~/.venvs/
PYTHON_VENV_DIR: "{{.PYTHON_VENVS_BASEDIR}}/docs"

tasks:
Expand Down
1 change: 1 addition & 0 deletions src/taskfile-include-pre-commit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
version: '3'

vars:
PYTHON_VENVS_BASEDIR: ~/.venvs/
PYTHON_VENV_DIR: "{{.PYTHON_VENVS_BASEDIR}}/development"

tasks:
Expand Down

0 comments on commit 1727c77

Please sign in to comment.