Skip to content

Commit

Permalink
Added chart for coroot-aws-agent
Browse files Browse the repository at this point in the history
  • Loading branch information
apetruhin committed Nov 3, 2022
1 parent 8d02f14 commit 0cf52fe
Show file tree
Hide file tree
Showing 5 changed files with 179 additions and 0 deletions.
23 changes: 23 additions & 0 deletions charts/aws-agent/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
6 changes: 6 additions & 0 deletions charts/aws-agent/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apiVersion: v2
name: aws-agent
description: A prometheus exporter that gathers metrics from AWS services.
type: application
version: 0.1.0
appVersion: "1.1.0"
51 changes: 51 additions & 0 deletions charts/aws-agent/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "aws-agent.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "aws-agent.fullname" -}}
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- $name := default .Chart.Name .Values.nameOverride }}
{{- if contains $name .Release.Name }}
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- end }}
{{- end }}

{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "aws-agent.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Common labels
*/}}
{{- define "aws-agent.labels" -}}
helm.sh/chart: {{ include "aws-agent.chart" . }}
{{ include "aws-agent.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}

{{/*
Selector labels
*/}}
{{- define "aws-agent.selectorLabels" -}}
app.kubernetes.io/name: {{ include "aws-agent.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}
62 changes: 62 additions & 0 deletions charts/aws-agent/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "aws-agent.fullname" . }}
labels:
{{- include "aws-agent.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
{{- include "aws-agent.selectorLabels" . | nindent 6 }}
template:
metadata:
annotations:
prometheus.io/scrape: 'true'
prometheus.io/port: '80'
{{- with .Values.podAnnotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "aws-agent.selectorLabels" . | nindent 8 }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if .Values.serviceAccountName }}
serviceAccountName: {{ .Values.serviceAccountName }}
{{- end }}
containers:
- name: {{ .Chart.Name }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
env:
- name: AWS_REGION
value: {{ .Values.aws.region }}
- name: AWS_ACCESS_KEY_ID
value: {{ .Values.aws.key }}
- name: AWS_SECRET_ACCESS_KEY
value: {{ .Values.aws.secret }}
- name: RDS_DB_USER
value: {{ .Values.rds.user }}
- name: RDS_DB_PASSWORD
value: {{ .Values.rds.password }}
ports:
- name: http
containerPort: 80
protocol: TCP
resources:
{{- toYaml .Values.resources | nindent 12 }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
37 changes: 37 additions & 0 deletions charts/aws-agent/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
aws:
region: ""
key: ""
secret: ""

rds:
user: ""
password: ""

serviceAccountName: ""

replicaCount: 1

image:
repository: ghcr.io/coroot/coroot-aws-agent
pullPolicy: IfNotPresent
tag: ""

imagePullSecrets: []
nameOverride: ""
fullnameOverride: ""

podAnnotations: {}

resources: {}
# limits:
# cpu: 100m
# memory: 128Mi
# requests:
# cpu: 100m
# memory: 128Mi

nodeSelector: {}

tolerations: []

affinity: {}

0 comments on commit 0cf52fe

Please sign in to comment.