Skip to content

Commit

Permalink
Create secret for kafka binder with binder specific properties.
Browse files Browse the repository at this point in the history
Simplify skipper config
Simplify use of scdf-datasource in deployments.

Fixes #6002
  • Loading branch information
corneil committed Oct 22, 2024
1 parent ad21f25 commit fcd8efb
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 141 deletions.
4 changes: 2 additions & 2 deletions src/deploy/k8s/deploy-scdf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,8 @@ kubectl apply --namespace "$NS" -f "$YAML_PATH/server-config.yaml"


kubectl create --namespace "$NS" clusterrolebinding scdftestrole --clusterrole cluster-admin --user=system:serviceaccount:default:scdf-sa

kubectl apply --namespace "$NS" -f "$YAML_PATH/skipper-config-$BROKER.yaml"
kubectl apply --namespace "$NS" -f "$YAML_PATH/${BROKER}-default-binder.yaml"
kubectl apply --namespace "$NS" -f "$YAML_PATH/skipper-config.yaml"
cat "$YAML_PATH/skipper-deployment.yaml" | envsubst '$DATAFLOW_VERSION,$SKIPPER_VERSION,$DATABASE' | kubectl create --namespace "$NS" -f -
kubectl create --namespace "$NS" -f "$YAML_PATH/skipper-svc.yaml"

Expand Down
8 changes: 8 additions & 0 deletions src/deploy/k8s/yaml/rabbit-default-binder.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
apiVersion: v1
kind: Secret
metadata:
name: default-binder
type: Opaque
stringData:
spring.cloud.stream.rabbit.binder.nodes[0]: 'rabbitmq:5672'

4 changes: 4 additions & 0 deletions src/deploy/k8s/yaml/server-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ data:
kubernetes:
accounts:
default:
secretRefs:
- scdf-datasource
configMapRefs:
- scdf-datasource
environmentVariables: 'JAVA_TOOL_OPTIONS=-XX:ActiveProcessorCount=-1'
imagePullPolicy: IfNotPresent
imagePullSecret: registry-key
Expand Down
45 changes: 0 additions & 45 deletions src/deploy/k8s/yaml/server-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,51 +85,6 @@ spec:
# Provide the Skipper service location
- name: SPRING_CLOUD_SKIPPER_CLIENT_SERVER_URI
value: 'http://${SKIPPER_SERVICE_HOST}:${SKIPPER_SERVICE_PORT}/api'
- name: SPRING_DATASOURCE_USERNAME
valueFrom:
secretKeyRef:
key: SPRING_DATASOURCE_USERNAME
name: scdf-datasource
- name: SPRING_DATASOURCE_PASSWORD
valueFrom:
secretKeyRef:
key: SPRING_DATASOURCE_PASSWORD
name: scdf-datasource
- name: SPRING_DATASOURCE_URL
valueFrom:
configMapKeyRef:
key: SPRING_DATASOURCE_URL
name: scdf-datasource
- name: SPRING_DATASOURCE_DRIVER_CLASS_NAME
valueFrom:
configMapKeyRef:
key: SPRING_DATASOURCE_DRIVER_CLASS_NAME
name: scdf-datasource
- name: SPRING_DATASOURCE_TEST_ON_BORROW
valueFrom:
configMapKeyRef:
key: SPRING_DATASOURCE_TEST_ON_BORROW
name: scdf-datasource
- name: SPRING_DATASOURCE_VALIDATION_QUERY
valueFrom:
configMapKeyRef:
key: SPRING_DATASOURCE_VALIDATION_QUERY
name: scdf-datasource
- name: 'SPRING_DATASOURCE_HIKARI_DATA_SOURCE_PROPERTIES_USE_UNICODE'
valueFrom:
configMapKeyRef:
key: 'SPRING_DATASOURCE_HIKARI_DATA_SOURCE_PROPERTIES_USE_UNICODE'
name: 'scdf-datasource'
- name: SPRING_DATASOURCE_HIKARI_DATA_SOURCE_PROPERTIES_CHARACTER_ENCODING
valueFrom:
configMapKeyRef:
key: SPRING_DATASOURCE_HIKARI_DATA_SOURCE_PROPERTIES_CHARACTER_ENCODING
name: scdf-datasource
- name: SPRING_JPA_DATABASE_PLATFORM
valueFrom:
configMapKeyRef:
key: SPRING_JPA_DATABASE_PLATFORM
name: scdf-datasource
- name: 'MANAGEMENT_METRICS_EXPORT_PROMETHEUS_ENABLED'
value: 'true'
- name: 'MANAGEMENT_METRICS_EXPORT_PROMETHEUS_RSOCKET_ENABLED'
Expand Down
48 changes: 0 additions & 48 deletions src/deploy/k8s/yaml/skipper-config-rabbit.yaml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,15 @@ data:
kubernetes:
accounts:
default:
secretRefs:
- default-binder
- scdf-datasource
configMapRefs:
- scdf-datasource
imagePullPolicy: IfNotPresent
imagePullSecret:
- name: registry-key
environmentVariables: 'JAVA_TOOL_OPTIONS=-XX:ActiveProcessorCount=-1,LANG=en_US.utf8,LC_ALL=en_US.utf8,JDK_JAVA_OPTIONS=-Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8,SPRING_CLOUD_CONFIG_ENABLED=false,SPRING_CLOUD_STREAM_KAFKA_BINDER_BROKERS=kafka-broker:9092,SPRING_CLOUD_STREAM_KAFKA_BINDER_ZK_NODES=${KAFKA_ZK_SERVICE_HOST}:${KAFKA_ZK_SERVICE_PORT}'
environmentVariables: 'JAVA_TOOL_OPTIONS=-XX:ActiveProcessorCount=-1,LANG=en_US.utf8,LC_ALL=en_US.utf8,JDK_JAVA_OPTIONS=-Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8,SPRING_CLOUD_CONFIG_ENABLED=false'
request:
memory: 1024Mi
cpu: 1500m
Expand Down
45 changes: 0 additions & 45 deletions src/deploy/k8s/yaml/skipper-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,51 +72,6 @@ spec:
value: 'false'
- name: SPRING_CLOUD_KUBERNETES_SECRETS_PATHS
value: /etc/secrets
- name: SPRING_DATASOURCE_USERNAME
valueFrom:
secretKeyRef:
key: SPRING_DATASOURCE_USERNAME
name: scdf-datasource
- name: SPRING_DATASOURCE_PASSWORD
valueFrom:
secretKeyRef:
key: SPRING_DATASOURCE_PASSWORD
name: scdf-datasource
- name: SPRING_DATASOURCE_URL
valueFrom:
configMapKeyRef:
key: SPRING_DATASOURCE_URL
name: scdf-datasource
- name: SPRING_DATASOURCE_DRIVER_CLASS_NAME
valueFrom:
configMapKeyRef:
key: SPRING_DATASOURCE_DRIVER_CLASS_NAME
name: scdf-datasource
- name: SPRING_DATASOURCE_TEST_ON_BORROW
valueFrom:
configMapKeyRef:
key: SPRING_DATASOURCE_TEST_ON_BORROW
name: scdf-datasource
- name: SPRING_DATASOURCE_VALIDATION_QUERY
valueFrom:
configMapKeyRef:
key: SPRING_DATASOURCE_VALIDATION_QUERY
name: scdf-datasource
- name: SPRING_DATASOURCE_HIKARI_DATA_SOURCE_PROPERTIES_USE_UNICODE
valueFrom:
configMapKeyRef:
key: SPRING_DATASOURCE_HIKARI_DATA_SOURCE_PROPERTIES_USE_UNICODE
name: scdf-datasource
- name: SPRING_DATASOURCE_HIKARI_DATA_SOURCE_PROPERTIES_CHARACTER_ENCODING
valueFrom:
configMapKeyRef:
key: SPRING_DATASOURCE_HIKARI_DATA_SOURCE_PROPERTIES_CHARACTER_ENCODING
name: scdf-datasource
- name: SPRING_JPA_DATABASE_PLATFORM
valueFrom:
configMapKeyRef:
key: SPRING_JPA_DATABASE_PLATFORM
name: scdf-datasource
- name: MANAGEMENT_METRICS_EXPORT_PROMETHEUS_ENABLED
value: 'true'
- name: MANAGEMENT_METRICS_EXPORT_PROMETHEUS_RSOCKET_ENABLED
Expand Down

0 comments on commit fcd8efb

Please sign in to comment.