Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
494 changes: 469 additions & 25 deletions .github/workflows/maven.yml

Large diffs are not rendered by default.

34 changes: 34 additions & 0 deletions helm/atlas-read/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
apiVersion: v2
name: atlas-read
description: Apache Atlas Read Replica for Metadata Management
type: application
version: 1.0.0
appVersion: "3.0.0" # Will be updated by CI with commit ID
maintainers:
- name: Atlan Engineering
email: [email protected]
keywords:
- atlas
- atlas-read
- metadata
- read-replica
- apache-atlas
sources:
- https://github.com/atlanhq/atlas-metastore
home: https://github.com/atlanhq/atlas-metastore
dependencies:
# Infrastructure charts - disabled by default (published separately as OCI)
# Charts exist in charts/ subdirectory for individual OCI publishing
# Consumed as peers in parent atlan chart, not as subcharts here
- name: cassandra-online-dc
repository: file://./charts/cassandra-online-dc
version: 0.x.x
condition: cassandra-online-dc.enabled # Disabled in values.yaml
- name: elasticsearch-read
repository: file://./charts/elasticsearch-read
version: 7.x.x
condition: elasticsearch-read.enabled # Disabled in values.yaml
- name: elasticsearch-exporter-read
repository: file://./charts/elasticsearch-exporter-read
version: 3.3.0
condition: elasticsearch-exporter-read.enabled # Disabled in values.yaml
2 changes: 2 additions & 0 deletions helm/atlas-read/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# atlas
This chart will install the apache atlas which use elasticsearch and cassandra.
17 changes: 17 additions & 0 deletions helm/atlas-read/charts/cassandra-online-dc/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
# Common backup files
*.swp
*.bak
*.tmp
*~
# Various IDEs
.project
.idea/
*.tmproj
OWNERS
19 changes: 19 additions & 0 deletions helm/atlas-read/charts/cassandra-online-dc/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
apiVersion: v2
appVersion: 3.11.5
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.
engine: gotpl
home: http://cassandra.apache.org
icon: https://upload.wikimedia.org/wikipedia/commons/thumb/5/5e/Cassandra_logo.svg/330px-Cassandra_logo.svg.png
keywords:
- cassandra
- database
- nosql
maintainers:
- email: [email protected]
name: KongZ
- email: [email protected]
name: maorfr
name: cassandra-online-dc
version: 0.14.4
215 changes: 215 additions & 0 deletions helm/atlas-read/charts/cassandra-online-dc/README.md

Large diffs are not rendered by default.

35 changes: 35 additions & 0 deletions helm/atlas-read/charts/cassandra-online-dc/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
Cassandra CQL can be accessed via port {{ .Values.config.ports.cql }} on the following DNS name from within your cluster:
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 "cassandra.name" . }},release={{ .Release.Name }} -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 "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 "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 "cassandra.name" . }},release={{ .Release.Name }}" -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 "cassandra.name" . }},release={{ .Release.Name }} -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 "cassandra.name" . }},release={{ .Release.Name }} -o jsonpath='{ .items[0].metadata.name }')

{{- if not .Values.persistence.enabled }}

Note that the cluster is running with node-local storage instead of PersistentVolumes. In order to prevent data loss,
pods will be decommissioned upon termination. Decommissioning may take some time, so you might also want to adjust the
pod termination gace period, which is currently set to {{ .Values.podSettings.terminationGracePeriodSeconds }} seconds.

{{- end}}
43 changes: 43 additions & 0 deletions helm/atlas-read/charts/cassandra-online-dc/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "cassandra.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "cassandra.fullname" -}}
{{- if .Values.fullnameOverride -}}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- if contains $name .Release.Name -}}
{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{- end -}}
{{- end -}}

{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "cassandra.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{/*
Create the name of the service account to use
*/}}
{{- define "cassandra.serviceAccountName" -}}
{{- if .Values.serviceAccount.create -}}
{{ default (include "cassandra.fullname" .) .Values.serviceAccount.name }}
{{- else -}}
{{ default "default" .Values.serviceAccount.name }}
{{- end -}}
{{- end -}}
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
{{- if or .Values.global.svcIsolation.enabled .Values.global.globalSvcIsolation.enabled }}
{{- if .Values.backup.enabled }}
{{- $release := .Release }}
{{- $values := .Values }}
{{- $backup := $values.backup }}
{{- range $index, $schedule := $backup.schedule }}
---
apiVersion: batch/v1beta1
kind: CronJob
metadata:
name: {{ template "cassandra.fullname" $ }}-backup
namespace: {{ $.Values.Namespace }}
labels:
app: {{ template "cassandra.name" $ }}-cain
chart: {{ template "cassandra.chart" $ }}
release: "{{ $release.Name }}"
heritage: "{{ $release.Service }}"
spec:
schedule: {{ $schedule.cron | quote }}
concurrencyPolicy: Forbid
startingDeadlineSeconds: 120
jobTemplate:
spec:
template:
metadata:
annotations:
{{ toYaml $backup.annotations }}
spec:
restartPolicy: OnFailure
serviceAccountName: {{ template "cassandra.serviceAccountName" $ }}
{{- with $.Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- $multiarchEnabled := and $.Values.multiarch (eq $.Values.multiarch.enabled true) }}
{{- if or $.Values.tolerations $multiarchEnabled }}
tolerations:
{{- if $.Values.tolerations }}
{{ toYaml $.Values.tolerations | nindent 12 }}
{{- end }}
{{- if $multiarchEnabled }}
- key: "archtype"
operator: "Equal"
value: "arm64"
effect: "NoSchedule"
{{- end }}
{{- end }}
containers:
- name: cassandra-backup
{{- if and $.Values.multiarch.enabled $.Values.multiarch.image.cain }}
image: {{ $.Values.multiarch.image.cain }}
{{- else }}
image: "{{ $backup.image.repository }}:{{ $backup.image.tag }}"
{{- end }}
command: ["cain"]
args:
- backup
- --namespace
- {{ $release.Namespace }}
- --selector
- release={{ $release.Name }},app={{ template "cassandra.name" $ }}
- --keyspace
- {{ $schedule.keyspace }}
- --dst
- {{ $backup.destination }}
{{- with $backup.extraArgs }}
{{ toYaml . | indent 12 }}
{{- end }}
env:
{{- if $backup.google.serviceAccountSecret }}
- name: GOOGLE_APPLICATION_CREDENTIALS
value: "/etc/secrets/google/credentials.json"
{{- end }}
{{- with $backup.env }}
{{ toYaml . | indent 12 }}
{{- end }}
{{- $tierType := $.Values.global.Tier_Type | default "" }}
{{- if or (eq $tierType "Enterprise") (eq $tierType "") }}
{{- with $backup.resources }}
resources:
{{ toYaml . | indent 14 }}
{{- end }}
{{- end }}
{{- if $backup.google.serviceAccountSecret }}
volumeMounts:
- name: google-service-account
mountPath: /etc/secrets/google/
{{- end }}
{{- if $backup.google.serviceAccountSecret }}
volumes:
- name: google-service-account
secret:
secretName: {{ $backup.google.serviceAccountSecret | quote }}
{{- end }}
affinity:
podAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 1
podAffinityTerm:
labelSelector:
matchExpressions:
- key: app
operator: In
values:
- {{ template "cassandra.fullname" $ }}
- key: release
operator: In
values:
- {{ $release.Name }}
topologyKey: "kubernetes.io/hostname"
{{- with $values.tolerations }}
tolerations:
{{ toYaml . | indent 12 }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
{{- if or .Values.global.svcIsolation.enabled .Values.global.globalSvcIsolation.enabled }}
{{- if .Values.backup.enabled }}
{{- if .Values.serviceAccount.create }}
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ template "cassandra.serviceAccountName" . }}
namespace: {{ .Values.Namespace }}
labels:
app: {{ template "cassandra.name" . }}
chart: {{ template "cassandra.chart" . }}
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
---
{{- end }}
{{- if .Values.rbac.create }}
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: {{ template "cassandra.fullname" . }}-backup
namespace: {{ .Values.Namespace }}
labels:
app: {{ template "cassandra.name" . }}
chart: {{ template "cassandra.chart" . }}
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
rules:
- apiGroups: [""]
resources: ["pods", "pods/log"]
verbs: ["get", "list"]
- apiGroups: [""]
resources: ["pods/exec"]
verbs: ["create"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: {{ template "cassandra.fullname" . }}-backup
namespace: {{ .Values.Namespace }}
labels:
app: {{ template "cassandra.name" . }}
chart: {{ template "cassandra.chart" . }}
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: {{ template "cassandra.fullname" . }}-backup
subjects:
- kind: ServiceAccount
name: {{ template "cassandra.serviceAccountName" . }}
namespace: {{ .Release.Namespace }}
{{- end }}
{{- end }}
{{- end }}
Loading
Loading