Skip to content

Commit

Permalink
helm: add support for tyk gw integration secrets
Browse files Browse the repository at this point in the history
  • Loading branch information
monrax committed Apr 23, 2024
1 parent c96bba5 commit f85e617
Show file tree
Hide file tree
Showing 8 changed files with 46 additions and 5 deletions.
6 changes: 3 additions & 3 deletions helm/resurfaceio/resurface/Chart.lock
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
dependencies:
- name: kubernetes-ingress
repository: https://haproxytech.github.io/helm-charts
version: 1.39.0
version: 1.39.1
- name: minio
repository: https://charts.min.io/
version: 5.1.0
digest: sha256:acc67b65875a514955328f073cb441a9522e35be09734cb6e94fde36f460967e
generated: "2024-04-05T10:59:06.973943-04:00"
digest: sha256:f2448f23b1faabbfdaf7fe371015dc02405b8e9edfaefb630057958bc387bc51
generated: "2024-04-23T11:32:00.138045-04:00"
2 changes: 1 addition & 1 deletion helm/resurfaceio/resurface/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ keywords:
home: https://resurface.io
dependencies:
- name: kubernetes-ingress
version: "1.39.0"
version: "1.39.1"
repository: https://haproxytech.github.io/helm-charts
condition: ingress.controller.enabled
- name: minio
Expand Down
6 changes: 6 additions & 0 deletions helm/resurfaceio/resurface/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,12 @@ External integrations can be configured in the **integrations** section.
- **integrations.axway.orgID**: string. Axway tenant identifier. Required only if **integrations.axway.secretName** is not set.
- **integrations.axway.secretName**: string. Name of an already existing Kubernetes Secret containing the three required fields (clientID, clientSecret, and OrgID). Required only if at least one of the **integrations.axway.clientID**, **integrations.axway.clientID**, or **integrations.axway.clientID** values is missing.

- The **integrations.tyk** subsection corresponds to the Tyk Gateway integration.
- **integrations.tyk.enabled**: If set to `true`, Tyk Gateway polling will be enabled. Defaults to `false`.
- **integrations.tyk.url**: string. URL to access Tyk Gateway. Required only if **integrations.tyk.secretName** is not set.
- **integrations.tyk.authSecret**: string. Shared secret parameter for Tyk Gateway configuration. Required only if **integrations.tyk.secretName** is not set.
- **integrations.tyk.secretName**: string. Name of an already existing Kubernetes Secret containing the two required fields (url and authSecret). Required only if at least one of **integrations.tyk.url** or **integrations.tyk.authSecret** values is missing.

The **custom** section holds the values for fields that can be overridden in any default configuration. None of its fields are required. The following fields can be found nested in this section:

- The **custom.service** subsection is where the configuration for both the internal service resources can be found.
Expand Down
Binary file not shown.
Binary file not shown.
19 changes: 19 additions & 0 deletions helm/resurfaceio/resurface/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,13 @@ Container resources and persistent volumes
{{- end -}}
{{- end -}}
{{- $axwaySecret := .Values.integrations.axway.secretName | default "resurface-axway-creds" -}}
{{/* Tyk Gateway */}}
{{- if .Values.integrations.tyk.enabled -}}
{{- if and .Values.integrations.tyk.url .Values.integrations.tyk.authSecret | or .Values.integrations.tyk.secretName | not -}}
{{- fail "Tyk integration is enabled. Please set both 'url' and 'authSecret', or set 'secretName' if kubernetes secret has been created separatedly." -}}
{{- end -}}
{{- end -}}
{{- $tykGWSecret := .Values.integrations.tyk.secretName | default "resurface-tyk-gw-creds" -}}


{{- /* Defaults for container resources */ -}}
Expand Down Expand Up @@ -267,6 +274,18 @@ Container resources and persistent volumes
name: {{ $axwaySecret }}
key: orgID
{{- end }}
{{- if .Values.integrations.tyk.enabled }}
- name: TYK_GW_URL
valueFrom:
secretKeyRef:
name: {{ $tykGWSecret }}
key: url
- name: TYK_GW_SECRET
valueFrom:
secretKeyRef:
name: {{ $tykGWSecret }}
key: authSecret
{{- end }}
volumeClaimTemplates:
- metadata:
name: {{ include "resurface.fullname" . }}-pvc
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,15 @@ data:
clientID: {{ .Values.integrations.axway.clientID | toString | b64enc }}
clientSecret: {{ .Values.integrations.axway.clientSecret | toString | b64enc }}
orgID: {{ .Values.integrations.axway.orgID | toString | b64enc }}
{{- end }}
{{- end }}
---
{{- if empty .Values.integrations.tyk.secretName | and .Values.integrations.tyk.enabled }}
apiVersion: v1
kind: Secret
metadata:
name: resurface-tyk-gw-creds
type: Opaque
data:
url: {{ .Values.integrations.tyk.url | toString | b64enc }}
authSecret: {{ .Values.integrations.tyk.authSecret | toString | b64enc }}
{{- end }}
5 changes: 5 additions & 0 deletions helm/resurfaceio/resurface/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,11 @@ integrations:
clientID:
clientSecret:
orgID:
tyk:
enabled: false
secretName:
url:
authSecret:

custom:
service:
Expand Down

0 comments on commit f85e617

Please sign in to comment.