- Python 68.1%
- TypeScript 17.6%
- Shell 5.9%
- Smarty 3.5%
- HTML 2.3%
- Other 2.6%
| data | ||
| helm | ||
| .gitignore | ||
| build.sh | ||
| README.md | ||
| README_es.md | ||
| run.sh | ||
Using run.sh
The run.sh script automates the deployment process for a k8s environment using minikube. It includes building docker images, customizing postgres versions, enabling SSL, and configuring replicas for the API.
Requirements
Usage
./run.sh -i # Interactive mode
./run.sh -p <version> -s <Y|N> -r <number> # Non-interactive mode
./run.sh -p <version> -s <Y|N> -r <number> -f # Non-interactive mode with Fluentd enabled
Command Line Options
- -i: Interactive mode
- -p : Specify the
postgresversion - -s <Y|N>: Enable or disable
SSL(Y for yes, N for no) - -r : Specify the number of replicas for the API
- -f: Enable
fluentdfor log aggregation - -u: Uninstall the chart
- -d: Add basic data to the DB
Examples
Changing postgres version
If you want to modify the database version, you can simply do:
./run.sh -p 13.1
This will update everything necessary for this change.
Specifying number of replicas for the API
./run.sh -r 6
Script Functionality
-
Minikube Status Check:
The script checks if
minikubeis already running and starts it if it's not. -
Postgres Version and Build:
It prompts the user for the postgres version, builds
dockerimages, and updates the version in thehelmvalues file. -
TLS Configuration:
It asks the user if they want to enable
TLSand updates thehelmvalues file accordingly. -
Configuring Replicas for the API:
It prompts the user for the number of replicas for the API and updates the
helmvalues file. -
Ingress Configuration:
It enables the ingress extension if
minikubeis running. -
Fluentd Configuration (Optional):
The user is asked whether to enable
fluentdfor log aggregation. This can be toggled directly in thevalues.yamlfile. It's worth noting that, to maintain simplicity and avoid "bloat" invalues.yaml, an additional file namedfluentd.yamlis provided. This file should be passed as a parameter-ftohelmto configurefluentdwith necessary parameters. It's optional, asFluentdcan function without these configurations, but it's recommended due to performing some container startup conditions to wait for thefluentdservice and to collect only logs fromexam-*containers (not all logs fromk8s).The following instruction is used when installing or upgrading
helm:helm install exam ./helm -n exam -f helm/values.yaml -f helm/fluentd.yamlTo view logs from
exam-*containers, you can use:kubectl logs -n exam exam-fluentd-0To configure and send logs to a log backend like
elasticsearch, you can editfluentd.yamlas per your requirements. -
Secrets Configuration (Optional):
To avoid keeping secrets in the SVC (if one is used), they can be passed to
helmvia asecrets.yamlfile with the-foption. If./helm/secrets.yamlexists (in the./helmfolder, i.e., in the same location asvalues.yaml), these values will be used; otherwise, those defined invalues.yamlwill be used. These values will override existing ones.It's worth noting that upon creating
./helm/secrets.yaml, therun.shscript will automatically detect and use it when runninghelm. Therefore, no additional actions are required, as the script will handle the detection and passing of this file tohelm.