Last active
June 8, 2018 02:16
-
-
Save ll911/02218bef2825201889db6d985101a318 to your computer and use it in GitHub Desktop.
cassandra-ocp-statefulset
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| apiVersion: v1 | |
| kind: List | |
| items: | |
| - apiVersion: v1 | |
| kind: Service | |
| metadata: | |
| name: cassandra | |
| labels: | |
| app: cassandra-k8s | |
| name: cassandra-k8s-service | |
| spec: | |
| ports: | |
| - port: 7000 | |
| name: intra-node | |
| - port: 7001 | |
| name: tls-intra-node | |
| - port: 7199 | |
| name: jmx | |
| - port: 9042 | |
| name: cql | |
| - port: 9160 | |
| name: thrift | |
| clusterIP: None | |
| selector: | |
| app: cassandra | |
| - apiVersion: "apps/v1beta1" | |
| kind: StatefulSet | |
| metadata: | |
| name: cassandra | |
| labels: | |
| app: cassandra-k8s-statefulset | |
| spec: | |
| serviceName: cassandra | |
| replicas: 3 | |
| template: | |
| metadata: | |
| labels: | |
| app: cassandra | |
| spec: | |
| terminationGracePeriodSeconds: 1800 | |
| containers: | |
| - name: cassandra | |
| image: cassandra:3.11 | |
| command: | |
| - /docker-entrypoint.sh | |
| - "-R" | |
| ports: | |
| - containerPort: 7000 | |
| name: intra-node | |
| - containerPort: 7001 | |
| name: tls-intra-node | |
| - containerPort: 7199 | |
| name: jmx | |
| - containerPort: 9042 | |
| name: cql | |
| - containerPort: 9160 | |
| name: thrift | |
| lifecycle: | |
| preStop: | |
| exec: | |
| command: ["/bin/sh", "-c", "nodetool drain"] | |
| env: | |
| - name: MAX_HEAP_SIZE | |
| value: 512M | |
| - name: HEAP_NEWSIZE | |
| value: 100M | |
| - name: CASSANDRA_LISTEN_ADDRESS | |
| valueFrom: | |
| fieldRef: | |
| fieldPath: status.podIP | |
| - name: CASSANDRA_CLUSTER_NAME | |
| value: "kong" | |
| - name: CASSANDRA_DC | |
| value: "dc1" | |
| - name: CASSANDRA_RACK | |
| value: "rack1" | |
| - name: CASSANDRA_ENDPOINT_SNITCH | |
| value: "GossipingPropertyFileSnitch" | |
| - name: CASSANDRA_SEEDS | |
| value: cassandra-0.cassandra | |
| volumeMounts: | |
| - name: cassandra-data | |
| mountPath: /var/lib/cassandra | |
| - name: cassandra-logs | |
| mountPath: /var/log/cassandra | |
| volumes: | |
| - name: cassandra-data | |
| emptyDir: {} | |
| - name: cassandra-logs | |
| emptyDir: {} | |
| - apiVersion: batch/v1 | |
| kind: Job | |
| metadata: | |
| name: kong-migration | |
| spec: | |
| template: | |
| metadata: | |
| name: kong-migration | |
| spec: | |
| containers: | |
| - name: kong-migration | |
| image: kong | |
| env: | |
| - name: KONG_NGINX_DAEMON | |
| value: 'off' | |
| - name: KONG_DATABASE | |
| value: cassandra | |
| - name: KONG_CASSANDRA_CONTACT_POINTS | |
| value: cassandra | |
| - name: KONG_CASSANDRA_KEYSPACE | |
| value: kong | |
| command: [ "/bin/sh", "-c", "kong migrations up" ] | |
| restartPolicy: Never |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment