|
| 1 | +apiVersion: apps/v1 |
| 2 | +kind: Deployment |
| 3 | +metadata: |
| 4 | + name: redis-connect-postgres # deployment name |
| 5 | + labels: |
| 6 | + app: redis-connect-postgres # deployment label |
| 7 | + |
| 8 | +spec: |
| 9 | + replicas: 1 # replicas for HA |
| 10 | + selector: |
| 11 | + matchLabels: |
| 12 | + app: redis-connect-postgres # which pods is the deployment managing, as defined by the pod template |
| 13 | + template: # pod template |
| 14 | + metadata: |
| 15 | + labels: |
| 16 | + app: redis-connect-postgres |
| 17 | + annotations: |
| 18 | + vault.hashicorp.com/agent-inject: "true" |
| 19 | + vault.hashicorp.com/role: "redis-connect" |
| 20 | + vault.hashicorp.com/secret-volume-path: "/vault/secrets" |
| 21 | + vault.hashicorp.com/agent-inject-file-redis-connect: "redisconnect_credentials_RedisConnect-postgres" |
| 22 | + vault.hashicorp.com/agent-inject-secret-redis-connect: 'database/creds/redis-connect' |
| 23 | + vault.hashicorp.com/agent-inject-template-redis-connect: | |
| 24 | + {{ with secret "database/creds/redis-connect" -}} |
| 25 | + sourceUsername={{ .Data.username }} |
| 26 | + sourcePassword={{ .Data.password }} |
| 27 | + targetUsername=asdf |
| 28 | + targetPassword=asdf |
| 29 | + jobConfigUsername=asdf |
| 30 | + jobConfigPassword=asdf |
| 31 | + metricsUsername=asdf |
| 32 | + metricsPassword=asdf |
| 33 | + {{- end }} |
| 34 | + spec: |
| 35 | + serviceAccountName: redis-connect |
| 36 | + affinity: |
| 37 | + podAntiAffinity: |
| 38 | + requiredDuringSchedulingIgnoredDuringExecution: |
| 39 | + - labelSelector: |
| 40 | + matchExpressions: |
| 41 | + - key: app |
| 42 | + operator: In |
| 43 | + values: |
| 44 | + - redis-connect-postgres # must match Deployment:metadata:labels:app |
| 45 | + topologyKey: "kubernetes.io/hostname" |
| 46 | + containers: |
| 47 | + - name: redis-connect-postgres # Container name |
| 48 | + image: redislabs/redis-connect-postgres:latest |
| 49 | + # The following `command` can be leveraged for troubleshooting |
| 50 | + command: ["/bin/bash", "-c", "echo $REDISCONNECT_JAVA_OPTIONS; /opt/redislabs/redis-connect-postgres/bin/redisconnect.sh start; while true; do sleep 30; done;"] |
| 51 | + # command: ["/opt/redislabs/redis-connect-postgres/bin/redisconnect.sh", "start"] |
| 52 | + imagePullPolicy: Always # IfNotPresent # Always pull image |
| 53 | + resources: |
| 54 | + limits: |
| 55 | + cpu: "4000m" |
| 56 | + memory: "2048Mi" |
| 57 | + requests: |
| 58 | + cpu: "500m" |
| 59 | + memory: "256Mi" |
| 60 | + ports: |
| 61 | + - containerPort: 8282 # exposed container port to the REST API |
| 62 | + protocol: TCP |
| 63 | + env: |
| 64 | + - name: REDISCONNECT_LOGBACK_CONFIG |
| 65 | + value: "/opt/redislabs/redis-connect-postgres/config/logback.xml" |
| 66 | + # value: "/opt/redislabs/redis-connect-postgres/config/fromconfigmap/logback.xml" |
| 67 | + - name: REDISCONNECT_CONFIG |
| 68 | + value: "/opt/redislabs/redis-connect-postgres/config/fromconfigmap" |
| 69 | + - name: REDISCONNECT_REST_API_ENABLED |
| 70 | + value: "false" |
| 71 | + - name: REDISCONNECT_REST_API_PORT |
| 72 | + value: "8282" |
| 73 | + - name: REDISCONNECT_JAVA_OPTIONS |
| 74 | + value: "-Xms256m -Xmx1g -Dredis.connect.credentials.rotation.eventlistener.enabled=true \ |
| 75 | + -Dredis.connect.credentials.filename=/vault/secrets/redisconnect_credentials_RedisConnect-postgres \ |
| 76 | + -DsourceUsername=sourceUsername -DsourcePassword=sourcePassword \ |
| 77 | + -DjobConfigUsername=jobConfigUsername -DjobConfigPassword=jobConfigPassword \ |
| 78 | + -DtargetUsername=targetUsername -DtargetPassword=targetPassword \ |
| 79 | + -DmetricsUsername=metricsUsername -DmetricsPassword=metricsPassword" |
| 80 | + volumeMounts: |
| 81 | + - name: config-volume |
| 82 | + mountPath: /opt/redislabs/redis-connect-postgres/config/fromconfigmap # must match env:REDISCONNECT_CONFIG in this file. |
| 83 | + # - name: custom-stage-volume |
| 84 | + # mountPath: /opt/redislabs/redis-connect-postgres/extlib # Redis Connect expects the custom stage jars here |
| 85 | + volumes: |
| 86 | + - name: config-volume |
| 87 | + configMap: |
| 88 | + name: redis-connect-postgres-config |
| 89 | + items: |
| 90 | + - key: JobConfig.yml |
| 91 | + path: JobConfig.yml |
| 92 | + - key: JobManager.yml |
| 93 | + path: JobManager.yml |
| 94 | + - key: Setup.yml |
| 95 | + path: Setup.yml |
| 96 | + - key: env.yml |
| 97 | + path: env.yml |
| 98 | + - key: mapper1.yml |
| 99 | + path: mappers/mapper1.yml |
| 100 | +# #### uncomment the following six lines if you have custom |
| 101 | +# transformation implementation and replace the jar with |
| 102 | +# your own. |
| 103 | +# #### |
| 104 | + #- name: custom-stage-volume |
| 105 | + #configMap: |
| 106 | + #name: redis-connect-postgres-config |
| 107 | + #items: # define as many custom stages as you have here |
| 108 | + #- key: redis-connect-custom-stage-demo-1.0-SNAPSHOT.jar |
| 109 | + #path: redis-connect-custom-stage-demo-1.0-SNAPSHOT.jar |
| 110 | + # - name: tmpfsdir |
| 111 | + # emptyDir: # node-ephemeral volume |
| 112 | + # medium: Memory |
| 113 | + # - name: redis-connect-postgres-pv |
| 114 | + # persistentVolumeClaim: |
| 115 | + # claimName: redis-connect-postgres-pvc |
| 116 | +--- |
| 117 | +# RedisConnect service with name 'redis-connect-service' |
| 118 | +# apiVersion: v1 |
| 119 | +# kind: Service |
| 120 | +# metadata: |
| 121 | +# name: redis-connect-api-service # name should not be 'redis-connect' |
| 122 | +# spec: |
| 123 | +# type: ClusterIP |
| 124 | +# ports: |
| 125 | +# - port: 80 |
| 126 | +# targetPort: 8282 |
| 127 | +# selector: |
| 128 | +# app: redis-connect-api-service |
0 commit comments