-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* moved project an setup next IaaS : Contabo * new packer * started CD/CI for packer * use terraform import to recover instance * nginx ingress enabled (traefik still available) * metallb * ready and functionnal waypoint in prod
- Loading branch information
1 parent
5b5337d
commit d09bad8
Showing
90 changed files
with
1,460 additions
and
4,053 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,21 @@ | ||
# EditorConfig is awesome: https://EditorConfig.org | ||
|
||
# top-most EditorConfig file | ||
root = true | ||
|
||
[*] | ||
indent_style = space | ||
indent_size = 4 | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = false | ||
insert_final_newline = false | ||
|
||
[*.{yml,yaml,yml.*,yaml.*}] | ||
indent_size = 2 | ||
|
||
[*.sh] | ||
end_of_line = lf | ||
|
||
[Makefile] | ||
indent_style = tab |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
name: hcp-packer | ||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- 'playbook/**' | ||
- 'packer/**' | ||
- .github/workflows/release-packer.yml | ||
jobs: | ||
gh-release-packer: | ||
runs-on: ubuntu-latest | ||
name: Run Packer | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Setup `packer` | ||
uses: hashicorp/setup-packer@main | ||
id: setup | ||
with: | ||
version: "1.8.6" | ||
|
||
- name: Set outputs | ||
id: vars | ||
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT | ||
|
||
- name: Run `packer init` | ||
id: init | ||
run: "packer init ubuntu.pkr.hcl" | ||
working-directory: packer | ||
env: | ||
PKR_VAR_ssh_password: ${{ secrets.PKR_VAR_SSH_PASSWORD }} | ||
PKR_VAR_ssh_password_hash: ${{ secrets.PKR_VAR_SSH_PASSWORD_HASH }} | ||
|
||
- name: Run `packer validate` | ||
id: validate | ||
run: >- | ||
packer validate \ | ||
-var-file "$(uname -ms | tr ' ' '-')-host.hcl" \ | ||
-var-file=secrets.pkrvars.hcl ubuntu.pkr.hcl | ||
working-directory: packer | ||
env: | ||
PKR_VAR_ssh_password: ${{ secrets.PKR_VAR_SSH_PASSWORD }} | ||
PKR_VAR_ssh_password_hash: ${{ secrets.PKR_VAR_SSH_PASSWORD_HASH }} | ||
|
||
- name: Build Artifact | ||
run: >- | ||
packer build \ | ||
-var-file "$(uname -ms | tr ' ' '-')-host.hcl" \ | ||
ubuntu.pkr.hcl | ||
working-directory: packer | ||
env: | ||
PKR_VAR_ssh_password: ${{ secrets.PKR_VAR_SSH_PASSWORD }} | ||
PKR_VAR_ssh_password_hash: ${{ secrets.PKR_VAR_SSH_PASSWORD_HASH }} | ||
|
||
- uses: "marvinpinto/action-automatic-releases@latest" | ||
with: | ||
repo_token: "${{ secrets.GITHUB_TOKEN }}" | ||
automatic_release_tag: ubuntu-jammy-${{ steps.vars.outputs.sha_short }} | ||
prerelease: true | ||
files: | | ||
packer/.qemu-vm/ubuntu-jammy-22.04.2.qcow2 | ||
packer/.qemu-vm/SHA256SUMS |
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,42 @@ | ||
name: test-packer | ||
on: | ||
pull_request: | ||
paths: | ||
- 'playbook/**' | ||
- 'packer/**' | ||
- .github/workflows/test-packer.yml | ||
jobs: | ||
gh-release-packer: | ||
runs-on: ubuntu-latest | ||
name: Run Packer | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Setup `packer` | ||
uses: hashicorp/setup-packer@main | ||
id: setup | ||
with: | ||
version: "1.8.6" | ||
|
||
- name: Set outputs | ||
id: vars | ||
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT | ||
|
||
- name: Run `packer init` | ||
id: init | ||
run: "packer init ubuntu.pkr.hcl" | ||
working-directory: packer | ||
env: | ||
PKR_VAR_ssh_password: ${{ secrets.PKR_VAR_SSH_PASSWORD }} | ||
PKR_VAR_ssh_password_hash: ${{ secrets.PKR_VAR_SSH_PASSWORD_HASH }} | ||
|
||
- name: Run `packer validate` | ||
id: validate | ||
run: >- | ||
packer validate \ | ||
-var-file "$(uname -ms | tr ' ' '-')-host.hcl" \ | ||
ubuntu.pkr.hcl | ||
working-directory: packer | ||
env: | ||
PKR_VAR_ssh_password: ${{ secrets.PKR_VAR_SSH_PASSWORD }} | ||
PKR_VAR_ssh_password_hash: ${{ secrets.PKR_VAR_SSH_PASSWORD_HASH }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# Paas Tutorial | ||
# K3s PaaS | ||
|
||
[Documentation](https://esgi-lyon.github.io/paas-tutorial) | ||
> Taken From [original tutorial](https://esgi-lyon.github.io/paas-tutorial/) | ||
[Documentation](docs/index.md) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,4 +31,4 @@ override.tf.json | |
|
||
# Ignore CLI configuration files | ||
.terraformrc | ||
terraform.rc | ||
terraform.rc |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,32 @@ | ||
VAR_FILE?=prod.tfvars | ||
SHELL:=/bin/bash | ||
|
||
read_tfvar=$(shell grep $1 prod.tfvars | cut -d'=' -f2 | tr -d ' ' | tr -d \") | ||
|
||
CLIENT_ID:=$(call read_tfvar,oauth2_client_id) | ||
CLIENT_SECRET:=$(call read_tfvar,oauth2_client_secret) | ||
API_USER:=$(call read_tfvar,oauth2_user) | ||
API_PASSWORD:=$(call read_tfvar,oauth2_pass) | ||
INSTANCE_ID:=$(call read_tfvar,contabo_instance) | ||
|
||
.DEFAULT_GOAL := help | ||
|
||
help: | ||
@echo "Contabo tf simple helpers" | ||
@echo "Instance setup $(INSTANCE_ID)" | ||
|
||
setup_cntb: | ||
cntb config set-credentials --oauth2-clientid="$(CLIENT_ID)" \ | ||
--oauth2-client-secret="$(CLIENT_SECRET)" --oauth2-user="$(API_USER)" \ | ||
--oauth2-password="$(API_PASSWORD)" | ||
|
||
destroy: | ||
terraform destroy -var-file=$(VAR_FILE) -auto-approve | ||
|
||
# Run it if starting from empty infra | ||
apply: | ||
terraform import -var-file=$(VAR_FILE) contabo_instance.paas_instance $(INSTANCE_ID) | ||
terraform apply -var-file=$(VAR_FILE) -auto-approve | ||
|
||
read_tfvar: | ||
$(call read_tfvar contabo_instance) |
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
Oops, something went wrong.