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

create token for sa prometheus-k8s if not exists #40

Merged
merged 1 commit into from
Jun 7, 2022

Conversation

qiliRedHat
Copy link
Contributor

Description

create token for sa prometheus-k8s if not exists

Fixes

#39

@qiliRedHat
Copy link
Contributor Author

qiliRedHat commented Jun 7, 2022

Limitation: sa not working for kubectl, but the problem with the command create token is that is not available in "old" oc clients and it's not backwards compatible.

 % kubectl version --client=true --short
Flag --short has been deprecated, and will be removed in the future. The --short output will become the default.
Client Version: v1.24.0-beta.0
Kustomize Version: v4.5.4

% kubectl sa
error: unknown command "sa" for "kubectl"

Did you mean this?
	set
	cp

@qiliRedHat
Copy link
Contributor Author

Test with oc - Passed

 % ./deploy.sh 


    ____  _ __  __        __
   / __ \(_) /_/ /___  __/ /_  ____  ____  ____  ___  _____
  / / / / / __/ __/ / / / __ \/ __ \/ __ \/ __ \/ _ \/ ___/
 / /_/ / / /_/ /_/ /_/ / /_/ / /_/ / /_/ / /_/ /  __/ /
/_____/_/\__/\__/\__, /_.___/\____/ .___/ .___/\___/_/
                /____/           /_/   /_/


Using k8s command: oc
Using namespace: dittybopper
Using default grafana password: admin

Getting environment vars...
Command "get-token" is deprecated, and will be removed in the future version. Use oc create token instead.
Prometheus URL is: https://prometheus-k8s-openshift-monitoring.apps.qili-preserve-az410.qe.azure.devcluster.openshift.com
Prometheus bearer token collected.

Creating namespace...
Looks like the namespace dittybopper already exists, deleting it
namespace "dittybopper" deleted
namespace/dittybopper created

Deploying Grafana...
service/dittybopper created
route.route.openshift.io/dittybopper created
deployment.apps/dittybopper created
configmap/sc-ocp-prom created
configmap/sc-grafana-config created

Waiting for dittybopper deployment to be available...
deployment.apps/dittybopper condition met

You can access the Grafana instance at http://dittybopper-dittybopper.apps.qili-preserve-az410.qe.azure.devcluster.openshift.com

Test with kubectl - Failed as the known limitation in the above comment.

% ./deploy.sh -c kubectl


    ____  _ __  __        __
   / __ \(_) /_/ /___  __/ /_  ____  ____  ____  ___  _____
  / / / / / __/ __/ / / / __ \/ __ \/ __ \/ __ \/ _ \/ ___/
 / /_/ / / /_/ /_/ /_/ / /_/ / /_/ / /_/ / /_/ /  __/ /
/_____/_/\__/\__/\__, /_.___/\____/ .___/ .___/\___/_/
                /____/           /_/   /_/


Using k8s command: kubectl
Using namespace: dittybopper
Using default grafana password: admin

Getting environment vars...
error: unknown command "sa" for "kubectl"

Did you mean this?
	set
	cp
error: unknown command "sa" for "kubectl"

Did you mean this?
	set
	cp
Prometheus URL is: https://prometheus-k8s-openshift-monitoring.apps.qili-preserve-az410.qe.azure.devcluster.openshift.com
ERROR: Prometheus bearer token is not collected.

@qiliRedHat
Copy link
Contributor Author

@rsevilla87 PTAL

@rsevilla87 rsevilla87 self-requested a review June 7, 2022 09:34
Copy link
Member

@rsevilla87 rsevilla87 left a comment

Choose a reason for hiding this comment

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

LGTM!

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.

2 participants