Giter Club home page Giter Club logo

scw-microservice-tf's Introduction

Project structure

curl 'https://api-marketplace.scaleway.com/images?arch=x86_64'  | jq -r '.images[].name'

git clone https://github.com/xjantoth/scw-microservice-tf

main.tf
variables.tf
outputs.tf
terraform.scw.tfvars (optional - personal preference)
modules/
conf/
 tree -L 2
.
├── conf
│   ├── cloudinit.sh
│   ├── common.sh
│   ├── exdata.py
│   ├── __init__.py
│   ├── __pycache__
│   ├── setup_master.sh
│   └── setup_worker.sh
├── main.tf
├── modules
│   ├── k8s_master
│   ├── k8s_worker
│   └── security_group
├── outputs.tf
├── README.md
├── terraform.scw.tfvars
├── terraform.scw.tfvars.sample
├── terraform.tfstate
├── terraform.tfstate.backup
└── variables.tf

6 directories, 14 files

How to run terraform code with -var-file option

terraform fmt -recursive
terraform validate
terraform plan  -var-file=terraform.scw.tfvars 
terraform apply  -var-file=terraform.scw.tfvars 
terraform destroy  -var-file=terraform.scw.tfvars 
TF_LOG=debug terraform plan  -var-file=terraform.scw.tfvars

Create terraform.scw.tfvars

scw_token             = "..."
scw_access_key        = "..."
scw_organization      = "..."
scw_zone              = "fr-par-1"
scw_region            = "fr-par"
operating_system      = "CentOS 7.6"
instance_type         = "DEV1-S"
cloudinit_script_name = "cloudinit.sh"
master_script_initial = "setup_master.sh"
worker_script_initial = "setup_worker.sh"
worker                = "worker-1"
master                = "master-1"
worker_enabled        = "true"
master_enabled        = "true"
allowed_tcp_ports     = ["30111", "30222", "30333", "30444", "22", "6443", "10250", "10251", "10252", "6783", "6784", "2379", "2380"]
allowed_udp_ports     = ["6783"]

Install scaleway-cli

yay -Ss scaleway-cli
yay -S terraform-docs
sudo pip install pre-commit

Setup pre-hooks

cat <<EOF > .pre-commit-config.yaml
- repo: git://github.com/antonbabenko/pre-commit-terraform
  rev: v1.18.0
  hooks:
    - id: terraform_fmt
    - id: terraform_docs
EOF

pre-commit install
pre-commit run -a

scw-microservice-tf's People

Contributors

xjantoth avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.