SHARE
TWEET

Untitled

a guest Feb 22nd, 2019 70 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. apiVersion: apps/v1beta1
  2. kind: StatefulSet
  3. metadata:
  4.   name: rm-stolon-keeper
  5.   namespace: staging
  6.   labels:
  7.     env: dev
  8.     app: rm-stolon-keeper
  9.     component: "stolon-keeper"
  10. spec:
  11.   serviceName: rm-stolon-keeper
  12.   replicas: 3
  13.   template:
  14.     metadata:
  15.       labels:
  16.         env: dev
  17.         app: rm-stolon-keeper
  18.         component: "stolon-keeper"
  19.         stolon-cluster: rm-stolon
  20.       annotations:
  21.         pod.alpha.kubernetes.io/initialized: "true"
  22.     spec:
  23.       serviceAccountName: rm-stolon
  24.       terminationGracePeriodSeconds: 10
  25.       containers:
  26.       - name: rm-stolon-keeper
  27.         image: "sorintlab/stolon:v0.13.0-pg10"
  28.         imagePullPolicy: "IfNotPresent"
  29.         command:
  30.           - "/bin/bash"
  31.           - "-ec"
  32.           - |
  33.             IFS='-' read -ra ADDR <<< "$(hostname)"
  34.             export STKEEPER_UID="keeper${ADDR[-1]}"
  35.             export POD_IP=$(hostname -i)
  36.             export STKEEPER_PG_LISTEN_ADDRESS=$POD_IP
  37.             export STOLON_DATA1=/stolon-data-1
  38.             export STOLON_DATA2=/stolon-data-2
  39.             export STOLON_DATA3=/stolon-data-3
  40.             chown stolon:stolon $STOLON_DATA1
  41.             chown stolon:stolon $STOLON_DATA2
  42.             chown stolon:stolon $STOLON_DATA3
  43.             exec gosu stolon stolon-keeper --data-dir $STOLON_DATA1
  44.             exec gosu stolon stolon-keeper --data-dir $STOLON_DATA2
  45.             exec gosu stolon stolon-keeper --data-dir $STOLON_DATA3
  46.         env:
  47.           - name: POD_NAME
  48.             valueFrom:
  49.               fieldRef:
  50.                 fieldPath: metadata.name
  51.           - name: STKEEPER_CLUSTER_NAME
  52.             value: rm-stolon
  53.           - name: STKEEPER_STORE_BACKEND
  54.             value: "kubernetes"
  55.           - name: STKEEPER_KUBE_RESOURCE_KIND
  56.             value: "configmap"
  57.           - name: STKEEPER_PG_REPL_USERNAME
  58.             value: "admin_replica"
  59.           - name: STKEEPER_PG_REPL_PASSWORDFILE
  60.             value: "/etc/secrets/stolon/pg_repl_password"
  61.           - name: STKEEPER_PG_SU_USERNAME
  62.             value: "admin"
  63.           - name: STKEEPER_PG_SU_PASSWORDFILE
  64.             value: "/etc/secrets/stolon/pg_su_password"
  65.           - name: STKEEPER_DEBUG
  66.             value: "false"
  67.         ports:
  68.           - containerPort: 5432
  69.         volumeMounts:
  70.         - name: stolon-data-1
  71.           mountPath: /stolon-data-1
  72.         - name: stolon-data-2
  73.           mountPath: /stolon-data-2
  74.         - name: stolon-data-3
  75.           mountPath: /stolon-data-3
  76.         - name: stolon-secrets
  77.           mountPath: /etc/secrets/stolon
  78.       volumes:
  79.         - name: stolon-secrets
  80.           secret:
  81.             secretName: rm-stolon
  82.         - name: stolon-data-1
  83.           persistentVolumeClaim:
  84.             claimName: stolon-pvc-1
  85.         - name: stolon-data-2
  86.           persistentVolumeClaim:
  87.             claimName: stolon-pvc-2
  88.         - name: stolon-data-3
  89.           persistentVolumeClaim:
  90.             claimName: stolon-pvc-3
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top