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

terraform: provision prow-related secrets via terraform #2845

Merged
merged 2 commits into from
Sep 29, 2021

Conversation

spiffxp
Copy link
Member

@spiffxp spiffxp commented Sep 29, 2021

Related:

This moves management of k8s-infra-prow-build-trusted's secrets to terraform

Then follows a similar pattern to setup secrets for k8s-infra-prow-build that will be populated and hooked up to ExternalSecret CRDs as followup

This was written with separate locals blocks to avoid merge conflicts with outstanding terraform PRs for prow

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Sep 29, 2021
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: spiffxp

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added area/bash Bash scripts, testing them, writing less of them, code in infra/gcp/ area/infra Infrastructure management, infrastructure design, code in infra/ approved Indicates a PR has been approved by an approver from all required OWNERS files. area/prow Setting up or working with prow in general, prow.k8s.io, prow build clusters area/terraform Terraform modules, testing them, writing more of them, code in infra/gcp/clusters/ sig/k8s-infra Categorizes an issue or PR as relevant to SIG K8s Infra. sig/testing Categorizes an issue or PR as relevant to SIG Testing. labels Sep 29, 2021
@spiffxp
Copy link
Member Author

spiffxp commented Sep 29, 2021

/hold
Deploying this may require some terraform state import commands

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Sep 29, 2021
Embedded the secret data in a second locals block to avoid merge
conflict with other PRs in flight
@rikatz
Copy link
Contributor

rikatz commented Sep 29, 2021

/lgtm
Thanks

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 29, 2021
@rikatz
Copy link
Contributor

rikatz commented Sep 29, 2021

/hold

@rikatz
Copy link
Contributor

rikatz commented Sep 29, 2021

/hold cancel
🤦

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Sep 29, 2021
@rikatz
Copy link
Contributor

rikatz commented Sep 29, 2021

/hold

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Sep 29, 2021
@k8s-ci-robot k8s-ci-robot merged commit be3242c into kubernetes:main Sep 29, 2021
@k8s-ci-robot k8s-ci-robot added this to the v1.23 milestone Sep 29, 2021
@spiffxp
Copy link
Member Author

spiffxp commented Sep 29, 2021

/hold cancel
all good, I'll deploy now

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Sep 29, 2021
@spiffxp spiffxp deleted the tf-prow-secrets branch September 29, 2021 02:55
@spiffxp
Copy link
Member Author

spiffxp commented Sep 29, 2021

Deployed for k8s-infra-prow-build-trusted

#!/usr/bin/env bash
set -eu
secrets=(
  cncf-ci-github-token
  k8s-infra-kops-e2e-tests-aws-ssh-key
  k8s-triage-robot-github-token
  snyk-token
)
project=k8s-infra-prow-build-trusted

for secret in "${secrets[@]}"; do
  terraform import \
    "google_secret_manager_secret.build_cluster_secrets[\"${secret}\"]" \
    "projects/${project}/secrets/${secret}"
done

terraform apply

@spiffxp
Copy link
Member Author

spiffxp commented Sep 29, 2021

Deployed for k8s-infra-prow-build via terraform apply. I had to run it twice, and opened #2847 to prevent that from happening next time

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/bash Bash scripts, testing them, writing less of them, code in infra/gcp/ area/infra Infrastructure management, infrastructure design, code in infra/ area/prow Setting up or working with prow in general, prow.k8s.io, prow build clusters area/terraform Terraform modules, testing them, writing more of them, code in infra/gcp/clusters/ cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. sig/k8s-infra Categorizes an issue or PR as relevant to SIG K8s Infra. sig/testing Categorizes an issue or PR as relevant to SIG Testing. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants