|
| 1 | +apiVersion: apps/v1 |
| 2 | +kind: Deployment |
| 3 | +metadata: |
| 4 | + name: redis-connect # deployment name |
| 5 | + labels: |
| 6 | + app: redis-connect # deployment label |
| 7 | + |
| 8 | +spec: |
| 9 | + replicas: 2 # replicas for HA |
| 10 | + selector: |
| 11 | + matchLabels: |
| 12 | + app: redis-connect # which pods is the deployment managing, as defined by the pod template |
| 13 | + template: # pod template |
| 14 | + metadata: |
| 15 | + labels: |
| 16 | + app: redis-connect |
| 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_oracle-job" |
| 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 | + source.username={{ .Data.username }} |
| 26 | + source.password={{ .Data.password }} |
| 27 | + target.username=asdf |
| 28 | + target.password=asdf |
| 29 | + jobmanager.username=asdf |
| 30 | + jobmanager.password=asdf |
| 31 | + {{- end }} |
| 32 | + spec: |
| 33 | + serviceAccountName: redis-connect |
| 34 | + affinity: |
| 35 | + podAntiAffinity: |
| 36 | + requiredDuringSchedulingIgnoredDuringExecution: |
| 37 | + - labelSelector: |
| 38 | + matchExpressions: |
| 39 | + - key: app |
| 40 | + operator: In |
| 41 | + values: |
| 42 | + - redis-connect # must match Deployment:metadata:labels:app |
| 43 | + topologyKey: "kubernetes.io/hostname" |
| 44 | + containers: |
| 45 | + - name: redis-connect # Container name |
| 46 | + image: redislabs/redis-connect:latest |
| 47 | + # The following `command` can be leveraged for troubleshooting |
| 48 | + # command: ["/bin/bash", "-c", "echo $REDISCONNECT_JAVA_OPTIONS; /opt/redislabs/redis-connect/bin/redisconnect.sh start; while true; do sleep 30; done;"] |
| 49 | + command: ["/opt/redislabs/redis-connect/bin/redisconnect.sh", "start"] |
| 50 | + imagePullPolicy: Always # IfNotPresent # Always pull image |
| 51 | + resources: |
| 52 | + limits: |
| 53 | + cpu: "4000m" |
| 54 | + memory: "2048Mi" |
| 55 | + requests: |
| 56 | + cpu: "500m" |
| 57 | + memory: "256Mi" |
| 58 | + ports: |
| 59 | + - containerPort: 8282 # exposed container port to the REST API |
| 60 | + protocol: TCP |
| 61 | + env: |
| 62 | + - name: REDISCONNECT_LOGBACK_CONFIG |
| 63 | + value: "/opt/redislabs/redis-connect/config/logback.xml" |
| 64 | + # value: "/opt/redislabs/redis-connect/config/fromconfigmap/logback.xml" |
| 65 | + - name: REDISCONNECT_JOB_MANAGER_CONFIG_PATH |
| 66 | + value: "/opt/redislabs/redis-connect/config/fromconfigmap" |
| 67 | + - name: REDISCONNECT_JAVA_OPTIONS |
| 68 | + value: "-Xms1g -Xmx2g" |
| 69 | + - name: REDISCONNECT_EXTLIB_DIR |
| 70 | + value: "/opt/redislabs/redis-connect/extlib" |
| 71 | + volumeMounts: |
| 72 | + - name: config-volume |
| 73 | + mountPath: /opt/redislabs/redis-connect/config/fromconfigmap # must match env:REDISCONNECT_CONFIG in this file. |
| 74 | + - name: custom-stage-volume |
| 75 | + mountPath: /opt/redislabs/redis-connect/extlib # Redis Connect expects the custom stage jars here |
| 76 | + volumes: |
| 77 | + - name: config-volume |
| 78 | + configMap: |
| 79 | + name: redis-connect-config |
| 80 | + items: |
| 81 | + - key: jobmanager.properties |
| 82 | + value: jobmanager.properties |
| 83 | +# #### uncomment the following six lines if you have custom |
| 84 | +# transformation implementation and replace the jar with |
| 85 | +# your own. |
| 86 | +# #### |
| 87 | + - name: custom-stage-volume |
| 88 | + configMap: |
| 89 | + name: redis-connect-custom-stage |
| 90 | + items: # define as many custom stages as you have here |
| 91 | + - key: redis-connect-custom-stage-demo-1.0-SNAPSHOT.jar |
| 92 | + path: redis-connect-custom-stage-demo-1.0-SNAPSHOT.jar |
| 93 | + # - name: tmpfsdir |
| 94 | + # emptyDir: # node-ephemeral volume |
| 95 | + # medium: Memory |
| 96 | + # - name: redis-connect-pv |
| 97 | + # persistentVolumeClaim: |
| 98 | + # claimName: redis-connect-pvc |
| 99 | +--- |
| 100 | +# RedisConnect service with name 'redis-connect-api-service' |
| 101 | +apiVersion: v1 |
| 102 | +kind: Service |
| 103 | +metadata: |
| 104 | + name: redis-connect-api-service # name should not be 'redis-connect' |
| 105 | +spec: |
| 106 | + type: ClusterIP |
| 107 | + ports: |
| 108 | + - port: 80 |
| 109 | + targetPort: 8282 |
| 110 | + selector: |
| 111 | + app: redis-connect-api-service |
0 commit comments