-
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.
Merge pull request #12 from kloudlite/feat/google-cloud
Feat/google cloud
- Loading branch information
Showing
46 changed files
with
2,449 additions
and
41 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
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
121 changes: 121 additions & 0 deletions
121
infrastructure-as-code/examples-infra/gcp/masters-and-workers/.terraform.lock.hcl
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
58 changes: 58 additions & 0 deletions
58
infrastructure-as-code/examples-infra/gcp/masters-and-workers/Taskfile.yml
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,58 @@ | ||
version: 3 | ||
|
||
dotenv: | ||
- .secrets/env | ||
|
||
vars: | ||
Varsfile: ".secrets/varfile.json" | ||
|
||
tasks: | ||
sync-from-template: | ||
vars: | ||
InfrastructureTemplate: ../../../infrastructure-templates/gcp/master-and-worker-nodes | ||
env: | ||
SHELL: bash | ||
silent: true | ||
cmds: | ||
- chmod -f 600 ./*.tf | true | ||
- cp {{.InfrastructureTemplate}}/*.tf ./ | ||
- chmod 400 ./*.tf | ||
- echo "sync complete" | ||
|
||
init: | ||
cmds: | ||
- terraform init | ||
silent: true | ||
|
||
plan: | ||
dir: ./ | ||
vars: | ||
PlanOutput: ".secrets/plan.out" | ||
cmds: | ||
- cat ./varfile.template.yml | envsubst | yq > {{.Varsfile}} | ||
- terraform plan --var-file "{{.Varsfile}}" --out "{{.PlanOutput}}" | ||
|
||
apply: | ||
dir: ./ | ||
dotenv: | ||
- .secrets/env | ||
vars: | ||
PlanOutput: ".secrets/plan.out" | ||
cmds: | ||
- terraform apply "{{.PlanOutput}}" | ||
|
||
validate: | ||
dir: ./ | ||
cmds: | ||
- terraform validate -var-file={{.Varsfile}} | ||
|
||
destroy: | ||
dir: ./ | ||
dotenv: | ||
- .secrets/env | ||
vars: | ||
PlanOutput: ".secrets/plan.destroy.out" | ||
cmds: | ||
- cat ./varfile.template.yml | envsubst | yq > {{.Varsfile}} | ||
- terraform plan --var-file={{.Varsfile}} --destroy --out "{{.PlanOutput}}" | ||
- terraform apply "{{.PlanOutput}}" |
23 changes: 23 additions & 0 deletions
23
infrastructure-as-code/examples-infra/gcp/masters-and-workers/helm/longhorn-sc.yml
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,23 @@ | ||
--- | ||
apiVersion: storage.k8s.io/v1 | ||
kind: StorageClass | ||
metadata: | ||
name: sc-ext4 | ||
parameters: | ||
fsType: ext4 | ||
numberOfReplicas: "2" | ||
provisioner: driver.longhorn.io | ||
reclaimPolicy: Delete | ||
volumeBindingMode: WaitForFirstConsumer | ||
--- | ||
apiVersion: storage.k8s.io/v1 | ||
kind: StorageClass | ||
metadata: | ||
name: sc-xfs | ||
parameters: | ||
fsType: xfs | ||
numberOfReplicas: "2" | ||
provisioner: driver.longhorn.io | ||
reclaimPolicy: Delete | ||
volumeBindingMode: WaitForFirstConsumer | ||
|
21 changes: 21 additions & 0 deletions
21
infrastructure-as-code/examples-infra/gcp/masters-and-workers/helm/longhorn.sh
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,21 @@ | ||
#! /usr/bin/env bash | ||
|
||
cmd=$1 | ||
shift; | ||
|
||
case $cmd in | ||
install) | ||
helm repo add longhorn https://charts.longhorn.io | ||
helm repo update longhorn | ||
|
||
kubectl create namespace longhorn-system | ||
helm upgrade --install longhorn longhorn/longhorn --namespace longhorn-system -f ./values.yml | ||
# kubectl apply -f https://raw.githubusercontent.com/longhorn/longhorn/v1.5.1/deploy/longhorn.yaml | ||
;; | ||
uninstall) | ||
helm uninstall longhorn --namespace longhorn-system | ||
;; | ||
*) | ||
echo "invalid cmd ($cmd)" && exit 1 | ||
;; | ||
esac |
Oops, something went wrong.