Skip to content

Commit 8ef1f89

Browse files
docs: notification service configuration (#219)
* docs: notification service * fixup! docs: notification service * docs: add explanation of makefile * fixup! docs: add explanation of makefile * Update doc-site/docs/components/kubernetes/notification-service.md Co-authored-by: Bill Monkman <[email protected]> * Update doc-site/docs/components/makefile.md Co-authored-by: Bill Monkman <[email protected]> * fixup! Update doc-site/docs/components/makefile.md * Update doc-site/docs/components/makefile.md Co-authored-by: Bill Monkman <[email protected]> * fixup! Update doc-site/docs/components/makefile.md Co-authored-by: Bill Monkman <[email protected]>
1 parent b50abfa commit 8ef1f89

File tree

2 files changed

+69
-2
lines changed

2 files changed

+69
-2
lines changed

doc-site/docs/components/kubernetes/notification-service.md

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ sidebar_label: Notification service
44
sidebar_position: 5
55
---
66

7-
# Overview
7+
## Overview
88
[Zero notification service][zero-notification-service] is a helm-chart ready service to let you send transactional notifications to multiple platforms via API:
99
- email
1010
- sendgrid
@@ -13,8 +13,24 @@ sidebar_position: 5
1313
- SMS capabilities
1414
- twillio
1515

16+
## REST API
17+
The API is defined using OpenAPI 3.0 and you can explore the service details by
18+
- viewing the [API specs yaml file][notification-api-specs] or
19+
- with compatible tools such as [Swagger Editor][browse-api-spec]
20+
21+
## Configuring
22+
By default, Zero uses Helm to bundle the service, you just need to enable it and provide necessary API keys for any services you want to use for notifications and it will work out of the box.
23+
24+
### Available values
25+
[See the Helm chart][notification-available-values] for all the available configuration options. In the `application` section you can set up your API keys and application-related parameters.
26+
27+
### Setting up API keys
28+
Zero will create a Kubernetes secret containing the API keys and mounted the secret to the deployment using values from `zero-project.yml`.
1629

1730
[See Documentation][notification-service-config] on how to configure service with environment variables
1831

1932
[zero-notification-service]: https://github.com/commitdev/zero-notification-service
20-
[notification-service-config]: https://github.com/commitdev/zero-notification-service/#configuration
33+
[notification-service-config]: https://github.com/commitdev/zero-notification-service/#configuration
34+
[notification-api-specs]: https://github.com/commitdev/zero-notification-service/blob/main/api/notification-service.yaml
35+
[notification-available-values]: https://github.com/commitdev/zero-notification-service/blob/main/charts/zero-notifcation-service/values.yaml
36+
[browse-api-spec]: https://editor.swagger.io/?url=https%3A%2F%2Fraw.githubusercontent.com%2Fcommitdev%2Fzero-notification-service%2Fmain%2Fapi%2Fnotification-service.yaml
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
---
2+
title: Explaining the Makefile in your repository
3+
sidebar_label: Makefile Lifecycle
4+
sidebar_position: 2
5+
---
6+
7+
## Overview
8+
The [Makefile] shipped with your repository drives the creation of your infrastructure, it defines the order of execution in its `apply` make target.
9+
10+
The [Makefile] is idempotent by design, meaning when it runs it will attempt to reach the same final state every time. Therefore if the script determines a resource has previously been created it will skip the creation when run again, meaning `make apply` can be re-run from inside your project after the initial setup when you ran `zero apply`. You may want to use one of the specific targets below though. For example, if you made a change to your staging infrastructure Terraform you could just run `make apply-env`.
11+
12+
See more about the [Terraform workflow guide][terraform-workflow] how to manage your infrastructure as code.
13+
14+
## Targets Explained
15+
Some of the steps are used for initializing the infrastructure, and some steps can also be used for updating and maintaining the infrastructure.
16+
17+
All the targets can be run with the environment variable `ENVIRONMENT=<prod|stage>` to target the corresponding environment, which defaults to `stage`
18+
19+
## Helpful targets for day-to-day use
20+
21+
### `apply-shared-env`
22+
Runs `terraform apply` in your `terraform/environments/shared` directory. This terraform is responsible for resources shared between both staging/production. For example, IAM users and groups.
23+
### `apply-env`
24+
Runs `terraform apply` in your `terraform/environments/<env>` directory. This terraform represents the infrastructure resources in your AWS account: VPC, S3 buckets, EKS cluster, RDS database, etc.
25+
### `apply-k8s-utils`
26+
Runs `terraform apply` in your `kubernetes/terraform/environments/<env>` directory. This terraform represents the resources in your Kubernetes cluster, such as `cert-manager`, `external-dns`, Wireguard VPN, Nginx Ingress Controller, and other tools inside your cluster.
27+
### `update-k8s-conf`
28+
This updates your Kubernetes config by assuming the IAM role `admin-role`, allowing you to connect to your cluster using `kubectl` with administrator access. You can also assume other roles by providing the `ROLE` environment variable. Other default roles created are `developer` and `operator`.
29+
30+
## Others
31+
The rest of the targets are mostly used for one-time operations, either for setup or teardown. The teardown commands are mostly for testing, as they will destroy your infrastructure, so be careful not to run them by accident.
32+
33+
### `apply-remote-state`
34+
Sets up up your Terraform remote backend in an S3 bucket. All the other Terraform uses the remote backend to store their state files. The makefile will only run this step once per environment.
35+
36+
### `apply-secrets`
37+
One-time setup of secrets for infrastructure. This make target also removes the local terraform state immediately after running. The makefile will only run this step once per environment.
38+
39+
### `pre-k8s`
40+
Scripts to create resources required for subsequent steps. For example: creating a VPN private key, a database user, and JWKS keys for the user auth components.
41+
42+
### `post-apply-setup`
43+
Scripts to create resources required for subsequent steps, for example creating a database user for your application and setting up the dev environment.
44+
45+
### `teardown*`
46+
Mostly for development and testing, the teardown process follows a specific order, the reverse of how the resources were created. Much of it is non-reversible. Please see your repository's [Teardown] section for more information
47+
48+
49+
[makefile]: https://github.com/commitdev/zero-aws-eks-stack/blob/main/templates/Makefile
50+
[teardown]: https://github.com/commitdev/zero-aws-eks-stack/tree/main/templates#teardown
51+
[terraform-workflow]: ../guides/managing-terraform#managing-your-terraform

0 commit comments

Comments
 (0)