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

Initial work for clouds secrets and user-defined configmap #205

Closed

Conversation

alourie
Copy link
Contributor

@alourie alourie commented Jul 26, 2019

WIP, can be used to push backup secrets
Signed-off-by: Alex Lourie [email protected]

Fixes instaclustr#213
Fixes instaclustr#208

* Fixed some comments from PR review
* Added Env to CRD to allow specifying environment for containers
(exists in java version)
* Added userConfigMap handling (instaclustr#213)
* Restored PrivelegedSupported handling (instaclustr#208)
* Backup secret volume allows providing GOOGLE_APPLICATION_CREDENTIALS
in a secret
* Cloud providers creds can be set using Env field in CRD

Signed-off-by: Alex Lourie <[email protected]>
@alourie
Copy link
Contributor Author

alourie commented Aug 1, 2019

@zegelin Latest allows setting env vars for various purposes including cloud providers creds; backupSecretVolume allows pushing google creds as a file. Also, restored PrivilegedSupported. Also now works with custom userConfigMaps.

Fixes #213
Fixes #208 ? maybe

@@ -165,7 +212,7 @@ func newSysctlLimitsContainer(cdc *cassandraoperatorv1alpha1.CassandraDataCenter
Image: cdc.Spec.CassandraImage,
ImagePullPolicy: cdc.Spec.ImagePullPolicy,
SecurityContext: &corev1.SecurityContext{
Privileged: func() *bool { b := true; return &b }(),
Privileged: boolRef(cdc.Spec.PrivilegedSupported),
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a point in running the sysctl init container unprivileged? Shouldn't we completely drop the container if cdc.Spec.PrivilegedSupported == false?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's a very good question. In Java version we did this, so I assumed we might want to do this here too. The cluster seems to be working fine in my local testing, but I'm not sure it actually tests this flow properly.

Copy link
Contributor

@johananl johananl Aug 5, 2019

Choose a reason for hiding this comment

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

Here is what happens when the sysctl container runs unprivileged:

kubectl logs -f cassandra-test-dc-cassandra-0 -c sysctl-limits
+ sysctl -w vm.max_map_count=1048575
sysctl: setting key "vm.max_map_count": Read-only file system
+ true

The pod starts fine because we're doing || true, however it has no effect in this case as it cannot modify the setting on the host.

AFAICT we can drop this container when we can't run as privileged.

@alourie
Copy link
Contributor Author

alourie commented Aug 6, 2019

Superseded by #218

@alourie alourie deleted the envAndMaps branch August 6, 2019 01:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants