diff --git a/incubator/cassandra/Chart.yaml b/incubator/cassandra/Chart.yaml index f3677c8ff897..0835d9ebc9e7 100644 --- a/incubator/cassandra/Chart.yaml +++ b/incubator/cassandra/Chart.yaml @@ -1,6 +1,8 @@ name: cassandra -version: 0.1.2 -description: Apache Cassandra is a free and open-source distributed database management system designed to handle large amounts of data across many commodity servers, providing high availability with no single point of failure. +version: 0.1.3 +description: Apache Cassandra is a free and open-source distributed database management + system designed to handle large amounts of data across many commodity servers, providing + high availability with no single point of failure. icon: https://upload.wikimedia.org/wikipedia/commons/5/5e/Cassandra_logo.svg keywords: - cassandra diff --git a/incubator/cassandra/templates/NOTES.txt b/incubator/cassandra/templates/NOTES.txt index 5c4ae91e3398..0c9becb542c3 100644 --- a/incubator/cassandra/templates/NOTES.txt +++ b/incubator/cassandra/templates/NOTES.txt @@ -2,26 +2,26 @@ Cassandra CQL can be accessed via port {{ .Values.config.ports.cql }} on the fol Cassandra Thrift can be accessed via port {{ .Values.config.ports.thrift }} on the following DNS name from within your cluster: If you want to connect to the remote instance with your local Cassandra CQL cli. To forward the API port to localhost:9042 run the following: -- kubectl port-forward --namespace {{ .Release.Namespace }} $(kubectl get pods --namespace {{ .Release.Namespace }} -l app={{ template "fullname" . }} -o jsonpath='{ .items[0].metadata.name }') 9042:{{ .Values.config.ports.cql }} +- kubectl port-forward --namespace {{ .Release.Namespace }} $(kubectl get pods --namespace {{ .Release.Namespace }} -l app={{ template "cassandra.fullname" . }} -o jsonpath='{ .items[0].metadata.name }') 9042:{{ .Values.config.ports.cql }} If you want to connect to the Cassandra CQL run the following: {{- if contains "NodePort" .Values.service.type }} -- export CQL_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ template "fullname" . }}) +- export CQL_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ template "cassandra.fullname" . }}) - export CQL_HOST=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") - cqlsh $CQL_HOST $CQL_PORT {{- else if contains "LoadBalancer" .Values.service.type }} NOTE: It may take a few minutes for the LoadBalancer IP to be available. - Watch the status with: 'kubectl get svc --namespace {{ .Release.Namespace }} -w {{ template "fullname" . }}' -- export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}') + Watch the status with: 'kubectl get svc --namespace {{ .Release.Namespace }} -w {{ template "cassandra.fullname" . }}' +- export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "cassandra.fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}') - echo cqlsh $SERVICE_IP {{- else if contains "ClusterIP" .Values.service.type }} -- kubectl port-forward --namespace {{ .Release.Namespace }} $(kubectl get pods --namespace {{ .Release.Namespace }} -l "app={{ template "fullname" . }}" -o jsonpath="{.items[0].metadata.name}") 9042:{{ .Values.config.ports.cql }} +- kubectl port-forward --namespace {{ .Release.Namespace }} $(kubectl get pods --namespace {{ .Release.Namespace }} -l "app={{ template "cassandra.fullname" . }}" -o jsonpath="{.items[0].metadata.name}") 9042:{{ .Values.config.ports.cql }} echo cqlsh 127.0.0.1 9042 {{- end }} You can also see the cluster status by run the following: -- kubectl exec -it --namespace {{ .Release.Namespace }} $(kubectl get pods --namespace {{ .Release.Namespace }} -l app={{ template "fullname" . }} -o jsonpath='{.items[0].metadata.name}') nodetool status +- kubectl exec -it --namespace {{ .Release.Namespace }} $(kubectl get pods --namespace {{ .Release.Namespace }} -l app={{ template "cassandra.fullname" . }} -o jsonpath='{.items[0].metadata.name}') nodetool status To tail the logs for the Cassandra pod run the following: -- kubectl logs -f --namespace {{ .Release.Namespace }} $(kubectl get pods --namespace {{ .Release.Namespace }} -l app={{ template "fullname" . }} -o jsonpath='{ .items[0].metadata.name }') +- kubectl logs -f --namespace {{ .Release.Namespace }} $(kubectl get pods --namespace {{ .Release.Namespace }} -l app={{ template "cassandra.fullname" . }} -o jsonpath='{ .items[0].metadata.name }') diff --git a/incubator/cassandra/templates/_helpers.tpl b/incubator/cassandra/templates/_helpers.tpl index 0a4d57d2c575..d5831bc2fcc7 100644 --- a/incubator/cassandra/templates/_helpers.tpl +++ b/incubator/cassandra/templates/_helpers.tpl @@ -2,7 +2,7 @@ {{/* Expand the name of the chart. */}} -{{- define "name" -}} +{{- define "cassandra.name" -}} {{- default .Chart.Name .Values.nameOverride | trunc 21 -}} {{- end -}} @@ -11,7 +11,7 @@ Create a default fully qualified app name. We truncate at 21 chars because Kubernetes name fields are limited to 24 (by the DNS naming spec) and Statefulset will append -xx at the end of name. */}} -{{- define "fullname" -}} +{{- define "cassandra.fullname" -}} {{- $name := default .Chart.Name .Values.nameOverride -}} {{- printf "%s-%s" .Release.Name $name | trunc 21 -}} {{- end -}} diff --git a/incubator/cassandra/templates/cassandra-statefulset.yaml b/incubator/cassandra/templates/cassandra-statefulset.yaml index 326e852425d6..5110a233e364 100644 --- a/incubator/cassandra/templates/cassandra-statefulset.yaml +++ b/incubator/cassandra/templates/cassandra-statefulset.yaml @@ -1,9 +1,9 @@ apiVersion: v1 kind: Service metadata: - name: {{ template "fullname" . }} + name: {{ template "cassandra.fullname" . }} labels: - app: {{ template "fullname" . }} + app: {{ template "cassandra.fullname" . }} chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" release: "{{ .Release.Name }}" heritage: "{{ .Release.Service }}" @@ -27,30 +27,30 @@ spec: port: {{ default 9160 .Values.config.ports.thrift }} targetPort: {{ default 9160 .Values.config.ports.thrift }} selector: - app: {{ template "fullname" . }} + app: {{ template "cassandra.fullname" . }} --- apiVersion: apps/v1beta1 kind: StatefulSet metadata: - name: {{ template "fullname" . }} + name: {{ template "cassandra.fullname" . }} labels: - app: {{ template "fullname" . }} + app: {{ template "cassandra.fullname" . }} chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" release: "{{ .Release.Name }}" heritage: "{{ .Release.Service }}" spec: - serviceName: {{ template "fullname" . }} + serviceName: {{ template "cassandra.fullname" . }} replicas: {{ .Values.config.cluster_size }} template: metadata: labels: - app: {{ template "fullname" . }} + app: {{ template "cassandra.fullname" . }} spec: {{- if .Values.selector }} {{ toYaml .Values.selector | indent 6 }} {{- end }} containers: - - name: {{ template "fullname" . }} + - name: {{ template "cassandra.fullname" . }} image: "{{ .Values.image.repo }}:{{ .Values.image.tag }}" imagePullPolicy: {{ .Values.image.pullPolicy | quote }} resources: @@ -59,7 +59,7 @@ spec: {{- $seed_size := default 1 .Values.config.seed_size | int -}} {{- $global := . }} - name: CASSANDRA_SEEDS - value: "{{- range $i, $e := until $seed_size }}{{ template "fullname" $global }}-{{ $i }}.{{ template "fullname" $global }}.{{ $global.Release.Namespace }}.svc.cluster.local,{{- end }}" + value: "{{- range $i, $e := until $seed_size }}{{ template "cassandra.fullname" $global }}-{{ $i }}.{{ template "cassandra.fullname" $global }}.{{ $global.Release.Namespace }}.svc.cluster.local,{{- end }}" - name: MAX_HEAP_SIZE value: {{ default "8192M" .Values.config.max_heap_size | quote }} - name: HEAP_NEWSIZE @@ -109,7 +109,7 @@ spec: - metadata: name: data labels: - app: {{ template "fullname" . }} + app: {{ template "cassandra.fullname" . }} chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" release: "{{ .Release.Name }}" heritage: "{{ .Release.Service }}"