Skip to content

Commit

Permalink
Put only secret stuff in ENV
Browse files Browse the repository at this point in the history
  • Loading branch information
itadventurer committed Jun 24, 2024
1 parent b4f6467 commit cb033ff
Show file tree
Hide file tree
Showing 6 changed files with 126 additions and 122 deletions.
40 changes: 22 additions & 18 deletions kubernetes/acls/csp1_consumer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,30 +54,16 @@ spec:
- name: cluster-certs
mountPath: /tls/ca.p12
subPath: ca.p12
- name: config
mountPath: /app/app.properties
subPath: app.properties
env:
# Replace ConfigMap by Environment
- name: KAFKA_BOOTSTRAP_SERVERS
value: kafka-kafka-bootstrap:9093
- name: KAFKA_GROUP_ID
value: csp1-consumer
- name: KAFKA_TOPIC
value: csp1.transactions
- name: KAFKA_CLIENT_ID
value: csp1-consumer
- name: KAFKA_APP_LOG_INFOS
value: "true"
# SSL Configs
- name: KAFKA_SECURITY_PROTOCOL
value: SSL
- name: KAFKA_SSL_KEYSTORE_PASSWORD
valueFrom:
secretKeyRef:
name: csp1-consumer
key: user.password
- name: KAFKA_SSL_KEYSTORE_LOCATION
value: /tls/user.p12
- name: KAFKA_SSL_TRUSTSTORE_LOCATION
value: /tls/ca.p12
- name: KAFKA_SSL_TRUSTSTORE_PASSWORD
valueFrom:
secretKeyRef:
Expand All @@ -89,4 +75,22 @@ spec:
secretName: csp1.consumer
- name: cluster-certs
secret:
secretName: kafka-cluster-ca-cert
secretName: kafka-cluster-ca-cert
- name: config
configMap:
name: csp1-consumer-config
---
apiVersion: v1
kind: ConfigMap
metadata:
name: csp1-consumer-config
data:
app.properties: |
bootstrap.servers=kafka-kafka-bootstrap:9093
topic=csp1.transactions
group.id=csp1_consumer
app.log.infos=true
client.id=csp1_consumer
security.protocol=SSL
ssl.keystore.location=/tls/user.p12
ssl.truststore.location=/tls/ca.p12
38 changes: 22 additions & 16 deletions kubernetes/acls/csp1_producer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,18 +48,10 @@ spec:
- name: cluster-certs
mountPath: /tls/ca.p12
subPath: ca.p12
- name: config
mountPath: /app/app.properties
subPath: app.properties
env:
# Replace ConfigMap by Environment
- name: KAFKA_BOOTSTRAP_SERVERS
value: kafka-kafka-bootstrap:9093
- name: KAFKA_TOPIC
value: csp1.transactions
- name: KAFKA_CLIENT_ID
value: csp1.producer
- name: KAFKA_PRODUCER_MSGS_PER_SEC
value: "1"
- name: KAFKA_APP_LOG_INFOS
value: "true"
# SSL Configs
- name: KAFKA_SECURITY_PROTOCOL
value: SSL
Expand All @@ -68,10 +60,6 @@ spec:
secretKeyRef:
name: csp1.producer
key: user.password
- name: KAFKA_SSL_KEYSTORE_LOCATION
value: /tls/user.p12
- name: KAFKA_SSL_TRUSTSTORE_LOCATION
value: /tls/ca.p12
- name: KAFKA_SSL_TRUSTSTORE_PASSWORD
valueFrom:
secretKeyRef:
Expand All @@ -83,4 +71,22 @@ spec:
secretName: csp1.producer
- name: cluster-certs
secret:
secretName: kafka-cluster-ca-cert
secretName: kafka-cluster-ca-cert
- name: config
configMap:
name: csp1-producer-config
---
apiVersion: v1
kind: ConfigMap
metadata:
name: csp1-producer-config
data:
app.properties: |
bootstrap.servers=kafka-kafka-bootstrap:9093
topic=csp1.transactions
producer.msgs.per.sec=1
app.log.infos=true
client.id=csp1_producer
security.protocol=SSL
ssl.keystore.location=/tls/user.p12
ssl.truststore.location=/tls/ca.p12
46 changes: 22 additions & 24 deletions kubernetes/acls/csp1_transformer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,36 +68,16 @@ spec:
- name: cluster-certs
mountPath: /tls/ca.p12
subPath: ca.p12
- name: config
mountPath: /app/app.properties
subPath: app.properties
env:
# Replace ConfigMap by Environment
- name: KAFKA_BOOTSTRAP_SERVERS
value: kafka-kafka-bootstrap:9093
- name: KAFKA_CSP1_TOPIC
value: csp1.transactions
- name: KAFKA_CLIENT_ID
value: csp1.transformer
- name: KAFKA_APP_LOG_INFOS
value: "true"
- name: KAFKA_OUTPUT_TOPIC
value: transactions
- name: KAFKA_GROUP_ID
value: csp1.transformer
- name: KAFKA_TRANSACTIONAL_ID
value: transactions-transformer-app
- name: KAFKA_PROCESSING_TIME_MS
value: "1000"
# SSL Configs
- name: KAFKA_SECURITY_PROTOCOL
value: SSL
- name: KAFKA_SSL_KEYSTORE_PASSWORD
valueFrom:
secretKeyRef:
name: csp1.producer
key: user.password
- name: KAFKA_SSL_KEYSTORE_LOCATION
value: /tls/user.p12
- name: KAFKA_SSL_TRUSTSTORE_LOCATION
value: /tls/ca.p12
- name: KAFKA_SSL_TRUSTSTORE_PASSWORD
valueFrom:
secretKeyRef:
Expand All @@ -109,4 +89,22 @@ spec:
secretName: csp1.producer
- name: cluster-certs
secret:
secretName: kafka-cluster-ca-cert
secretName: kafka-cluster-ca-cert
- name: config
configMap:
name: csp1-transformer-config
---
apiVersion: v1
kind: ConfigMap
metadata:
name: csp1-transformer-config
data:
app.properties: |
bootstrap.servers=kafka-kafka-bootstrap:9093
csp1.topic=csp1.transactions
output.topic=transactions
group.id=csp1_transformer
transactional.id=transactions-transformer-app
processing.time.ms=1000
app.log.infos=true
client.id=csp1_transformer
40 changes: 20 additions & 20 deletions kubernetes/acls/csp2_producer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,32 +48,16 @@ spec:
- name: cluster-certs
mountPath: /tls/ca.p12
subPath: ca.p12
- name: config
mountPath: /app/app.properties
subPath: app.properties
env:
# Replace ConfigMap by Environment
- name: KAFKA_BOOTSTRAP_SERVERS
value: kafka-kafka-bootstrap:9093
- name: KAFKA_TOPIC
value: csp2.transactions
- name: KAFKA_PRODUCER_BATCH_INTERVAL_S
value: "10"
- name: KAFKA_PRODUCER_MSGS_PER_BATCH
value: "100"
- name: KAFKA_CLIENT_ID
value: csp2.producer
- name: KAFKA_APP_LOG_INFOS
value: "true"
# SSL Configs
- name: KAFKA_SECURITY_PROTOCOL
value: SSL
- name: KAFKA_SSL_KEYSTORE_PASSWORD
valueFrom:
secretKeyRef:
name: csp2.producer
key: user.password
- name: KAFKA_SSL_KEYSTORE_LOCATION
value: /tls/user.p12
- name: KAFKA_SSL_TRUSTSTORE_LOCATION
value: /tls/ca.p12
- name: KAFKA_SSL_TRUSTSTORE_PASSWORD
valueFrom:
secretKeyRef:
Expand All @@ -85,4 +69,20 @@ spec:
secretName: csp2.producer
- name: cluster-certs
secret:
secretName: kafka-cluster-ca-cert
secretName: kafka-cluster-ca-cert
- name: config
configMap:
name: csp2-producer-config
---
apiVersion: v1
kind: ConfigMap
metadata:
name: csp2-producer-config
data:
app.properties: |
bootstrap.servers=kafka-kafka-bootstrap:9093
topic=csp2.transactions
producer.batch_interval.s=10
producer.msgs_per_batch=100
app.log.infos=true
client.id=csp2_producer
49 changes: 23 additions & 26 deletions kubernetes/acls/csp2_transformer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,38 +61,16 @@ spec:
- name: cluster-certs
mountPath: /tls/ca.p12
subPath: ca.p12
- name: config
mountPath: /app/app.properties
subPath: app.properties
env:
# Replace ConfigMap by Environment
- name: KAFKA_BOOTSTRAP_SERVERS
value: kafka-kafka-bootstrap:9093
- name: KAFKA_APPLICATION_ID
value: csp2-transformer
- name: KAFKA_CSP2_TRANSACTIONS_TOPIC
value: csp2.transactions
- name: KAFKA_CSP2_CUSTOMER_ID_MAPPING_TOPIC
value: csp2.customer.id.mapping
- name: KAFKA_CSP2_CHARGINGSTATION_ID_MAPPING_TOPIC
value: csp2.chargingstation.id.mapping
- name: KAFKA_CLIENT_ID
value: csp2.transformer
- name: KAFKA_APP_LOG_INFOS
value: "true"
- name: KAFKA_OUTPUT_TOPIC
value: transactions
- name: KAFKA_PROCESSING_TIME_MS
value: "1000"
# SSL Configs
- name: KAFKA_SECURITY_PROTOCOL
value: SSL
- name: KAFKA_SSL_KEYSTORE_PASSWORD
valueFrom:
secretKeyRef:
name: csp2.transformer
key: user.password
- name: KAFKA_SSL_KEYSTORE_LOCATION
value: /tls/user.p12
- name: KAFKA_SSL_TRUSTSTORE_LOCATION
value: /tls/ca.p12
- name: KAFKA_SSL_TRUSTSTORE_PASSWORD
valueFrom:
secretKeyRef:
Expand All @@ -104,4 +82,23 @@ spec:
secretName: csp2.transformer
- name: cluster-certs
secret:
secretName: kafka-cluster-ca-cert
secretName: kafka-cluster-ca-cert
- name: config
configMap:
name: csp2-transformer-config
---
apiVersion: v1
kind: ConfigMap
metadata:
name: csp2-transformer-config
data:
app.properties: |
bootstrap.servers=kafka-kafka-bootstrap:9093
application.id=csp2-transformer2
csp2.transactions.topic=csp2.transactions
csp2.customer_id_mapping.topic=csp2.customer.id.mapping
csp2.chargingstation_id_mapping.topic=csp2.chargingstation.id.mapping
output.topic=transactions
processing.time.ms=100
app.log.infos=true
client.id=csp2_transformer
35 changes: 17 additions & 18 deletions kubernetes/acls/dashboard.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,31 +69,16 @@ spec:
- name: cluster-certs
mountPath: /tls/ca.p12
subPath: ca.p12
- name: config
mountPath: /app/app.properties
subPath: app.properties
env:
# Replace ConfigMap by Environment

# transactions.topic=transactions
# web.port=9999
- name: KAFKA_BOOTSTRAP_SERVERS
value: kafka-kafka-bootstrap:9093
- name: KAFKA_APPLICATION_ID
value: dashboard
- name: KAFKA_CLIENT_ID
value: dashboard
- name: KAFKA_TRANSACTIONS_TOPIC
value: transactions
# SSL Configs
- name: KAFKA_SECURITY_PROTOCOL
value: SSL
- name: KAFKA_SSL_KEYSTORE_PASSWORD
valueFrom:
secretKeyRef:
name: dashboard
key: user.password
- name: KAFKA_SSL_KEYSTORE_LOCATION
value: /tls/user.p12
- name: KAFKA_SSL_TRUSTSTORE_LOCATION
value: /tls/ca.p12
- name: KAFKA_SSL_TRUSTSTORE_PASSWORD
valueFrom:
secretKeyRef:
Expand All @@ -106,3 +91,17 @@ spec:
- name: cluster-certs
secret:
secretName: kafka-cluster-ca-cert
- name: config
configMap:
name: dashboard-config
---
apiVersion: v1
kind: ConfigMap
metadata:
name: dashboard-config
data:
app.properties: |
bootstrap.servers=kafka-kafka-bootstrap:9093
application.id=dashboard
transactions.topic=transactions
web.port=9999

0 comments on commit cb033ff

Please sign in to comment.