From 18ebcc55afc31e47f55b03fc5923907783ec8f5e Mon Sep 17 00:00:00 2001 From: vallard Date: Mon, 25 Jul 2022 09:05:08 -0700 Subject: [PATCH] put it all together --- .../live/stage-mon/eks/terragrunt.hcl | 23 ++++++++++++++++++ .../opensearch/terragrunt.hcl | 4 +-- .../{stage-fek => stage-mon}/terragrunt.hcl | 2 +- .../live/stage-mon/vpc/terragrunt.hcl | 17 +++++++++++++ README.md | 12 +++++++++ app-api/app/__pycache__/main.cpython-39.pyc | Bin 1789 -> 1945 bytes app-api/app/main.py | 11 +++++++++ .../routers/__pycache__/auth.cpython-39.pyc | Bin 2348 -> 2463 bytes .../routers/__pycache__/user.cpython-39.pyc | Bin 952 -> 917 bytes app-api/app/routers/auth.py | 19 +++++++++++---- app-api/app/routers/user.py | 5 ++-- app-api/docker-compose.yaml | 7 ++++++ app-api/requirements.txt | 1 + m08-app-logging/README.md | 6 +++++ 14 files changed, 97 insertions(+), 10 deletions(-) create mode 100644 02/terragrunt/live/stage-mon/eks/terragrunt.hcl rename 02/terragrunt/live/{stage-fek => stage-mon}/opensearch/terragrunt.hcl (88%) rename 02/terragrunt/live/{stage-fek => stage-mon}/terragrunt.hcl (90%) create mode 100644 02/terragrunt/live/stage-mon/vpc/terragrunt.hcl create mode 100644 m08-app-logging/README.md diff --git a/02/terragrunt/live/stage-mon/eks/terragrunt.hcl b/02/terragrunt/live/stage-mon/eks/terragrunt.hcl new file mode 100644 index 0000000..da95391 --- /dev/null +++ b/02/terragrunt/live/stage-mon/eks/terragrunt.hcl @@ -0,0 +1,23 @@ +include "root" { + path = find_in_parent_folders() +} + +terraform { + source = "../../../modules//eks" + extra_arguments "common_vars" { + commands = get_terraform_commands_that_need_vars() + required_var_files = ["${get_parent_terragrunt_dir()}/common.tfvars"] + } +} + +dependency "vpc" { + config_path = "../vpc" +} + +inputs = { + public_subnets = dependency.vpc.outputs.vpc.public_subnets + k8s_version = 1.21 + min_nodes = 1 + desired_nodes = 3 + max_nodes = 6 +} diff --git a/02/terragrunt/live/stage-fek/opensearch/terragrunt.hcl b/02/terragrunt/live/stage-mon/opensearch/terragrunt.hcl similarity index 88% rename from 02/terragrunt/live/stage-fek/opensearch/terragrunt.hcl rename to 02/terragrunt/live/stage-mon/opensearch/terragrunt.hcl index 646d4c7..b1d9261 100644 --- a/02/terragrunt/live/stage-fek/opensearch/terragrunt.hcl +++ b/02/terragrunt/live/stage-mon/opensearch/terragrunt.hcl @@ -11,11 +11,11 @@ terraform { } dependency "vpc" { - config_path = "../../../live/stage//vpc" + config_path = "..//vpc" } dependency "eks" { - config_path = "../../../live/stage//eks" + config_path = "..//eks" } inputs = { diff --git a/02/terragrunt/live/stage-fek/terragrunt.hcl b/02/terragrunt/live/stage-mon/terragrunt.hcl similarity index 90% rename from 02/terragrunt/live/stage-fek/terragrunt.hcl rename to 02/terragrunt/live/stage-mon/terragrunt.hcl index 6195e44..6b702cd 100644 --- a/02/terragrunt/live/stage-fek/terragrunt.hcl +++ b/02/terragrunt/live/stage-mon/terragrunt.hcl @@ -6,7 +6,7 @@ remote_state { } config = { bucket = "k8sclass-tf-state" - key = "stage/${path_relative_to_include()}/terraform.tfstate" + key = "stage-mon/${path_relative_to_include()}/terraform.tfstate" region = "us-west-2" encrypt = true } diff --git a/02/terragrunt/live/stage-mon/vpc/terragrunt.hcl b/02/terragrunt/live/stage-mon/vpc/terragrunt.hcl new file mode 100644 index 0000000..77d7d29 --- /dev/null +++ b/02/terragrunt/live/stage-mon/vpc/terragrunt.hcl @@ -0,0 +1,17 @@ +include "root" { + path = find_in_parent_folders() +} + +terraform { + source = "../../../modules//vpc" + extra_arguments "common_vars" { + commands = get_terraform_commands_that_need_vars() + required_var_files = ["${get_parent_terragrunt_dir()}/common.tfvars"] + } +} + +inputs = { + cidr = "10.0.0.0/16" + private_subnets = ["10.0.1.0/24", "10.0.2.0/24", "10.0.3.0/24"] + public_subnets = ["10.0.101.0/24", "10.0.102.0/24", "10.0.103.0/24"] +} diff --git a/README.md b/README.md index 48f22e7..6657b2d 100644 --- a/README.md +++ b/README.md @@ -74,6 +74,18 @@ In this segment we'll go over some Kubernetes primitives. We move fast, show wh * [README](m05/README.md) +### M06 - CloudWatch Alarms + +* [README](m06/README.md) + +### M07 - FEK Stack + +* [README](m07-fek/README.md) + +### M08 - Application Logging + +* [README](m08-app-logging/README.md) + diff --git a/app-api/app/__pycache__/main.cpython-39.pyc b/app-api/app/__pycache__/main.cpython-39.pyc index 4c09714dfdc1f57909363d85eeec43db93f68d87..e13d7c316d5dc5ab988c3daff44d78fe6e041822 100644 GIT binary patch delta 597 zcmZutO>fgc5cSxJah=$4QUVE0Xj5oIsMKruC^o zy8%1LOP}{p!KrX&tKl_3VGT4702JaNYi8BbZQhpN3_Jhf@?X4w&IGWGy~?3-0Nx^5Gm2R_O(m}$saVBp zQX{o}q2hIPGXI^7sZohK)-tAp@J8v}5IgW;0a7brqwV-@82NrM^gXQ~2fOx*HP`LU zxxH@p<$AYu@&lfO?$D2LN8Hoe)&qixD!)kM6%lHu?Q>B&$`n!~W;}>67(Agb~ zP!d1$?!)PR9508##xmuL>3EUM>6JgTrc*u}ximN9sV+InxnTG{5>NHjl?qvTO$ON; lmrq^RLu#yUMYtWZ#~L}3*W#-_U(k!H0fuUVsfjav@iz+Nih=+D delta 448 zcmbQq|Cg69k(ZZ?0SM%Lt|c8|oyaG{=rK`yeSJDZ3g;rmDCtzuESXg9ROuA16z+6J zFy`rHWn@SdT_BsvpCz}D5y}=oVhh6A@+rIv8B_RD_*)p78KV?{y1*i-yeR@e69s#j zQiM{3L2^J@MVM@gNQyi!Sc4K+NEB#*6MhR9oR diff --git a/app-api/app/main.py b/app-api/app/main.py index 29a80db..f93465d 100755 --- a/app-api/app/main.py +++ b/app-api/app/main.py @@ -24,6 +24,17 @@ # END PROMETHEUS (part 5) + +# Fluent (part 8) +from app.lib.app_logging import setup_logging + +setup_logging("api") +import logging + +logger = logging.getLogger("api") +logger.info("HELLO LOGGING!") +# End fluent (part 8) + origins = [ "http://localhost", "http://localhost:3000", diff --git a/app-api/app/routers/__pycache__/auth.cpython-39.pyc b/app-api/app/routers/__pycache__/auth.cpython-39.pyc index ed4be92b87d6bb4c0d2bffb12612af9401eaf75b..b18937cd02a0e82da8709e88b177ae9c2d0d6346 100644 GIT binary patch delta 1324 zcmY*YO>Y}T7~Yxv^!g+INE|zMl1z6{_QgLTjWsU&o6V07YbFyn&ZUaeQrD zz)ie-W)n#KQ-E9NfL!sLAK>;m#4EV-%sU0>I$4=-;O+&u5)yc74WN>`q=i?{ZM=rp zpSenR0~a4#z35MEW%eET1w6_=gI^YcI8FNTOpdbO;eF7|iuM-xCc9%lxhbpj8upIi z*nV!kfENH*$IiTt{r@pg^$fC~?c)bas&DRLBIAViVD1v8Kpv#A5C>C^dyqGcV!Aip zO(sXJN8}*d5rjvhSVSTjP6&=>>Afi1bvhq6a`)+s@I&sKGlPUm!g)s*?jYepaz|kv z7-FWnh&wZv zTtHO^*ugIL&fr%-7XHPfGr(54-= zK2csOf6OJKSW3cDc`v#lcq?Px^-f!hT;t|Z#TaS^#!)iKzW27kAt1Kj9`N74ekDbbmzHVSmaQujpRBc2fD0d-5>V{w!!V;6&w9NRfMdI#Y?u zYbl>HB1dEznlFU oY&q|%z3i``vk6O3`TNSTLpOBlws+~M+Iv}P1u%T2orjnI0B{FW1ONa4 delta 1166 zcmYLIOK&4Z5T5SodDt00$fgTF7`u z6lIB)GVF@7tk6n^bAYR~n&G_Ilr>t*@P^ou+jLvjX+85j(U48r%y2>M$QEs77>PD* zLk&f-D?7Av$L-NQ?y%Bof>`+i(Jlxoq9^z1J~H?|tFp~CrU!s(YzxpK?@s${n^&es z(-Nz*#)ZjUURWd6yhOZ}@o%x6OUzoV{oGz7dXIOn`fT?a-RiizHcl`oH+YA2E={(_ zy3eh33()~X-x!15KYFN-1}H^efiWjMP6G62(#Ow|Kk!4;NdCn~==-EaJ5vqEOHWvm@Bob z9qS}eQLJphDxdsL>UKxNjpQXc=#~IdZyrYRvE)(YPx!!6I=gCW(@)ygm#rOuMy`zr z!g}4# z#2n^c>aKFhXZE*cU8u^+%D%mm{AC}K7LbYUywl95)?5X%SQUUt-9^OJ%$HnslCPaT zsA1{su8KN@12!;k%YRpA>}zxXjd@#ZED=tE*+YO))|Zoqo`~-4m2DC1V$XC<;BM3d z&{}#FjP{NHR-@$U^0``j+b-TRYkL|;&8E| zI7)35F5ptp%3Ot#$ESP|9gju8;aqA)4GR1i^y(x1644h*9VETn7J86;k~{J~2ik=z jmZn0Zn)?HdA~{i;}ZasIVF4t(<;#kCf# diff --git a/app-api/app/routers/__pycache__/user.cpython-39.pyc b/app-api/app/routers/__pycache__/user.cpython-39.pyc index 95213844dc084f21715a3aea958beeb409dda2ec..70186993408c19d6b148bc8d776a9ce7305617cd 100644 GIT binary patch delta 134 zcmdnNK9!v}k(ZZ?0SG47+)3)$$a|4dQV7VaVW?%SVa#FxV#XB4IZVL}noNF^1(}2y znI`KnNid2{c4boG7Xhj)W&!DDVqq+jm|Vrw#27XCFH?!A1W>F<43!X{+{UaZ$jrgW P!wAAWOngjy%sh+$A6^#d delta 226 zcmbQrzJr}Nk(ZZ?0SI2MIG(h6Bkx7VdKn>{rF-Tv}9=npdJwTAW&BrJ%_a#SUV{XQtd@P0dZr%+X}N#ad95nOAa)DKn)= z1ZbotQ;{%`D&hkYD;bK!fz&TiJ^jRj0{x==(vsAoVttSidXsIKcm#!jvc+sbf`N&J uk&CfNa&kCR6XUJPx0p&qC4r(~?MQ^g