Skip to content

Commit d9020bf

Browse files
authored
Merge pull request #12 from gatewayd-io/8-add-configmap
Add ConfigMap for Persistent Plugin File Values
2 parents 450ab23 + e84125b commit d9020bf

16 files changed

+203
-36
lines changed

.github/workflows/helm-test.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
2+
name: Test Action
3+
on:
4+
push:
5+
branches:
6+
- main
7+
tags:
8+
- v*
9+
pull_request:
10+
branches:
11+
- main
12+
13+
jobs:
14+
test:
15+
name: Basic chart test using Minikube
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v4
19+
- name: Start minikube
20+
uses: medyagh/setup-minikube@master
21+
- name: Test whether the cluster is running
22+
run: kubectl get pods -A
23+
- name: Install PostgreSQL
24+
run: helm install psql oci://registry-1.docker.io/bitnamicharts/postgresql --set global.postgresql.auth.postgresPassword=postgres
25+
- name: Check deployment status
26+
run: |
27+
kubectl rollout status --watch statefulset/psql-postgresql --timeout=5m
28+
- name: Wait for PostgreSQL database to start
29+
run: |
30+
for n in [ 0 1 2 3 4 5 6 7 8 9 ]
31+
do
32+
if kubectl logs pod/psql-postgresql-0 | grep 'database system is ready to accept connections'
33+
then
34+
exit 0
35+
fi
36+
sleep 30
37+
done
38+
echo PostgreSQL did not start within 300 seconds!
39+
exit 1
40+
- name: Install gatewayd
41+
run: helm install gatewayd .
42+
- name: Check deployment status
43+
run: |
44+
kubectl rollout status --watch deployment/gatewayd --timeout=5m
45+
- name: Wait for gatewayd to start
46+
run: |
47+
for n in [ 0 1 2 3 4 5 6 7 8 9 ]
48+
do
49+
if kubectl get deployment gatewayd | awk '{print $2}' | grep 1/1
50+
then
51+
exit 0
52+
fi
53+
sleep 30
54+
done
55+
echo gatewayd did not start within 300 seconds!
56+
exit 1
File renamed without changes.
File renamed without changes.

README.md

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,97 @@ We welcome contributions from everyone. Just open an [issue](https://github.com/
99
## License
1010

1111
GatewayD Helm Charts is licensed under the [Apache 2.0 License](https://github.com/gatewayd-io/helm-charts/blob/main/LICENSE).
12+
13+
# GatewayD Community Kubernetes Helm Charts
14+
15+
This Helm charts installs GatewayD on your Kubernetes cluster.
16+
17+
## How to use the charts
18+
19+
1. Clone this repository
20+
2. Install the chart
21+
3. (Optionally) Uninstall the chart
22+
23+
```bash
24+
git clone https://github.com/gatewayd-io/helm-charts.git
25+
cd helm-charts/charts/gatewayd/
26+
helm install gatewayd-release -f values.yaml ./
27+
# helm uninstall gatewayd-release
28+
```
29+
30+
## Configuration for GatewayD Helm Chart
31+
32+
#### Deployment Configuration
33+
34+
| Parameter | Description | Default Value |
35+
|---------------------------------------------|-------------------------------------------------------------------------------------------------------|-----------------------------|
36+
| `autoscaling.enabled` | Determines whether autoscaling is enabled for the deployment. If not enabled, the `replicaCount` value is used to set the number of replicas. | `false` |
37+
| `replicaCount` | The number of replicas to create for the deployment | `1` |
38+
| `podAnnotations` | Annotations to add to the pod | `{}` |
39+
| `podLabels` | Labels to add to the pod | `{}` |
40+
| `imagePullSecrets` | Image pull secrets for the Docker registry | `[]` |
41+
| `serviceAccountName` | The name of the service account to use for the deployment | `""` |
42+
| `podSecurityContext` | Security context for the pod | `{}` |
43+
| `securityContext` | Security context for the container | `{}` |
44+
| `image.repository` | The Docker image repository | `gatewaydio/gatewayd` |
45+
| `image.tag` | The Docker image tag. If not set, the app version from the chart is used | `""` |
46+
| `image.pullPolicy` | The image pull policy | `IfNotPresent` |
47+
| `resources` | Resource requests and limits for the container | `{}` |
48+
| `gatewaydPluginsConfig.enabled` | Determines whether the `gatewayd_plugins.yaml` ConfigMap is mounted to the container. If enabled, a volume and volumeMount are added to the deployment. | `false` |
49+
| `nodeSelector` | Node selector for the pod | `{}` |
50+
| `affinity` | Affinity for the pod | `{}` |
51+
| `tolerations` | Tolerations for the pod | `[]` |
52+
53+
#### Service Configuration
54+
55+
| Parameter | Description | Default Value |
56+
|---------------------------------------------|-------------------------------------------------------------------------------------------------------|-----------------------------|
57+
| `service.port` | The port that the service listens on | `15432` |
58+
| `ingress.enabled` | Determines whether an Ingress resource should be created | `false` |
59+
60+
#### Ingress Configuration
61+
62+
| Parameter | Description | Default Value |
63+
|---------------------------------------------|-------------------------------------------------------------------------------------------------------|-----------------------------|
64+
| `gatewayd.fullname` | The full name of the deployment, used as part of the Ingress resource name | |
65+
| `service.port` | The port that the service listens on, used as the service port in the Ingress rules | |
66+
| `ingress.className` | The Ingress class to assign to the Ingress resource. This is only used for Kubernetes versions less than 1.18. | |
67+
| `ingress.annotations` | Annotations to add to the Ingress resource. If `ingress.className` is set and the Kubernetes version is less than 1.18, the `kubernetes.io/ingress.class` annotation is added with the value of `ingress.className`. | `{}` |
68+
| `Capabilities.KubeVersion.GitVersion` | The Kubernetes version running in the cluster. This is used to determine the API version of the Ingress resource to create. | |
69+
70+
#### Autoscaling Configuration
71+
72+
| Parameter | Description | Default Value |
73+
|---------------------------------------------|-------------------------------------------------------------------------------------------------------|-----------------------------|
74+
| `gatewayd.fullname` | The full name of the deployment, used as the target of the Horizontal Pod Autoscaler. | |
75+
| `autoscaling.minReplicas` | The minimum number of replicas that the Horizontal Pod Autoscaler should maintain | |
76+
| `autoscaling.maxReplicas` | The maximum number of replicas that the Horizontal Pod Autoscaler can scale out to | |
77+
| `autoscaling.targetCPUUtilizationPercentage`| The target percentage of CPU utilization across all replicas that the Horizontal Pod Autoscaler should maintain. If set, a CPU utilization metric is added to the Horizontal Pod Autoscaler. | |
78+
| `autoscaling.targetMemoryUtilizationPercentage`| The target percentage of memory utilization across all replicas that the Horizontal Pod Autoscaler should maintain. If set, a memory utilization metric is added to the Horizontal Pod Autoscaler. | |
79+
80+
#### Service Account Configuration
81+
82+
| Parameter | Description | Default Value |
83+
|---------------------------------------------|-------------------------------------------------------------------------------------------------------|-----------------------------|
84+
| `serviceAccount.create` | Determines whether a ServiceAccount should be created | |
85+
| `gatewayd.serviceAccountName` | The name of the ServiceAccount. This is used as the name of the ServiceAccount resource. | |
86+
| `gatewayd.labels` | The labels to apply to the ServiceAccount. | |
87+
| `serviceAccount.annotations` | Annotations to add to the ServiceAccount. | |
88+
| `serviceAccount.automount` | Determines whether the ServiceAccount token should be automatically mounted to the pods. This is set as the `automountServiceAccountToken` field in the ServiceAccount resource. | |
89+
90+
#### ConfigMap Configuration
91+
92+
| Parameter | Description | Default Value |
93+
|---------------------------------------------|-------------------------------------------------------------------------------------------------------|-----------------------------|
94+
| `gatewayd.fullname` | The full name of the deployment, used as the name of the ConfigMap. | |
95+
| `.Release.Name` | The release name, used as part of the ConfigMap name. | |
96+
| `gatewaydPluginsConfig.content` | The content of the `gatewayd_plugins.yaml` file. This is set as the `gatewayd_plugins.yaml` data in the ConfigMap. | |
97+
98+
99+
## Usage
100+
101+
Modify the [values.yaml](values.yaml) file to customize the deployment according to your requirements. You can override any default values as needed.
102+
103+
## Contributing
104+
105+
Feel free to contribute to the development of this Helm chart by submitting issues or pull requests to the GitHub repository.

charts/gatewayd/README.md

Lines changed: 0 additions & 16 deletions
This file was deleted.
File renamed without changes.
File renamed without changes.
File renamed without changes.

charts/gatewayd/templates/deployment.yaml renamed to templates/deployment.yaml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ spec:
1919
{{- end }}
2020
labels:
2121
{{- include "gatewayd.labels" . | nindent 8 }}
22-
{{- with .Values.podLabels }}
22+
{{- with .Values.podLabels }}
2323
{{- toYaml . | nindent 8 }}
2424
{{- end }}
2525
spec:
@@ -46,13 +46,17 @@ spec:
4646
name: {{ include "gatewayd.fullname" . }}
4747
resources:
4848
{{- toYaml .Values.resources | nindent 12 }}
49-
{{- with .Values.volumeMounts }}
49+
{{- if .Values.gatewaydPluginsConfig.enabled }}
5050
volumeMounts:
51-
{{- toYaml . | nindent 12 }}
51+
- name: config-volume
52+
mountPath: /etc/gatewayd_plugins.yaml
53+
subPath: gatewayd_plugins.yaml
5254
{{- end }}
53-
{{- with .Values.volumes }}
55+
{{- if .Values.gatewaydPluginsConfig.enabled }}
5456
volumes:
55-
{{- toYaml . | nindent 8 }}
57+
- name: config-volume
58+
configMap:
59+
name: {{ .Release.Name }}-gatewayd-plugins-config
5660
{{- end }}
5761
{{- with .Values.nodeSelector }}
5862
nodeSelector:
@@ -65,4 +69,4 @@ spec:
6569
{{- with .Values.tolerations }}
6670
tolerations:
6771
{{- toYaml . | nindent 8 }}
68-
{{- end }}
72+
{{- end }}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{{- if .Values.gatewaydPluginsConfig.enabled }}
2+
apiVersion: v1
3+
kind: ConfigMap
4+
metadata:
5+
name: {{ .Release.Name }}-gatewayd-plugins-config
6+
data:
7+
gatewayd_plugins.yaml: |
8+
{{ .Values.gatewaydPluginsConfig.content | nindent 4 }}
9+
{{- end }}

0 commit comments

Comments
 (0)