123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138 |
- apiVersion: v1
- kind: ReplicationController
- metadata:
- name: hawkular-cassandra-{{ node }}
- labels:
- metrics-infra: hawkular-cassandra
- name: hawkular-cassandra
- type: hawkular-cassandra
- spec:
- selector:
- name: hawkular-cassandra-{{ node }}
- replicas: {{replica_count}}
- template:
- version: v1
- metadata:
- labels:
- metrics-infra: hawkular-cassandra
- name: hawkular-cassandra-{{ node }}
- type: hawkular-cassandra
- spec:
- serviceAccount: cassandra
- securityContext:
- supplementalGroups:
- - {{openshift_metrics_cassandra_storage_group}}
- {% if node_selector is iterable and node_selector | length > 0 %}
- nodeSelector:
- {% for key, value in node_selector.items() %}
- {{key}}: "{{value}}"
- {% endfor %}
- {% endif %}
- containers:
- - image: "{{ openshift_metrics_cassandra_image }}"
- imagePullPolicy: IfNotPresent
- name: hawkular-cassandra-{{ node }}
- ports:
- - name: cql-port
- containerPort: 9042
- - name: thrift-port
- containerPort: 9160
- - name: tcp-port
- containerPort: 7000
- - name: ssl-port
- containerPort: 7001
- command:
- - "/opt/apache-cassandra/bin/cassandra-docker.sh"
- - "--cluster_name=hawkular-metrics"
- - "--data_volume=/cassandra_data"
- - "--internode_encryption=all"
- - "--require_node_auth=true"
- - "--enable_client_encryption=true"
- - "--require_client_auth=true"
- env:
- - name: CASSANDRA_MASTER
- value: "{{ master }}"
- - name: CASSANDRA_DATA_VOLUME
- value: "/cassandra_data"
- - name: JVM_OPTS
- value: "-Dcassandra.commitlog.ignorereplayerrors=true"
- - name: ENABLE_PROMETHEUS_ENDPOINT
- value: "{{ openshift_metrics_cassandra_enable_prometheus_endpoint }}"
- - name: TRUSTSTORE_NODES_AUTHORITIES
- value: "/hawkular-cassandra-certs/tls.peer.truststore.crt"
- - name: TRUSTSTORE_CLIENT_AUTHORITIES
- value: "/hawkular-cassandra-certs/tls.client.truststore.crt"
- - name: TAKE_SNAPSHOT
- value: "{{ openshift_metrics_cassandra_take_snapshot }}"
- - name: POD_NAMESPACE
- valueFrom:
- fieldRef:
- fieldPath: metadata.namespace
- - name: MEMORY_LIMIT
- valueFrom:
- resourceFieldRef:
- resource: limits.memory
- - name: CPU_LIMIT
- valueFrom:
- resourceFieldRef:
- resource: limits.cpu
- divisor: 1m
- volumeMounts:
- - name: cassandra-data
- mountPath: "/cassandra_data"
- - name: hawkular-cassandra-certs
- mountPath: "/hawkular-cassandra-certs"
- {% if ((openshift_metrics_cassandra_limits_cpu is defined and openshift_metrics_cassandra_limits_cpu is not none)
- or (openshift_metrics_cassandra_limits_memory is defined and openshift_metrics_cassandra_limits_memory is not none)
- or (openshift_metrics_cassandra_requests_cpu is defined and openshift_metrics_cassandra_requests_cpu is not none)
- or (openshift_metrics_cassandra_requests_memory is defined and openshift_metrics_cassandra_requests_memory is not none))
- %}
- resources:
- {% if (openshift_metrics_cassandra_limits_cpu is not none
- or openshift_metrics_cassandra_limits_memory is not none)
- %}
- limits:
- {% if openshift_metrics_cassandra_limits_cpu is not none %}
- cpu: "{{openshift_metrics_cassandra_limits_cpu}}"
- {% endif %}
- {% if openshift_metrics_cassandra_limits_memory is not none %}
- memory: "{{openshift_metrics_cassandra_limits_memory}}"
- {% endif %}
- {% endif %}
- {% if (openshift_metrics_cassandra_requests_cpu is not none
- or openshift_metrics_cassandra_requests_memory is not none)
- %}
- requests:
- {% if openshift_metrics_cassandra_requests_cpu is not none %}
- cpu: "{{openshift_metrics_cassandra_requests_cpu}}"
- {% endif %}
- {% if openshift_metrics_cassandra_requests_memory is not none %}
- memory: "{{openshift_metrics_cassandra_requests_memory}}"
- {% endif %}
- {% endif %}
- {% endif %}
- readinessProbe:
- exec:
- command:
- - "/opt/apache-cassandra/bin/cassandra-docker-ready.sh"
- lifecycle:
- preStop:
- exec:
- command:
- - "/opt/apache-cassandra/bin/cassandra-prestop.sh"
- postStart:
- exec:
- command:
- - "/opt/apache-cassandra/bin/cassandra-poststart.sh"
- terminationGracePeriodSeconds: 1800
- volumes:
- - name: cassandra-data
- {% if openshift_metrics_cassandra_storage_type == 'emptydir' %}
- emptyDir: {}
- {% else %}
- persistentVolumeClaim:
- claimName: "{{ openshift_metrics_cassandra_pvc_prefix }}-{{ node }}"
- {% endif %}
- - name: hawkular-cassandra-certs
- secret:
- secretName: hawkular-cassandra-certs
|