Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[K8C-75] initial medusa integration #29

Merged
merged 5 commits into from
Nov 13, 2020
Merged

[K8C-75] initial medusa integration #29

merged 5 commits into from
Nov 13, 2020

Conversation

jsanda
Copy link
Contributor

@jsanda jsanda commented Nov 13, 2020

Summary of changes:

  • Deploy medusa-operator
  • Update patched version of cass-operator
  • Update cassdc.yaml template to deploy medusa restore initContainer
  • Update cassdc.yaml template to deploy medusa backup container

Still on the TODO list:

  • Add a chart for creating a backup
  • Add a chart for creating a restore

Copy link
Member

@bradfordcp bradfordcp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A bunch of nits and one confusing variable name. The comments regarding k8ssandra docker org are not blockers.

# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
version: 0.1.0
version: 0.4.0

Version number must match other charts

{{ include "backup.labels" . | indent 4 }}
spec:
name: {{ .Values.name }}
cassandraDatacenter: {{ .Values.cassandraDatacenter.name }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
cassandraDatacenter: {{ .Values.cassandraDatacenter.name }}
cassandraDatacenter: {{ .Values.cassandraDatacenter.name }}

Newline at end of file

name: backup

cassandraDatacenter:
name: dc1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
name: dc1
name: dc1

Newline at end of file

secret:
secretName: {{ .Values.backupRestore.medusa.bucketSecret }}
{{- end }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
{{- end }}
{{- end }}

Newline at end of file

name: {{ .Release.Name }}-medusa-operator-k8ssandra
labels:
{{ include "k8ssandra-cluster.labels" . | indent 4 }}
{{- end }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
{{- end }}
{{- end }}

Newline at end of file


# Must be set and specify the name of the secret that stores the key file for Google
# Cloud or AWS
bucketSecret: ""
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was confusing at first glance. I know GCS uses a key file, what does this look like for AWS? I was looking for the ACCESS KEY and SECRET KEY fields. Seeing the word SECRET here made me think we were missing an ACCESS field.

The comment makes it clearer, but maybe we should have a different parameter name like cloudSecretCredentialsFile.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an area than needs some TLC. Medusa looks for an AWS conf file that looks like this:

[default]
aws_access_key_id = my_key_id
aws_secret_access_key = my_secret_key

And the secret I have been using looks like this:

apiVersion: v1
kind: Secret
metadata:
  name: medusa-bucket-key
type: Opaque
stringData:
  medusa_s3_credentials: |-
    [default]
    aws_access_key_id = my_key_id
    aws_secret_access_key = my_secret_key

If there is a way for the user to securely pass his key and secret key, then we could create the secret. For now, I am deferring to the user to create the secret. I do not really like that. It is too many moving parts.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Totally cool with that, maybe the comment should say this is a k8s secret? I would consider putting most of your comment in a doc block (and making sure @johnsmartco is aware of it for the docs reference section).

# We need to use a patched version of cass-operator for now that has changes needed in
# for Reaper and Medusa integration. Images will be built from
# https://github.com/jsanda/cass-operator/tree/k8ssandra.
image: jsanda/cass-operator:91205f4d8f1e
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment re: k8ssandra docker org. Although we should get 1.5 cut and use the upstream image.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some of the changes in this patched version are in my Reaper PR which has not gotten any attention in a while. And then there is a not so pleasant bug with volumes and podTemplateSpec. Lastly, we need changes for Medusa support. None of that stuff will be in 1.5 :(

# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
version: 0.1.0
version: 0.4.0

Update to match version numbers in other charts. We may want to make a script to handle updating this...

name: {{ .Values.cassandraDatacenter.name }}
# The CRD currently requires clusterName but the operator uses reuses the cluster name
# from the backup CassandraDatacenter
clusterName: {{ .Values.cassandraDatacenter.name }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
clusterName: {{ .Values.cassandraDatacenter.name }}
clusterName: {{ .Values.cassandraDatacenter.name }}

New line at end of file


# Must be set and specify the name of the secret that stores the key file for Google
# Cloud or AWS
bucketSecret: ""
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Totally cool with that, maybe the comment should say this is a k8s secret? I would consider putting most of your comment in a doc block (and making sure @johnsmartco is aware of it for the docs reference section).

@bradfordcp bradfordcp merged commit a3a299e into main Nov 13, 2020
@bradfordcp bradfordcp deleted the k8c-75 branch November 13, 2020 18:49
@jsanda jsanda self-assigned this Nov 19, 2020
@jsanda jsanda added this to the KubeCon milestone Nov 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants