Last active
July 27, 2018 20:06
-
-
Save ll911/527bfa18e1a3a930647e13ff6da8cfdb to your computer and use it in GitHub Desktop.
cassandra-k8s-pv-dc.yaml
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: Service | |
| metadata: | |
| labels: | |
| app: cassandra | |
| name: cassandra | |
| spec: | |
| clusterIP: None | |
| ports: | |
| - port: 9042 | |
| selector: | |
| app: cassandra | |
| --- | |
| apiVersion: "apps/v1beta1" | |
| kind: StatefulSet | |
| metadata: | |
| name: cassandra | |
| spec: | |
| serviceName: cassandra | |
| replicas: 5 | |
| template: | |
| metadata: | |
| labels: | |
| app: cassandra | |
| spec: | |
| containers: | |
| - name: cassandra | |
| image: cassandra:3.11 | |
| command: | |
| - /docker-entrypoint.sh | |
| - "-R" | |
| imagePullPolicy: Always | |
| ports: | |
| - containerPort: 7000 | |
| name: intra-node | |
| - containerPort: 7001 | |
| name: tls-intra-node | |
| - containerPort: 7199 | |
| name: jmx | |
| - containerPort: 9042 | |
| name: cql | |
| resources: | |
| limits: | |
| cpu: "1000m" | |
| memory: 4Gi | |
| requests: | |
| cpu: "700m" | |
| memory: 3Gi | |
| lifecycle: | |
| preStop: | |
| exec: | |
| command: ["/bin/sh", "-c", "nodetool drain"] | |
| env: | |
| - name: JAVA_OPTS | |
| value: "-XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap" | |
| - name: CASSANDRA_LISTEN_ADDRESS | |
| valueFrom: | |
| fieldRef: | |
| fieldPath: status.podIP | |
| - name: CASSANDRA_SEEDS | |
| value: cassandra-0.cassandra | |
| - name: CASSANDRA_CLUSTER_NAME | |
| value: "k8s" | |
| - name: CASSANDRA_DC | |
| value: "DC1" | |
| - name: CASSANDRA_RACK | |
| value: "Rack1" | |
| - name: CASSANDRA_ENDPOINT_SNITCH | |
| value: "GossipingPropertyFileSnitch" | |
| - name: MAX_HEAP_SIZE | |
| value: 2000M | |
| - name: HEAP_NEWSIZE | |
| value: 100M | |
| # These volume mounts are persistent. They are like inline claims, | |
| # but not exactly because the names need to match exactly one of | |
| # the stateful pod volumes. | |
| volumeMounts: | |
| - name: cassandra-data | |
| mountPath: /var/lib/cassandra | |
| - name: cassandra-logs | |
| mountPath: /var/log/cassandra | |
| volumes: | |
| - name: cassandra-logs | |
| emptyDir: {} | |
| # These are converted to volume claims by the controller | |
| # and mounted at the paths mentioned above. | |
| # do not use these in production until ssd GCEPersistentDisk or other ssd pd | |
| volumeClaimTemplates: | |
| - metadata: | |
| name: cassandra-data | |
| annotations: | |
| spec: | |
| accessModes: [ "ReadWriteOnce" ] | |
| resources: | |
| requests: | |
| storage: 2Gi | |
| --- | |
| apiVersion: batch/v1 | |
| kind: Job | |
| metadata: | |
| name: kong-migration | |
| spec: | |
| template: | |
| metadata: | |
| name: kong-migration | |
| spec: | |
| containers: | |
| - name: kong-migration | |
| image: 172.50.0.2:5000/dbc-konga-tools/kong-k8s | |
| 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 | |
| - name: KONG_CASSANDRA_REPL_FACTOR | |
| value: '3' | |
| - name: KONG_PLUGINS | |
| value: 'bundled,gwa-ip-anonymity,oidc,kong-oidc-auth' | |
| - name: KONG_TRUSTED_IPS | |
| value: 172.51.0.0/16,142.34.143.128/26 | |
| - name: KONG_REAL_IP_RECURSIVE | |
| value: 'on' | |
| - name: KONG_NGINX_LARGE_CLIENT_HEADER_BUFFERS | |
| value: '4 64K' | |
| 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