Skip to content

Commit

Permalink
Add support to mount secrets to the pods
Browse files Browse the repository at this point in the history
  • Loading branch information
ayeshLK committed Jan 31, 2025
1 parent 01e0a6a commit b039ea2
Show file tree
Hide file tree
Showing 8 changed files with 57 additions and 1 deletion.
2 changes: 1 addition & 1 deletion examples/kafka-hub/helm/hub/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ apiVersion: v2
appVersion: 12.0.0
description: A Helm chart for the deployment of WSO2 Websubhub Hub Deployment
name: hub
version: 0.1.58
version: 0.1.0
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
12 changes: 12 additions & 0 deletions examples/kafka-hub/helm/hub/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,19 @@ spec:
- name: "config-config-map-volume"
mountPath: "/home/ballerina"
readOnly: true
{{- range .Values.deployment.secrets }}
- name: {{ .name }}
mountPath: {{ .mountPath }}
subPath: {{ .subPath }}
readOnly: true
{{- end }}

volumes:
- name: "config-config-map-volume"
configMap:
name: "websubhub-svc-cm"
{{- range .Values.deployment.secrets }}
- name: {{ .name }}
secret:
secretName: {{ .name }}
{{- end }}
26 changes: 26 additions & 0 deletions examples/kafka-hub/helm/hub/templates/secret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Copyright (c) 2025 WSO2 LLC. (http://www.wso2.com).
#
# WSO2 LLC. licenses this file to you under the Apache License,
# Version 2.0 (the "License"); you may not use this file except
# in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

{{- range .Values.deployment.secrets }}
apiVersion: v1
kind: Secret
metadata:
name: {{ .name }}
type: Opaque
data:
{{ .subPath }}: {{ .Files.Get .filePath | b64enc }}
---
{{- end }}
18 changes: 18 additions & 0 deletions examples/kafka-hub/helm/hub/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,30 @@ deployment:
repository: "ayeshalmeida/kafkahub"
pullPolicy: IfNotPresent
tag: 12.0.0
secrets:
- name: hub_keystore
mountPath: "/home/ballerina/resources/hub.keystore.jks"
subPath: "hub.keystore.jks"
filePath: "./_resources/hub-1.keystore.jks"
- name: idp_truststore
mountPath: "/home/ballerina/resources/client-truststore.jks"
subPath: "client-truststore.jks"
filePath: "./_resources/idp/client-truststore.jks"
- name: broker_truststore
mountPath: "/home/ballerina/resources/brokercerts/client-truststore.jks"
subPath: "client-truststore.jks"
filePath: "./_resources/kafka-client/kafka-client.trustStore.jks"
- name: broker_keystore
mountPath: "/home/ballerina/resources/brokercerts/client-truststore.jks"
subPath: "client-keystore.jks"
filePath: "./_resources/kafka-client/kafka-client.keystore.jks"
config:
port: 9000
server_id: "hub-1"
state_snapshot_endpoint: "http://consolidator:10001"
retryable_status_codes: [500, 502, 503]
logLevel: "ERROR"
ssl_keystoreName: "hub.keystore.jks"
idp:
jwt_issuer: "https://localhost:9443/oauth2/token"
jwt_audience: "ballerina"
Expand Down

0 comments on commit b039ea2

Please sign in to comment.