Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev 335/preview helm changes #2899

Open
wants to merge 7 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions deploy/helm-preview/.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/
30 changes: 30 additions & 0 deletions deploy/helm-preview/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
apiVersion: v2
name: helm
description: A Helm chart for ballerine
Comment on lines +1 to +3
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Chart name should match the directory structure

The chart name helm doesn't match the directory name helm-preview. Consider renaming it to maintain consistency with the directory structure.

-name: helm
+name: helm-preview
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
apiVersion: v2
name: helm
description: A Helm chart for ballerine
apiVersion: v2
name: helm-preview
description: A Helm chart for ballerine


# A chart can be either an 'application' or a 'library' chart.
#
# Application charts are a collection of templates that can be packaged into versioned archives
# to be deployed.
#
# Library charts provide useful utilities or functions for the chart developer. They're included as
# a dependency of application charts to inject those utilities and functions into the rendering
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
type: application

# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.0.1

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "0.4.14"
dependencies:
- condition: postgresql.enabled
name: postgresql
version: 12.0.0
appVersion: 15.0.0
repository: https://charts.bitnami.com/bitnami
102 changes: 102 additions & 0 deletions deploy/helm-preview/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
# Install ballerine using helm chart for Preview Environment

Ballerine is a collection of services like workflow-service, backoffice.
In values.yaml we have sections to enable/disable them based on the necessity like below

```bash
workflowService:
enabled: true
.
.

backoffice:
enabled: true
.
.
headlessexample:
enabled: true
.
.
```

## Prerequisites

- kubernetes cluster
- [helm](https://helm.sh/docs/intro/install/)
- [kubectl](https://storage.googleapis.com/kubernetes-release/release/v1.23.6/bin/linux/amd64/kubectl) preferably 1.24 or less upto 1.23

### How to install

Move to deploy directory

```bash
cd deploy/helm
```

### Setup Postgresql

#### Install postgresql along with ballerine

- edit values.yaml

```bash
## Postgres params
postgresql:
enabled: true
auth:
username: admin
password: admin
postgresPassword: admin
database: postgres
# Local dev purpose
# persistence:
# existingClaim: postgresql-pv-claim
# volumePermissions:
# enabled: true
```
Comment on lines +43 to +56
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Security: Avoid hardcoding credentials in examples

The example shows hardcoded database credentials. This could lead to misuse in production environments.

postgresql:
  enabled: true
  auth:
-    username: admin
-    password: admin
-    postgresPassword: admin
+    username: <your-username>
+    password: <your-secure-password>
+    postgresPassword: <your-postgres-password>
    database: postgres
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
## Postgres params
postgresql:
enabled: true
auth:
username: admin
password: admin
postgresPassword: admin
database: postgres
# Local dev purpose
# persistence:
# existingClaim: postgresql-pv-claim
# volumePermissions:
# enabled: true
```
## Postgres params
postgresql:
enabled: true
auth:
username: <your-username>
password: <your-secure-password>
postgresPassword: <your-postgres-password>
database: postgres
# Local dev purpose
# persistence:
# existingClaim: postgresql-pv-claim
# volumePermissions:
# enabled: true


#### How to use managed postgresql along with ballerine

- edit values.yaml

```bash
## Postgres params
postgresql:
enabled: false
.
.
.
.
applicationConfig:
BCRYPT_SALT: "10"
SESSION_EXPIRATION_IN_MINUTES: "60"
DB_URL: "<Managed DB_URL with databasename>"
DB_USER: "<Managed DB_USER>"
DB_PASSWORD: "<Managed DB_PASSWORD>"
DB_PORT: "5432"
```

### Installing Ballerine helm chart

```bash
helm dep build
helm install ballerine . -n ballerine --create-namespace -f example.values.yaml
```

### Troubleshooting

```bash
kubectl get pods -n ballerine
```

- Note the pod name of service you wish to trouble shoot

```bash
kubectl logs <pod> -n ballerine
```

- Accessing the application

```bash
kubectl port-forward svc/<service> -n ballerine 3000:3000
```
Loading
Loading