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

Annotate ServiceAccount in Helm chart and add commented-out examples in values.yaml #1912

Merged
merged 2 commits into from
Oct 25, 2024
Merged
Changes from 1 commit
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
73 changes: 73 additions & 0 deletions content/docs/02.installation/05.kubernetes-gcp-gke.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,29 @@ helm repo add kestra https://helm.kestra.io/
helm install my-kestra kestra/kestra
```

**Workload Identity Setup(Optional)**
jayg2309 marked this conversation as resolved.
Show resolved Hide resolved

If you are using Google Cloud Workload Identity, you can annotate your Kubernetes service account in the Helm chart configuration. This will allow Kestra to automatically use the associated GCP service account for authentication.
Copy link
Member

Choose a reason for hiding this comment

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

Did you test that this works? if so, can you add a couple of screenshots?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I haven't tested it since GKE is not free.

Copy link
Member

Choose a reason for hiding this comment

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

no worries


To configure this, you can add the following to your "values.yaml" file:
```yaml
serviceAccount:
create: true
name: <your-service-account-name>
annotations:
iam.gke.io/gcp-service-account: "<gcp-service-account>@<gcp-project-id>.iam.gserviceaccount.com"

```

Alternatively, you can apply the annotation directly when you install Kestra using Helm:

```shell
helm install my-kestra kestra/kestra \
--set serviceAccount.annotations.iam.gke.io/gcp-service-account=<gcp-service-account>@<gcp-project-id>.iam.gserviceaccount.com
```

This configuration links your Kubernetes service account to the GCP service account, enabling Workload Identity for secure access to Google Cloud resources.

## Launch CloudSQL

1. Go to the [Cloud SQL console](https://console.cloud.google.com/sql/instances).
Expand Down Expand Up @@ -191,6 +214,56 @@ tasks:
message: User {{ inputs.file }}
```

## Commented-out Examples in values.yaml
To provide users with clear guidance on configuring the values.yaml file, we have included some commented-out examples in the configuration. These examples can be used to set up various aspects of Kestra, such as secrets, database configurations, and other key parameters. You can uncomment and modify them as needed.

Here’s an example of how you can define secrets and other configurations in the values.yaml file:

```yaml
# Example configuration for secrets:
configuration:
kestra:
# Configure this section to set secrets for your Kestra instance.
# secret:
# - name: "MY_SECRET_KEY"
# value: "my-secret-value"
# - name: "ANOTHER_SECRET"
# valueFrom:
# secretKeyRef:
# name: "my-k8s-secret"
# key: "my-secret-key"

# Configure this section to use PostgreSQL as the queue and repository backend.
# queue:
# type: postgres
# repository:
# type: postgres

# Example of connecting to a PostgreSQL database:
# datasources:
# postgres:
# url: jdbc:postgresql://<your-db-endpoint>:5432/<db-name>
# driverClassName: org.postgresql.Driver
# username: <your-username>
# password: <your-password>

# Example to disable default services like MinIO and PostgreSQL if you're using external services:
minio:
# enabled: false
postgresql:
# enabled: false
```

In this example:

-**Secrets**: You can configure sensitive values as secrets, either hardcoding them or referencing existing Kubernetes secrets.
-**Queue and Repository**: By default, these can use PostgreSQL or any other supported type. Uncomment the relevant lines to use them.
-**PostgreSQL Configuration**: Set the datasources section to provide details for connecting to a PostgreSQL database.
-**Disabling Services**: If you're using external services like CloudSQL or Google Cloud Storage, you can disable the built-in services (MinIO and PostgreSQL).


Feel free to uncomment and modify these examples based on your setup needs. This provides flexibility while keeping your values.yaml well-structured.

## Next steps

This guide walked you through installing Kestra to [Google GKE](https://cloud.google.com/kubernetes-engine/docs) with CloudSQL as database and Google Cloud Storage as storage backend.
Expand Down