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

added cassandra credentials support to schema creator #590

Merged
merged 1 commit into from
Oct 14, 2019

Conversation

hacktastic
Copy link
Contributor

No description provided.

Signed-off-by: Jackson Coakley <jackson.coakley@gmail.com>
@hacktastic
Copy link
Contributor Author

This is in response to issue #469 #469

@codecov
Copy link

codecov bot commented Aug 9, 2019

Codecov Report

Merging #590 into master will increase coverage by 0.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #590      +/-   ##
==========================================
+ Coverage   91.24%   91.26%   +0.01%     
==========================================
  Files          73       73              
  Lines        3666     3674       +8     
==========================================
+ Hits         3345     3353       +8     
  Misses        228      228              
  Partials       93       93
Impacted Files Coverage Δ
pkg/storage/cassandra_dependencies.go 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f074040...f722b09. Read the comment docs.

1 similar comment
@codecov
Copy link

codecov bot commented Aug 9, 2019

Codecov Report

Merging #590 into master will increase coverage by 0.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #590      +/-   ##
==========================================
+ Coverage   91.24%   91.26%   +0.01%     
==========================================
  Files          73       73              
  Lines        3666     3674       +8     
==========================================
+ Hits         3345     3353       +8     
  Misses        228      228              
  Partials       93       93
Impacted Files Coverage Δ
pkg/storage/cassandra_dependencies.go 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f074040...f722b09. Read the comment docs.

@jpkrohling
Copy link
Contributor

Thanks for your contribution, @hacktastic. This PR LGTM, but it would be nice to get a positive confirmation from @mfrembs before merging.

@mfrembs: I published an image with this fix: jpkroehling/jaeger-operator:590-Schema-Creator-Cassandra-Credentials . Would you be able to give it a try? To test it, just install the operator as usual, but replace the image property from the operator.yaml by the temporary image with the fix.

@jpkrohling
Copy link
Contributor

@hacktastic while we wait for @mfrembs, would you be able to get a couple of extra tests for this change? Like:

  • None are set
  • Both are set

@hacktastic
Copy link
Contributor Author

Sure thing - let me draw something up

@pavolloffay
Copy link
Member

@hacktastic ping, we are waiting for the tests :)

@mfrembs
Copy link

mfrembs commented Sep 13, 2019

Sorry, but while I was at vacation a collegue of mine switched back to elasticsearch. So I won't be able to test it :-(

Thanks for applying the feature. I really appreciate it.

@shubhanshus
Copy link
Contributor

shubhanshus commented Oct 8, 2019

I used the image jpkroehling/jaeger-operator:590-Schema-Creator-Cassandra-Credentials in my jaeger-operator configuration and was able to see the Cassandra username and password in the environment variables

    Image:      jaegertracing/jaeger-cassandra-schema:1.13
    Port:       <none>
    Host Port:  <none>
    Environment:
      CQLSH_HOST:          10.249.85.166
      MODE:                prod
      DATACENTER:          cluster
      CASSANDRA_USERNAME:  cassandra_user
      CASSANDRA_PASSWORD:  ******

But this didn't solve the problem. I am still getting the same error which @mfrembs was getting earlier

Connection error: ('Unable to connect to any servers', {'10.249.85.166': AuthenticationFailed('Remote end requires authentication.',)})
Cassandra is still not up at 10.249.85.166. Waiting 1 second. 

I am able to connect with the same credentials to my Cassandra server normally. Is there a way by which I can validate if my credentials are passed correctly?

@jpkrohling
Copy link
Contributor

@shubhanshus are you able to enter the container (kubectl exec -it CREATE_SCHEMA_POD_NAME -- /bin/bash should work), and test the following steps?

  1. manually run /cassandra-schema/docker.sh
  2. the above should fail with the same message you got before (auth failed ...)
  3. Run: /usr/bin/cqlsh ${CQLSH_HOST} -u ${CASSANDRA_USERNAME} -p ${CASSANDRA_PASSWORD} . This should succeed, if the credentials are correct.

@shubhanshus
Copy link
Contributor

shubhanshus commented Oct 9, 2019

@jpkrohling thanks for the inputs. After logging into the container I found we have the old version of /cassandra-schema/docker.sh running there which does not contain the changes done for checking the username and password.

Once I updated the /cassandra-schema/docker.sh with the changes from master branch it worked as expected and I was able to connect to Cassandra. Can you help me in getting a new container with updated /cassandra-schema/docker.sh file.

Also, noticed currently we are not passing KEYSPACE variable. I think we should add that too.

I can pick this up if @hacktastic is unable to work on this.

@jpkrohling
Copy link
Contributor

True, looks like jaegertracing/jaeger-cassandra-schema:1.13 still doesn't have that. You could try jaegertracing/jaeger-cassandra-schema:1.14, which looks like master.

@shubhanshus
Copy link
Contributor

Okay, but there is no option to specify that in the jaeger operator. I mean I can run the jaeger-cassandra-schema job separately for using the jaegertracing/jaeger-cassandra-schema:1.14 image.

@jpkrohling
Copy link
Contributor

jpkrohling commented Oct 11, 2019

There is! You have two options: 1. change the setting that is applied to all instances managed by the operator, or 2. override on a per-instance basis.

In time: you should probably consider upgrade your Jaeger Operator to 1.14, as it's better than overriding the individual images. Once you upgrade it, the instances managed by this operator should automatically be updated to Jaeger 1.14.

Option 1:

You can just add a new arg to this line:

args: ["start"]

Like:

          args: ["start", "--jaeger-cassandra-schema-image", "jaegertracing/jaeger-cassandra-schema:1.14"]

You can check all the operator flags by running:

$ docker run jaegertracing/jaeger-operator:1.14.0 start --help
Starts a new Jaeger Operator

Usage:
  jaeger-operator start [flags]

Flags:
      --es-provision string                      Whether to auto-provision an Elasticsearch cluster for suitable Jaeger instances. Possible values: 'yes', 'no', 'auto'. When set to 'auto' and the API name 'logging.openshift.io' is available, auto-provisioning is enabled. (default "auto")
  -h, --help                                     help for start
      --jaeger-agent-image string                The Docker image for the Jaeger Agent (default "jaegertracing/jaeger-agent")
      --jaeger-all-in-one-image string           The Docker image for the Jaeger all-in-one (default "jaegertracing/all-in-one")
      --jaeger-cassandra-schema-image string     The Docker image for the Jaeger Cassandra Schema (default "jaegertracing/jaeger-cassandra-schema")
      --jaeger-collector-image string            The Docker image for the Jaeger Collector (default "jaegertracing/jaeger-collector")
      --jaeger-es-index-cleaner-image string     The Docker image for the Jaeger Elasticsearch Index Cleaner (default "jaegertracing/jaeger-es-index-cleaner")
      --jaeger-es-rollover-image string          The Docker image for the Jaeger Elasticsearch Rollover (default "jaegertracing/jaeger-es-rollover")
      --jaeger-ingester-image string             The Docker image for the Jaeger Ingester (default "jaegertracing/jaeger-ingester")
      --jaeger-query-image string                The Docker image for the Jaeger Query (default "jaegertracing/jaeger-query")
      --jaeger-spark-dependencies-image string   The Docker image for the Spark Dependencies Job (default "jaegertracing/spark-dependencies")
      --jaeger-version string                    Deprecated: the Jaeger version is now managed entirely by the operator. This option is currently no-op. (default "1.14.0")
      --log-level string                         The log-level for the operator. Possible values: trace, debug, info, warning, error, fatal, panic (default "info")
      --metrics-host string                      The host to bind the metrics port (default "0.0.0.0")
      --metrics-port int32                       The metrics port (default 8383)
      --openshift-oauth-proxy-image string       The Docker image location definition for the OpenShift OAuth Proxy (default "openshift/oauth-proxy:latest")
      --platform string                          The target platform the operator will run. Possible values: 'kubernetes', 'openshift', 'auto-detect' (default "auto-detect")

Global Flags:
      --config string   config file (default is $HOME/.jaeger-operator.yaml)

Option 2

Image string `json:"image,omitempty"`

In the Jaeger CR, set the property .Spec.Storace.CassandraCreateSchema.Image, like (untested):

apiVersion: jaegertracing.io/v1
kind: Jaeger
metadata:
  name: with-cassandra
spec:
  storage:
    type: cassandra
    cassandraCreateSchema:
      image: "jaegertracing/jaeger-cassandra-schema:1.14"

@shubhanshus
Copy link
Contributor

shubhanshus commented Oct 11, 2019

Thanks for such detailed steps. I never knew we can do that. Now, the schema creation is working fine and I can use my credentials to login into Cassandra and create schema there.

Though the only thing which I see missing is the possibility of changing KEYSPACE. Currently we're not passing that to the jaeger-cassandra-schema container.

@jpkrohling
Copy link
Contributor

@shubhanshus just to confirm: you are saying that, when using the Operator image that I used for this PR, you are able to successfully get the create-schema running against a Cassandra with auth enabled? If so, I think we are ready to merge this one.

@shubhanshus
Copy link
Contributor

@jpkrohling yes, that is correct. Using jpkroehling/jaeger-operator:590-Schema-Creator-Cassandra-Credentials image I was able to login and create schema on a auth enabled Cassandra DB.

@jpkrohling jpkrohling merged commit 6dab81d into jaegertracing:master Oct 14, 2019
@jpkrohling
Copy link
Contributor

Thanks @shubhanshus for your confirmation, and a big thank you to @hacktastic for the PR (and patience).

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.

5 participants