Skip to content

Commit fb298ec

Browse files
authored
chore: added s3 and rds charts (#291)
* fix: auto mode file path * update version in chart.yaml * updated schema.json * aws-s3 and aws-rds charts * changed chart version * fix: tempo in namespace
1 parent c42f62b commit fb298ec

File tree

23 files changed

+755
-32
lines changed

23 files changed

+755
-32
lines changed

charts/aws-rds-server/Chart.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
apiVersion: v2
2+
appVersion: 0.0.1
3+
description: Helm chart to create AWS RDS Database
4+
name: aws-rds
5+
type: application
6+
version: 0.0.1
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
RDS DB will be created soon!
Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
{{/*
2+
Expand the name of the chart.
3+
*/}}
4+
{{- define "terraform.name" -}}
5+
{{- default .Release.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
6+
{{- end }}
7+
8+
{{/*
9+
Create a default fully qualified app name.
10+
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
11+
If release name contains chart name it will be used as a full name.
12+
*/}}
13+
{{- define "terraform.fullname" -}}
14+
{{- if .Values.fullnameOverride }}
15+
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
16+
{{- else }}
17+
{{- $name := default .Chart.Name .Values.nameOverride }}
18+
{{- if contains $name .Release.Name }}
19+
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
20+
{{- else }}
21+
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
22+
{{- end }}
23+
{{- end }}
24+
{{- end }}
25+
26+
{{/*
27+
Create chart name and version as used by the chart label.
28+
*/}}
29+
{{- define "terraform.chart" -}}
30+
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
31+
{{- end }}
32+
33+
{{/*
34+
Common labels
35+
*/}}
36+
{{- define "terraform.labels" -}}
37+
helm.sh/chart: {{ include "terraform.chart" . }}
38+
{{ include "terraform.selectorLabels" . }}
39+
{{- if .Chart.AppVersion }}
40+
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
41+
{{- end }}
42+
app.kubernetes.io/managed-by: {{ .Release.Service }}
43+
{{- end }}
44+
45+
{{/*
46+
Selector labels
47+
*/}}
48+
{{- define "terraform.selectorLabels" -}}
49+
app.kubernetes.io/name: {{ include "terraform.name" . }}
50+
app.kubernetes.io/instance: {{ .Release.Name }}
51+
{{- end }}
52+
53+
{{/*
54+
Create the name of the service account to use
55+
*/}}
56+
{{- define "terraform.serviceAccountName" -}}
57+
{{- if .Values.serviceAccount.create }}
58+
{{- default (include "terraform.fullname" .) .Values.serviceAccount.name }}
59+
{{- else }}
60+
{{- default "default" .Values.serviceAccount.name }}
61+
{{- end }}
62+
{{- end }}
63+
64+
{{/* vim: set filetype=mustache: */}}
65+
{{/*
66+
Expand the name of the chart.
67+
*/}}
68+
{{- define ".Chart.Name .name" -}}
69+
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
70+
{{- end -}}
71+
72+
{{/*
73+
Create a default fully qualified app name.
74+
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
75+
If release name contains chart name it will be used as a full name.
76+
*/}}
77+
{{- define ".Chart.Name .fullname" -}}
78+
{{- if .Values.fullnameOverride -}}
79+
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
80+
{{- else -}}
81+
{{- $name := default .Chart.Name .Values.nameOverride -}}
82+
{{- if contains $name .Release.Name -}}
83+
{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
84+
{{- else -}}
85+
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
86+
{{- end -}}
87+
{{- end -}}
88+
{{- end -}}
89+
90+
{{/*
91+
Create chart name and version as used by the chart label.
92+
*/}}
93+
{{- define ".Chart.Name .chart" -}}
94+
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
95+
{{- end -}}
96+
97+
{{- define ".Chart.Name .color" -}}
98+
{{- $active0 := (index .Values.server.deployment 0).enabled -}}
99+
{{/*
100+
{{- $active1 := (index .Values.server.deployment 1).enabled -}}
101+
*/}}
102+
{{- $active1 := include "safeenabledcheck" . -}}
103+
{{- $active := and $active0 $active1 -}}
104+
{{- $active -}}
105+
{{- end -}}
106+
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
apiVersion: source.toolkit.fluxcd.io/v1
2+
kind: GitRepository
3+
metadata:
4+
name: {{ $.Release.Name }}
5+
namespace: {{ $.Release.Namespace }}
6+
spec:
7+
interval: 30s
8+
ref:
9+
branch: main
10+
timeout: 61s
11+
url: https://github.com/devtron-labs/utilities.git
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
apiVersion: v1
2+
kind: Secret
3+
metadata:
4+
name: tf-aws-creds
5+
namespace: {{ $.Release.Namespace }}
6+
type: Opaque
7+
data:
8+
AWS_ACCESS_KEY_ID: {{ .Values.awsCredentials.accessKeyId | b64enc }}
9+
AWS_SECRET_ACCESS_KEY: {{ .Values.awsCredentials.secretAccessKey | b64enc }}
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
apiVersion: infra.contrib.fluxcd.io/v1alpha2
2+
kind: Terraform
3+
metadata:
4+
name: {{ $.Release.Name }}
5+
namespace: {{ $.Release.Namespace }}
6+
spec:
7+
path: {{ default "./terraform/aws-rds" .Values.path }}
8+
approvePlan: {{ default "auto" .Values.approvePlan }}
9+
interval: 1m
10+
storeReadablePlan: human
11+
enableInventory: true
12+
destroyResourcesOnDeletion: {{ default false .Values.destroyResourcesOnDeletion }}
13+
alwaysCleanupRunnerPod: {{ default false .Values.alwaysCleanupRunnerPod }}
14+
force: {{ default false .Values.force }}
15+
sourceRef:
16+
kind: GitRepository
17+
name: {{ $.Release.Name }}
18+
namespace: {{ $.Release.Namespace }}
19+
writeOutputsToSecret:
20+
name: {{ $.Release.Name }}-outputs
21+
vars:
22+
- name: db_identifier
23+
value: {{ .Values.db_identifier | quote }}
24+
- name: engine
25+
value: {{ .Values.engine | quote }}
26+
- name: engine_version
27+
value: {{ .Values.engine_version | quote }}
28+
- name: instance_class
29+
value: {{ .Values.instance_class | quote }}
30+
- name: allocated_storage
31+
value: {{ .Values.allocated_storage }}
32+
- name: db_name
33+
value: {{ .Values.db_name | quote }}
34+
- name: username
35+
value: {{ .Values.username | quote }}
36+
- name: password
37+
value: {{ .Values.password | quote }}
38+
- name: multi_az
39+
value: {{ .Values.multi_az }}
40+
- name: publicly_accessible
41+
value: {{ .Values.publicly_accessible }}
42+
- name: subnet_ids
43+
value:
44+
{{ toYaml .Values.subnet_ids | nindent 6 }}
45+
- name: vpc_id
46+
value: {{ .Values.vpc_id | quote }}
47+
- name: tags
48+
value:
49+
{{ toYaml .Values.tags | nindent 8 }}
50+
runnerPodTemplate:
51+
spec:
52+
{{- if $.Values.affinity }}
53+
affinity:
54+
{{ toYaml .Values.affinity.values | indent 8 }}
55+
{{- end }}
56+
{{- if .Values.tolerations }}
57+
tolerations:
58+
{{ toYaml .Values.tolerations | indent 8 }}
59+
{{- end }}
60+
envFrom:
61+
- secretRef:
62+
name: tf-aws-creds
Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
{
2+
"type": "object",
3+
"required": [
4+
"db_identifier",
5+
"engine",
6+
"engine_version",
7+
"instance_class",
8+
"allocated_storage",
9+
"db_name",
10+
"username",
11+
"password",
12+
"multi_az",
13+
"publicly_accessible",
14+
"subnet_ids",
15+
"vpc_id",
16+
"tags",
17+
"awsCredentials"
18+
],
19+
"properties": {
20+
"db_identifier": {
21+
"type": "string",
22+
"title": "Database Identifier",
23+
"description": "The unique name for the RDS instance"
24+
},
25+
"engine": {
26+
"type": "string",
27+
"enum": ["postgres", "mysql", "mariadb", "oracle-se2", "sqlserver-se"],
28+
"title": "Database Engine",
29+
"description": "The database engine to use"
30+
},
31+
"engine_version": {
32+
"type": "string",
33+
"title": "Engine Version",
34+
"description": "The version of the selected database engine"
35+
},
36+
"instance_class": {
37+
"type": "string",
38+
"title": "Instance Class",
39+
"description": "RDS instance class (e.g., db.t3.micro)"
40+
},
41+
"allocated_storage": {
42+
"type": "integer",
43+
"title": "Allocated Storage (GB)",
44+
"description": "The amount of allocated storage in gigabytes"
45+
},
46+
"db_name": {
47+
"type": "string",
48+
"title": "Database Name",
49+
"description": "The name of the initial database created"
50+
},
51+
"username": {
52+
"type": "string",
53+
"title": "Master Username",
54+
"description": "The master username for the database"
55+
},
56+
"password": {
57+
"type": "string",
58+
"title": "Master Password",
59+
"description": "The master password for the database",
60+
"minLength": 8
61+
},
62+
"multi_az": {
63+
"type": "boolean",
64+
"title": "Multi-AZ",
65+
"description": "Enable Multi-AZ deployment for high availability"
66+
},
67+
"publicly_accessible": {
68+
"type": "boolean",
69+
"title": "Publicly Accessible",
70+
"description": "Whether the DB instance is publicly accessible"
71+
},
72+
"subnet_ids": {
73+
"type": "array",
74+
"items": {
75+
"type": "string"
76+
},
77+
"title": "Subnet IDs",
78+
"description": "List of subnet IDs for the DB subnet group"
79+
},
80+
"vpc_id": {
81+
"type": "string",
82+
"title": "VPC ID",
83+
"description": "The VPC ID in which RDS will be launched"
84+
},
85+
"tags": {
86+
"type": "object",
87+
"title": "Tags",
88+
"required": ["Project", "Env", "Team"],
89+
"properties": {
90+
"Project": {
91+
"type": "string"
92+
},
93+
"Env": {
94+
"type": "string"
95+
},
96+
"Team": {
97+
"type": "string"
98+
}
99+
},
100+
"description": "Key-value tags applied to the RDS resources"
101+
},
102+
"awsCredentials": {
103+
"type": "object",
104+
"title": "AWS Credentials",
105+
"required": ["accessKeyId", "secretAccessKey"],
106+
"properties": {
107+
"accessKeyId": {
108+
"type": "string",
109+
"title": "AWS Access Key ID"
110+
},
111+
"secretAccessKey": {
112+
"type": "string",
113+
"title": "AWS Secret Access Key"
114+
}
115+
}
116+
}
117+
}
118+
}

charts/aws-rds-server/values.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
db_identifier: "my-rds-instance"
2+
engine: "postgres"
3+
engine_version: "16.4"
4+
instance_class: "db.t3.micro"
5+
allocated_storage: 20
6+
db_name: "appdb"
7+
username: "postgres"
8+
password: "SuperSecure123!"
9+
multi_az: false
10+
publicly_accessible: false
11+
subnet_ids:
12+
- "subnet-abc123"
13+
- "subnet-def456"
14+
vpc_id: "vpc-xyz789"
15+
16+
tags:
17+
Project: "DevOps"
18+
Env: "Dev"
19+
Team: "backend"
20+
21+
awsCredentials:
22+
accessKeyId: "AKIAIOSFODNN7EXAMPLE"
23+
secretAccessKey: "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"

charts/aws-s3-bucket/Chart.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
apiVersion: v2
2+
appVersion: 0.0.1
3+
description: Helm chart to create AWS S3 buckets
4+
name: aws-s3-bucket
5+
type: application
6+
version: 0.0.1
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
S3 bucket is creating!

0 commit comments

Comments
 (0)