Skip to content

Commit

Permalink
Merge pull request #4 from sngular/echobot-0.3.0
Browse files Browse the repository at this point in the history
echobot v0.3.0
  • Loading branch information
enribd committed May 30, 2021
2 parents b693357 + 3d79d4e commit fdfb60c
Show file tree
Hide file tree
Showing 8 changed files with 112 additions and 3 deletions.
18 changes: 18 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
charts_dir = charts
charts = $(shell find ${charts_dir} -mindepth 1 -maxdepth 1 -type d)

.PHONY: pre-commit autodoc

pre-commit: autodoc

autodoc:
@echo "~~~~~[ Autodoc ]~~~~~"
@docker run --rm -u $(shell id -u) -v $(shell pwd):/helm -w /helm jnorwood/helm-docs:v1.5.0 \
--template-files=README.md.gotmpl --chart-search-root=./${charts_dir}

@echo "Generating table of contents for charts..."
@sed -i '/^## Charts/Q' README.md
@echo -e "## Charts\n" >> README.md
@find ./${charts_dir} -name README.md | sed "s/\.\/${charts_dir}\/\(.*\)\/README.md/- [\1](.\/${charts_dir}\/\1\/README.md)/g" >> README.md
@ git add \*README.md

4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# gitops-helmrepository

Helm repository utilizado en los ejercicios de la serie GitOps Flux

## Charts

- [echobot](./charts/echobot/README.md)
4 changes: 2 additions & 2 deletions charts/echobot/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ apiVersion: v2
name: echobot
description: A Helm chart for the echobot service
type: application
version: 0.2.1
appVersion: "v0.1.3"
version: 0.3.1
appVersion: "v0.2.0"
maintainers:
- email: manuel.morejon@users.noreply.github.com
name: mmorejon
Expand Down
49 changes: 49 additions & 0 deletions charts/echobot/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# echobot

![Version: 0.3.1](https://img.shields.io/badge/Version-0.3.1-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v0.2.0](https://img.shields.io/badge/AppVersion-v0.2.0-informational?style=flat-square)

A Helm chart for the echobot service

## Maintainers

| Name | Email | Url |
| ---- | ------ | --- |
| mmorejon | manuel.morejon@users.noreply.github.com | |
| enribd | enrique.benito@users.noreply.github.com | |

## Values

| Key | Type | Default | Description |
|-----|------|---------|-------------|
| affinity | object | `{}` | |
| autoscaling.enabled | bool | `false` | |
| autoscaling.maxReplicas | int | `100` | |
| autoscaling.minReplicas | int | `1` | |
| autoscaling.targetCPUUtilizationPercentage | int | `80` | |
| env | object | `{}` | |
| fullnameOverride | string | `""` | |
| image.pullPolicy | string | `"IfNotPresent"` | |
| image.repository | string | `"ghcr.io/sngular/gitops-echobot"` | |
| image.tag | string | `""` | |
| imagePullSecrets | list | `[]` | |
| livenessProbe.exec.command[0] | string | `"/usr/bin/test"` | |
| livenessProbe.exec.command[1] | string | `"-f"` | |
| livenessProbe.exec.command[2] | string | `"/usr/local/bin/gitops-echobot"` | |
| mongodb | object | `{}` | Configuración de MongoDB. Contiene la clave `existingSecret` con el nombre del secreto a utilizar. Este secreto debe contener la clave `uri` con la cadena de conexión a la base de datos (`mongodb://...`) |
| nameOverride | string | `""` | |
| nodeSelector | object | `{}` | |
| podAnnotations | object | `{}` | |
| podSecurityContext | object | `{}` | |
| readinessProbe.exec.command[0] | string | `"/usr/bin/test"` | |
| readinessProbe.exec.command[1] | string | `"-f"` | |
| readinessProbe.exec.command[2] | string | `"/usr/local/bin/gitops-echobot"` | |
| replicaCount | int | `1` | |
| resources | object | `{}` | |
| securityContext | object | `{}` | |
| serviceAccount.annotations | object | `{}` | |
| serviceAccount.create | bool | `true` | |
| serviceAccount.name | string | `""` | |
| tolerations | list | `[]` | |

----------------------------------------------
Autogenerated from chart metadata using [helm-docs v1.5.0](https://github.com/norwoodj/helm-docs/releases/v1.5.0)
9 changes: 8 additions & 1 deletion charts/echobot/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,14 @@ spec:
imagePullPolicy: {{ .Values.image.pullPolicy }}
{{- with .Values.env }}
env:
{{- toYaml .Values.env | nindent 12 }}
{{- toYaml . | nindent 12 }}
{{- end }}
{{- if .Values.mongodb.existingSecret }}
- name: MONGODB_URI
valueFrom:
secretKeyRef:
name: {{ .Values.mongodb.existingSecret }}
key: uri
{{- end }}
livenessProbe:
{{- toYaml .Values.livenessProbe | nindent 12 }}
Expand Down
25 changes: 25 additions & 0 deletions charts/echobot/templates/tests/test-database.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{{- if .Values.mongodb }}
apiVersion: v1
kind: Pod
metadata:
name: "{{ include "echobot.fullname" . }}-test-mongodb"
labels:
{{- include "echobot.labels" . | nindent 4 }}
annotations:
"helm.sh/hook": test
spec:
containers:
- name: {{ .Release.Name }}-mongodb-test
image: "mongo"
command:
- '/usr/bin/mongo'
args:
- '$MONGODB_URI'
env:
- name: MONGODB_URI
valueFrom:
secretKeyRef:
name: {{ .Values.mongodb.existingSecret }}
key: uri
restartPolicy: Never
{{- end }}
6 changes: 6 additions & 0 deletions charts/echobot/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ env: {}
# - name: VARIABLE_NAME
# value: "Example value"

# -- Configuración de MongoDB. Contiene la clave `existingSecret` con el nombre del
# secreto a utilizar. Este secreto debe contener la clave `uri` con la cadena de conexión
# a la base de datos (`mongodb://...`)
mongodb: {}
# existingSecret: mongodb-uri

serviceAccount:
# Specifies whether a service account should be created
create: true
Expand Down

0 comments on commit fdfb60c

Please sign in to comment.