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

Fetch and set up secret for skaffold-metrics project #6104

Merged

Conversation

tejal29
Copy link
Contributor

@tejal29 tejal29 commented Jun 29, 2021

In this PR

  1. Use secret from newly created project
  2. Drop the 2 weeks validity as longer keys exist.

No code change required for instrumentation as project id is derived from the secret itself.

Earlier dashboard can be used as k8s-skaffold is defines as scoped project https://cloud.google.com/monitoring/settings#concept-scope

@tejal29 tejal29 requested a review from a team as a code owner June 29, 2021 05:46
@tejal29 tejal29 requested a review from aaron-prindle June 29, 2021 05:46
@google-cla google-cla bot added the cla: yes label Jun 29, 2021
while read -r KEY_ID
do
if gsutil cp gs://${BUCKET_ID}/${KEY_ID}.json ${KEY_FILE}; then
if gsutil cp gs://${BUCKET_ID}/${LATEST_GCS_PATH}.json ${KEY_FILE}; then
Copy link
Contributor

Choose a reason for hiding this comment

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

LATEST_GCS_PATH=keys.json so I think this will be keys.json.json

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed.

@@ -30,10 +31,10 @@ done

function download_existing_key() {
# Download a valid key created within the past two weeks.
KEY_IDS=$(gcloud iam service-accounts keys list --iam-account=metrics-writer@k8s-skaffold.iam.gserviceaccount.com --project=k8s-skaffold --managed-by=user --filter="validAfterTime>-P2W" --format="value(name)")
KEY_IDS=$(gcloud iam service-accounts keys list --iam-account=metrics-writer@${METRICS_PROJECT_ID}.iam.gserviceaccount.com --project=${METRICS_PROJECT_ID} --managed-by=user --format="value(name)")
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: is this still needed? --filter="validAfterTime>-P2W" I'm guessing that w/ the new project and expiration date it isn't, just verifying

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah. new keys live longer and hence we don't need that check.

@tejal29 tejal29 force-pushed the use_skaffold_metrics_prj branch from 5d7ae87 to 118a557 Compare June 29, 2021 05:58
@tejal29 tejal29 force-pushed the use_skaffold_metrics_prj branch from 118a557 to b9c4244 Compare June 29, 2021 05:59
@codecov
Copy link

codecov bot commented Jun 29, 2021

Codecov Report

Merging #6104 (b9c4244) into master (7b496d2) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #6104   +/-   ##
=======================================
  Coverage   70.18%   70.18%           
=======================================
  Files         475      475           
  Lines       18156    18156           
=======================================
  Hits        12743    12743           
  Misses       4476     4476           
  Partials      937      937           
Impacted Files Coverage Δ
pkg/skaffold/server/server.go 41.96% <0.00%> (ø)

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 7b496d2...b9c4244. Read the comment docs.

Copy link
Contributor

@aaron-prindle aaron-prindle left a comment

Choose a reason for hiding this comment

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

LGTM

@tejal29 tejal29 enabled auto-merge (squash) June 29, 2021 06:14
@tejal29 tejal29 merged commit d9fc771 into GoogleContainerTools:master Jun 29, 2021
@tejal29 tejal29 deleted the use_skaffold_metrics_prj branch July 21, 2021 17:39
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.

2 participants