Skip to content

Commit

Permalink
kafka-shared prod: update debugging Makefile & readmes (#154)
Browse files Browse the repository at this point in the history
  • Loading branch information
sbuliarca authored Feb 16, 2024
1 parent 7910307 commit 426be56
Show file tree
Hide file tree
Showing 12 changed files with 18 additions and 3 deletions.
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions dev-aws/kafka-shared/iam/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include ../../lib/kafka-shared/Makefile
1 change: 1 addition & 0 deletions dev-aws/kafka-shared/otel/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include ../../lib/kafka-shared/Makefile
1 change: 1 addition & 0 deletions dev-aws/kafka-shared/pubsub/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include ../../lib/kafka-shared/Makefile
5 changes: 3 additions & 2 deletions lib/kafka-shared/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ KAFKA_CA_CERT := $(shell pwd)/certs-0/ca.crt
KAFKA_CLIENT_KEY := $(shell pwd)/certs-0/tls.key
KAFKA_CLIENT_CERT := $(shell pwd)/certs-0/tls.crt

CONTEXT := $(shell basename $(shell dirname ${PWD}))
SUBPROJECT := $(shell basename ${PWD})
CONTEXT := $(shell basename $(shell dirname $(shell dirname ${PWD})))
ENV := $(shell echo ${CONTEXT} | cut -d"-" -f1)
PROVIDER := $(shell echo ${CONTEXT} | rev | cut -d"-" -f1 | rev)

Expand All @@ -21,7 +22,7 @@ init: certs
terraform init \
-backend-config region=eu-west-1 \
-backend-config bucket=uw-${ENV}-pubsub-tf-applier-state \
-backend-config key="${CONTEXT}"/kafka-shared \
-backend-config key="${CONTEXT}"/kafka-shared-${SUBPROJECT} \
-backend-config encrypt=true \
-reconfigure \
-upgrade
Expand Down
7 changes: 7 additions & 0 deletions prod-aws/kafka-shared/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@ Please follow these guidelines for the resources:
This will make it easier to define access in the kafka-ui ([dev](https://kafka-ui.dev.merit.uw.systems/) and [prod](https://kafka-ui.prod.merit.uw.systems/) )
2. consider the number of partitions for a topic. In Amazon MSK the total number of partitions influences the cost. See [RFC](https://wiki.uw.systems/posts/amazon-msk-managed-kafka-9kjst9t5#h97za-msk)

## Structure
Each child folder contains a Terraform module for a team with the shared kafka resources for that team.

For each of these modules there is a [terraform applier](https://github.com/utilitywarehouse/terraform-applier) entry under:
- [dev](https://github.com/utilitywarehouse/kubernetes-manifests/tree/master/dev-aws/pubsub/kafka)
- [prod](https://github.com/utilitywarehouse/kubernetes-manifests/tree/master/prod-aws/pubsub/kafka)

## pubsub admins: debugging terraform locally

See [instructions](TERRAFORM_LOCALLY.md)
2 changes: 1 addition & 1 deletion prod-aws/kafka-shared/TERRAFORM_LOCALLY.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ source_profile = uw-prod-jump-role
1. Reference AWS profile necessary to perform next actions- <br> `export AWS_PROFILE=pubsub-dev` <br> or <br> `export AWS_PROFILE=pubsub-prod` <br> in each terminal window.
2. Login to AWS- run from the `terraform` repo dir <br> `make okta-aws-cli-login` <br> More
info [here](https://github.com/utilitywarehouse/terraform/tree/master/aws#okta-login)
3. Go to directory with the terraform state- e.g. <br> `cd dev-aws/kafka-shared`
3. Go to directory with the terraform state- e.g. <br> `cd dev-aws/kafka-shared/dev-enablement`
4. Run <br> `make init` <br> to initialize terraform state. This needs to happen only once per directory.
5. In a separate window but in the same directory run <br> `make connect` <br> in order to connect to the Kafka cluster. <br>
6. Run <br> `make plan` <br> to see which changes will be applied.
Expand Down
1 change: 1 addition & 0 deletions prod-aws/kafka-shared/customer-billing/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include ../../lib/kafka-shared/Makefile
1 change: 1 addition & 0 deletions prod-aws/kafka-shared/iam/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include ../../lib/kafka-shared/Makefile
1 change: 1 addition & 0 deletions prod-aws/kafka-shared/otel/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include ../../lib/kafka-shared/Makefile
1 change: 1 addition & 0 deletions prod-aws/kafka-shared/pubsub/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include ../../lib/kafka-shared/Makefile

0 comments on commit 426be56

Please sign in to comment.