Skip to content

Commit f886f85

Browse files
Feat: 🚀 Reloader, version 1.0.41 (#39)
* Feat: 🚀 Added reloader addon * Feat: 🚀 Added reloader addon * Fix- Fixed the changes in override.yaml and changed the version to 0.1.0 * Fix- Fixed namespace in reloader --------- Co-authored-by: Himanshu Ahirwar <[email protected]>
1 parent 362e016 commit f886f85

19 files changed

+658
-4
lines changed

.github/workflows/readme.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ jobs:
6767
- name: Generate TF Docs
6868
uses: terraform-docs/[email protected]
6969
with:
70-
working-dir: addons/aws-ebs-csi-driver,addons/aws-efs-csi-driver,addons/aws-load-balancer-controller,addons/aws-node-termination-handler,addons/calico-tigera,addons/cluster-autoscaler,addons/external-secrets,addons/fluent-bit,addons/helm,addons/ingress-nginx,addons/istio-ingress,addons/karpenter,addons/kiali-server,addons/kubeclarity,addons/metrics-server,addons/nri-bundle,addons/velero,addons/kube-state-metrics,addons/keda
70+
working-dir: addons/aws-ebs-csi-driver,addons/aws-efs-csi-driver,addons/aws-load-balancer-controller,addons/aws-node-termination-handler,addons/calico-tigera,addons/cluster-autoscaler,addons/external-secrets,addons/fluent-bit,addons/helm,addons/ingress-nginx,addons/istio-ingress,addons/karpenter,addons/kiali-server,addons/kubeclarity,addons/metrics-server,addons/nri-bundle,addons/velero,addons/kube-state-metrics,addons/keda,addons/reloader
7171
git-push: true
7272
template: |-
7373
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
reloader:
2+
deployment:
3+
# If you wish to run multiple replicas set reloader.enableHA = true
4+
affinity:
5+
nodeAffinity:
6+
requiredDuringSchedulingIgnoredDuringExecution:
7+
nodeSelectorTerms:
8+
- matchExpressions:
9+
- key: "eks.amazonaws.com/nodegroup"
10+
operator: In
11+
values:
12+
- "critical"
13+
14+
resources:
15+
limits:
16+
cpu: "100m"
17+
memory: "512Mi"
18+
requests:
19+
cpu: "10m"
20+
memory: "128Mi"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: nginx-deployment
5+
labels:
6+
app: nginx
7+
annotations:
8+
# configmap.reloader.stakater.com/reload: "test-configmap"
9+
# secret.reloader.stakater.com/reload: "test-secret"
10+
reloader.stakater.com/auto: "true"
11+
spec:
12+
replicas: 2
13+
selector:
14+
matchLabels:
15+
app: nginx
16+
template:
17+
metadata:
18+
labels:
19+
app: nginx
20+
spec:
21+
containers:
22+
- name: nginx
23+
image: nginx
24+
ports:
25+
- containerPort: 80
26+
env:
27+
- name: TEST_ENV
28+
valueFrom:
29+
configMapKeyRef:
30+
name: test-configmap
31+
key: test_env
32+
- name: TEST_PASS
33+
valueFrom:
34+
secretKeyRef:
35+
name: test-secret
36+
key: pass

_examples/basic/main.tf

+2-1
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@ module "addons" {
175175
fluent_bit = true
176176
keda = true
177177
certification_manager = true
178+
reloader = true
178179

179180
# -- Addons with mandatory variable
180181
istio_ingress = true
@@ -187,4 +188,4 @@ module "addons" {
187188
bucket_name = "velero-addons"
188189
}
189190

190-
}
191+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
reloader:
2+
deployment:
3+
# If you wish to run multiple replicas set reloader.enableHA = true
4+
affinity:
5+
nodeAffinity:
6+
requiredDuringSchedulingIgnoredDuringExecution:
7+
nodeSelectorTerms:
8+
- matchExpressions:
9+
- key: "eks.amazonaws.com/nodegroup"
10+
operator: In
11+
values:
12+
- "critical"
13+
14+
resources:
15+
limits:
16+
cpu: "100m"
17+
memory: "512Mi"
18+
requests:
19+
cpu: "10m"
20+
memory: "128Mi"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: nginx-deployment
5+
labels:
6+
app: nginx
7+
annotations:
8+
# configmap.reloader.stakater.com/reload: "test-configmap"
9+
# secret.reloader.stakater.com/reload: "test-secret"
10+
reloader.stakater.com/auto: "true"
11+
spec:
12+
replicas: 2
13+
selector:
14+
matchLabels:
15+
app: nginx
16+
template:
17+
metadata:
18+
labels:
19+
app: nginx
20+
spec:
21+
containers:
22+
- name: nginx
23+
image: nginx
24+
ports:
25+
- containerPort: 80
26+
env:
27+
- name: TEST_ENV
28+
valueFrom:
29+
configMapKeyRef:
30+
name: test-configmap
31+
key: test_env
32+
- name: TEST_PASS
33+
valueFrom:
34+
secretKeyRef:
35+
name: test-secret
36+
key: pass

_examples/complete/main.tf

+5
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,8 @@ module "addons" {
169169
keda = true
170170
certification_manager = true
171171
filebeat = true
172+
reloader = true
173+
172174

173175
# -- Addons with mandatory variable
174176
istio_ingress = true
@@ -198,6 +200,7 @@ module "addons" {
198200
keda_helm_config = { values = [file("./config/keda/override-keda.yaml")] }
199201
certification_manager_helm_config = { values = [file("./config/override-certification-manager.yaml")] }
200202
filebeat_helm_config = { values = [file("./config/override-filebeat.yaml")] }
203+
reloader_helm_config = { values = [file("./config/reloader/override-reloader.yaml")] }
201204

202205
# -- Override Helm Release attributes
203206
metrics_server_extra_configs = var.metrics_server_extra_configs
@@ -220,6 +223,8 @@ module "addons" {
220223
certification_manager_extra_configs = var.certification_manager_extra_configs
221224
external_secrets_extra_configs = var.external_secrets_extra_configs
222225
filebeat_extra_configs = var.filebeat_extra_configs
226+
reloader_extra_configs = var.reloader_extra_configs
227+
223228

224229
# -- Custom IAM Policy Json for Addon's ServiceAccount
225230
cluster_autoscaler_iampolicy_json_content = file("./custom-iam-policies/cluster-autoscaler.json")

_examples/complete/variables.tf

+6
Original file line numberDiff line numberDiff line change
@@ -180,4 +180,10 @@ variable "external_secrets_extra_configs" {
180180
variable "filebeat_extra_configs" {
181181
type = any
182182
default = {}
183+
}
184+
185+
# ------------------ RELOADER --------------------------------------------------
186+
variable "reloader_extra_configs" {
187+
type = any
188+
default = {}
183189
}

addons/reloader/README.md

+71
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# Reloader Helm Chart
2+
3+
Reloader manages the following AWS resources
4+
- A Kubernetes controller to watch changes in ConfigMap and Secrets and do rolling upgrades on Pods with their associated Deployment, StatefulSet, DaemonSet and DeploymentConfig
5+
6+
## Installation
7+
Below terraform script shows how to use Reloader Terraform Addon, A complete example is also given [here](https://github.com/clouddrove/terraform-helm-eks-addons/blob/master/_examples/complete/main.tf).
8+
```bash
9+
module "addons" {
10+
source = "clouddrove/eks-addons/aws"
11+
version = "0.1.0"
12+
13+
depends_on = [module.eks]
14+
eks_cluster_name = module.eks.cluster_name
15+
16+
reloader = true
17+
}
18+
```
19+
20+
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
21+
## Requirements
22+
23+
| Name | Version |
24+
|------|---------|
25+
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0.0 |
26+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 3.72 |
27+
| <a name="requirement_kubernetes"></a> [kubernetes](#requirement\_kubernetes) | >= 2.10 |
28+
29+
## Providers
30+
31+
| Name | Version |
32+
|------|---------|
33+
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 3.72 |
34+
| <a name="provider_kubernetes"></a> [kubernetes](#provider\_kubernetes) | >= 2.10 |
35+
36+
## Modules
37+
38+
| Name | Source | Version |
39+
|------|--------|---------|
40+
| <a name="module_helm_addon"></a> [helm\_addon](#module\_helm\_addon) | ../helm | n/a |
41+
42+
## Resources
43+
44+
| Name | Type |
45+
|------|------|
46+
| [aws_iam_policy.policy](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_policy) | resource |
47+
| [kubernetes_namespace_v1.this](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/resources/namespace_v1) | resource |
48+
| [aws_eks_cluster.eks_cluster](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/eks_cluster) | data source |
49+
50+
## Inputs
51+
52+
| Name | Description | Type | Default | Required |
53+
|------|-------------|------|---------|:--------:|
54+
| <a name="input_account_id"></a> [account\_id](#input\_account\_id) | n/a | `string` | `""` | no |
55+
| <a name="input_addon_context"></a> [addon\_context](#input\_addon\_context) | Input configuration for the addon | <pre>object({<br> aws_caller_identity_account_id = string<br> aws_caller_identity_arn = string<br> aws_eks_cluster_endpoint = string<br> aws_partition_id = string<br> aws_region_name = string<br> eks_cluster_id = string<br> eks_oidc_issuer_url = string<br> eks_oidc_provider_arn = string<br> tags = map(string)<br> })</pre> | n/a | yes |
56+
| <a name="input_reloader_extra_configs"></a> [reloader\_extra\_configs](#input\_aws\_load\_balancer\_controller\_extra\_configs) | Override attributes of helm\_release terraform resource | `any` | `{}` | no |
57+
| <a name="input_eks_cluster_name"></a> [eks\_cluster\_name](#input\_eks\_cluster\_name) | n/a | `string` | `""` | no |
58+
| <a name="input_helm_config"></a> [helm\_config](#input\_helm\_config) | Helm provider config for Reloader | `any` | `{}` | no |
59+
| <a name="input_iampolicy_json_content"></a> [iampolicy\_json\_content](#input\_iampolicy\_json\_content) | Custom IAM Policy for Reloader IRSA | `string` | `null` | no |
60+
| <a name="input_manage_via_gitops"></a> [manage\_via\_gitops](#input\_manage\_via\_gitops) | Determines if the add-on should be managed via GitOps | `bool` | `false` | no |
61+
62+
## Outputs
63+
64+
| Name | Description |
65+
|------|-------------|
66+
| <a name="output_chart_version"></a> [chart\_version](#output\_chart\_version) | n/a |
67+
| <a name="output_iam_policy"></a> [iam\_policy](#output\_iam\_policy) | n/a |
68+
| <a name="output_namespace"></a> [namespace](#output\_namespace) | n/a |
69+
| <a name="output_repository"></a> [repository](#output\_repository) | n/a |
70+
| <a name="output_service_account"></a> [service\_account](#output\_service\_account) | n/a |
71+
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->

0 commit comments

Comments
 (0)