Skip to content

Commit

Permalink
Shared sha
Browse files Browse the repository at this point in the history
  • Loading branch information
mbjtrifork committed Aug 8, 2023
1 parent 8396322 commit 0d83fbb
Show file tree
Hide file tree
Showing 5 changed files with 81 additions and 6 deletions.
72 changes: 72 additions & 0 deletions charts/flink-job/ci/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
imagePullSecrets:
- name: pullsecret-ghcr-io
image:
repository: ghcr.io/trifork/idmappingpoc-flinkjobs
tag: "1.0.4"
storage:
scheme: s3
baseDir: flink
flinkConfiguration:
s3.endpoint: http://minio.minio.svc.cluster.local:9000
s3.path-style-access: "true"
high-availability: org.apache.flink.kubernetes.highavailability.KubernetesHaServicesFactory
high-availability.storageDir: s3://flink/infocode-mapping/ha
kubernetes.jobmanager.cpu.limit-factor: "5.0"
kubernetes.taskmanager.cpu.limit-factor: "5.0"
kubernetes.jobmanager.memory.limit-factor: "2.0"
kubernetes.taskmanager.memory.limit-factor: "2.0"
taskmanager.numberOfTaskSlots: "1"
env:
- name: AWS_ACCESS_KEY
value: vault:secret/data/global/flink/s3/cheetah-flink#accessKey
- name: AWS_SECRET_KEY
value: vault:secret/data/global/flink/s3/cheetah-flink#secretKey
- name: INPUT_KAFKA_CLIENT_ID
value: vault:secret/data/global/guidedtour#kafka-client-id
- name: INPUT_KAFKA_CLIENT_SECRET
value: vault:secret/data/global/guidedtour#kafka-client-secret
- name: INPUT_KAFKA_TOKEN_URL
value: http://oauthsimulator-cheetah-application.oauthsimulator.svc:8000/oauth2/token
- name: OUTPUT_KAFKA_CLIENT_ID
value: vault:secret/data/global/guidedtour#kafka-client-id
- name: OUTPUT_KAFKA_CLIENT_SECRET
value: vault:secret/data/global/guidedtour#kafka-client-secret
- name: OUTPUT_KAFKA_TOKEN_URL
value: http://oauthsimulator-cheetah-application.oauthsimulator.svc:8000/oauth2/token
job:
jarURI: local:///opt/flink/usrlib/artifacts/device-id-mapping-1.0-SNAPSHOT.jar
entryClass: com.trifork.cheetah.job.DeviceIdMapperJob
name: DeviceIdMapperJob
args:
- --input-kafka-bootstrap-servers
- cheetah-kafka-kafka-brokers.kafka:9092
- --output-kafka-bootstrap-servers
- cheetah-kafka-kafka-brokers.kafka:9092
- --input-kafka-group-id
- id-mapping
- --id-service-url
- http://idservice-cheetah-application.idmapping:80/api/v1/idmapping/
state: running
upgradeMode: "stateless"
allowNonRestoredState: false
parallelism: 1
topics:
- arg: input-kafka-topic
name: ExternalIdReadings
type: input
- arg: output-kafka-topic
name: InternalIdReadings
type: output
podAnnotations:
vault.security.banzaicloud.io/vault-role: default
vault.security.banzaicloud.io/vault-tls-secret: vault-tls
jobManager:
replicas: 1
resource:
cpu: 0.1
memory: 1Gb
taskManager:
replicas: 1
resource:
cpu: 0.1
memory: 1Gb
5 changes: 3 additions & 2 deletions charts/flink-job/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -195,18 +195,19 @@ Add necessary ssl configuration
*/}}
{{- define "flink-job.sslConfiguration" -}}
{{- $configs := .configs -}}
{{- $password := sha1sum (toYaml .global) }}
{{- $password := sha1sum (nospace (toString .global.image)) }}
{{- if .global.internalSsl.enabled -}}
{{- $configs = fromJson (include "flink-job._dictSet" (list $configs "security.ssl.internal.enabled" "true")) -}}
{{- $configs = fromJson (include "flink-job._dictSet" (list $configs "security.ssl.internal.keystore" (toString .global.internalSsl.configuration.keystore))) -}}
{{- $configs = fromJson (include "flink-job._dictSet" (list $configs "security.ssl.internal.truststore" (toString .global.internalSsl.configuration.keystore))) -}}
{{- $configs = fromJson (include "flink-job._dictSet" (list $configs "security.ssl.internal.truststore" (toString .global.internalSsl.configuration.truststore))) -}}
{{- $configs = fromJson (include "flink-job._dictSet" (list $configs "security.ssl.internal.keystore-password" (toString $password))) -}}
{{- $configs = fromJson (include "flink-job._dictSet" (list $configs "security.ssl.internal.truststore-password" (toString $password))) -}}
{{- $configs = fromJson (include "flink-job._dictSet" (list $configs "security.ssl.internal.key-password" (toString $password))) -}}
{{- end -}}
{{- $configs | toJson -}}
{{- end -}}


{{/*
Add necessary istio configuration
*/}}
Expand Down
3 changes: 2 additions & 1 deletion charts/flink-job/templates/cert.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@ metadata:
spec:
selfSigned: {}
---
apiVersion: cert-manager.io/v1alpha2
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: {{ printf "%s-mtls-crt" ( include "flink-job.name" . ) | quote }}
spec:
secretName: {{ printf "%s-mtls-secret" ( include "flink-job.name" . ) | quote }}
commonName: {{ printf "%s-mtls-crt" ( include "flink-job.name" . ) | quote }}
issuerRef:
name: {{ printf "%s-mtls-issuer" ( include "flink-job.name" . ) | quote }}
keystores:
Expand Down
2 changes: 1 addition & 1 deletion charts/flink-job/templates/secret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ kind: Secret
metadata:
name: {{ printf "%s-mtls-password" ( include "flink-job.name" . ) | quote }}
stringData:
password: {{ sha1sum (toYaml .Values) | quote }}
password: {{ sha1sum (nospace (toString .Values.image)) }}
{{- end -}}
5 changes: 3 additions & 2 deletions charts/flink-job/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,12 @@ internalSsl:
# -- Set up SSL authentication/encryption using an init-container for creating the certificate
enabled: true
configuration:
keystore: /flinkkeystore/truststore.jks
keystore: /flinkkeystore/keystore.jks
truststore: /flinkkeystore/truststore.jks
podVolumes:
- name: truststore
secret:
secretName: truststore.jks
secretName: "flink-job-mtls-secret"
podVolumeMounts:
- name: truststore
mountPath: /flinkkeystore
Expand Down

0 comments on commit 0d83fbb

Please sign in to comment.