Advertisement
Guest User

k8s cassie w/Istio

a guest
Jun 11th, 2019
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 3.39 KB | None | 0 0
  1. apiVersion: v1
  2. kind: Service
  3. metadata:
  4.   labels:
  5.     app: cassandra
  6.   namespace: cassandra-e2e
  7.   name: cassandra
  8. spec:
  9.   clusterIP: None
  10.   ports:
  11.   - name: tcp-client
  12.     port: 9042
  13.   - name: tcp-intra-node
  14.     port: 7000
  15.   - name: tcp-tls-intra-node
  16.     port: 7001
  17.   - name: tcp-jmx
  18.     port: 7199
  19.   selector:
  20.     app: cassandra
  21. ---
  22. apiVersion: apps/v1
  23. kind: StatefulSet
  24. metadata:
  25.   namespace: cassandra-e2e
  26.   name: cassandra
  27.   labels:
  28.     app: cassandra
  29. spec:
  30.   serviceName: cassandra
  31.   replicas: 1
  32.   selector:
  33.     matchLabels:
  34.       app: cassandra
  35.   template:
  36.     metadata:
  37.       labels:
  38.         app: cassandra
  39.     spec:
  40.       terminationGracePeriodSeconds: 1800
  41.       containers:
  42.       - name: pod-ip-access
  43.         securityContext:
  44.           runAsUser: 0
  45.           capabilities:
  46.             add:
  47.           - NET_ADMIN
  48.         env:
  49.         - name: POD_IP
  50.           valueFrom:
  51.             fieldRef:
  52.               fieldPath: status.podIP
  53.         - name: IPTABLE_CMD
  54.           value: iptables -t nat -I ISTIO_OUTPUT -d $(POD_IP) -j RETURN
  55.         # image: cscetbon/alpine-dumb-init-iptables
  56.         image: istio/proxyv2:1.1.7
  57.         command:
  58.       # - /usr/bin/dumb-init
  59.         - /bin/sh
  60.         - -c
  61.         - trap 'exit 0' SIGKILL SIGALRM SIGTERM; $(echo ${IPTABLE_CMD}|sed -e 's/I /C /') && exec sleep 1000d || $(${IPTABLE_CMD})
  62.       - name: cassandra
  63.         image: cscetbon/cassandra-image:3.11.4-8u212-0.3.1
  64.         command:
  65.       - /sbin/dumb-init
  66.         - /bin/bash
  67.         - -c
  68.         - sed -e 's/^\(CASSANDRA_LISTEN_ADDRESS\)=.*/\1=127.0.0.1/' /run.sh|sponge /run.sh /etc/cassandra/cassandra-env.sh && /run.sh
  69.         imagePullPolicy: Always
  70.         ports:
  71.         - containerPort: 7000
  72.           name: intra-node
  73.         - containerPort: 7001
  74.           name: tls-intra-node
  75.         - containerPort: 7199
  76.           name: jmx
  77.         - containerPort: 9042
  78.         resources:
  79.           limits:
  80.             cpu: "1"
  81.             memory: 768Mi
  82.           requests:
  83.             cpu: "1"
  84.             memory: 768Mi
  85.         securityContext:
  86.           capabilities:
  87.             add:
  88.             - IPC_LOCK
  89.         livenessProbe:
  90.             exec:
  91.               command:
  92.             - /bin/bash
  93.               - -c
  94.               - nodetool status
  95.             failureThreshold: 3
  96.             initialDelaySeconds: 120
  97.             periodSeconds: 10
  98.             successThreshold: 1
  99.             timeoutSeconds: 20
  100.         readinessProbe:
  101.             exec:
  102.               command:
  103.             - /bin/bash
  104.               - -c
  105.               - /ready-probe.sh
  106.             failureThreshold: 3
  107.             initialDelaySeconds: 60
  108.             periodSeconds: 10
  109.             successThreshold: 1
  110.             timeoutSeconds: 10
  111.         env:
  112.           - name: MAX_HEAP_SIZE
  113.             value: 192M
  114.           - name: CASSANDRA_SEEDS
  115.             value: cassandra-0.cassandra.cassandra-e2e.svc.cluster.local
  116.           - name: CASSANDRA_CLUSTER_NAME
  117.             value: K8Demo
  118.           - name: CASSANDRA_DC
  119.             value: DC1-K8Demo
  120.           - name: CASSANDRA_RACK
  121.             value: Rack1-K8Demo
  122.           - name: POD_NAME
  123.             valueFrom:
  124.               fieldRef:
  125.                 apiVersion: v1
  126.                 fieldPath: metadata.name
  127.           - name: POD_IP
  128.             valueFrom:
  129.               fieldRef:
  130.                 fieldPath: status.podIP
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement