-
Notifications
You must be signed in to change notification settings - Fork 438
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
PMM-13748 gssapi support #1042
base: main
Are you sure you want to change the base?
PMM-13748 gssapi support #1042
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestions for improvement
docker-compose.yml
Outdated
build: | ||
dockerfile: ./docker/kerberos.dockerfile |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we have pre-built docker image, so we don' have to build it everytime
Makefile
Outdated
@@ -71,7 +71,7 @@ init: ## Install linters | |||
cd tools && go generate -x -tags=tools | |||
|
|||
build: ## Compile using plain go build | |||
go build -ldflags="$(GO_BUILD_LDFLAGS)" -o $(PMM_RELEASE_PATH)/mongodb_exporter | |||
env CGO_ENABLED=1 go build -ldflags="$(GO_BUILD_LDFLAGS)" -o $(PMM_RELEASE_PATH)/mongodb_exporter -tags gssapi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
env CGO_ENABLED=1 go build -ldflags="$(GO_BUILD_LDFLAGS)" -o $(PMM_RELEASE_PATH)/mongodb_exporter -tags gssapi | |
CGO_ENABLED=1 go build -ldflags="$(GO_BUILD_LDFLAGS)" -o $(PMM_RELEASE_PATH)/mongodb_exporter -tags gssapi |
There is no need to pass all of the environment variables to Go.
exporter/exporter_test.go
Outdated
"mongodb_up", | ||
} | ||
err = testutil.CollectAndCompare(gc, expected, filter...) | ||
assert.NoError(t, err, "mongodb_up metric should be 1") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
assert.NoError(t, err, "mongodb_up metric should be 1") | |
require.NoError(t, err, "mongodb_up metric should be 1") |
@@ -0,0 +1,4 @@ | |||
#!/bin/bash | |||
|
|||
docker exec --user root psmdb-kerberos bash -c 'chown mongodb:root /krb5/mongodb.keytab' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
docker exec --user root psmdb-kerberos bash -c 'chown mongodb:root /krb5/mongodb.keytab' | |
docker exec --user root psmdb-kerberos bash -c 'chown mongodb:mongodb /krb5/mongodb.keytab' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like there's no mongodb
group, only the user.
password=${MONGO_INITDB_ROOT_PASSWORD} | ||
|
||
echo "Waiting for startup.." | ||
until mongosh --host 127.0.0.1:27017 -u ${username} -p ${password} --eval 'quit(db.runCommand({ ping: 1 }).ok ? 0 : 2)' &>/dev/null; do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will loop forever if it's unable to connect. Shall we consider a timeout or a number of retries?
PMM-13748
This adds support for the GSSAPI auth mechanism for the exporter by compiling the binary with the
-tags gssapi
flag. It also adds additional kerberos environment (via docker) for tests.