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

Recreate the k8s-authenticated-test GCP project as k8s-staging-authenticated-test on kubernetes.io GCP Org #5854

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions infra/gcp/bash/ensure-main-project.sh
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ readonly DNS_GROUP="k8s-infra-dns-admins@kubernetes.io"
# - entry syntax is "bucket_name:owners_group" (: is invalid bucket name char)
readonly TERRAFORM_STATE_BUCKET_ENTRIES=(
"${LEGACY_CLUSTER_TERRAFORM_BUCKET}:${CLUSTER_ADMINS_GROUP}"
k8s-staging-authenticated-test-tf:"${CLUSTER_ADMINS_GROUP}"
k8s-infra-tf-aws:k8s-infra-aws-admins@kubernetes.io
k8s-infra-tf-fastly:k8s-infra-fastly-admins@kubernetes.io
k8s-infra-tf-gcp:k8s-infra-gcp-org-admins@kubernetes.io
Expand Down
2 changes: 2 additions & 0 deletions infra/gcp/infra.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -345,3 +345,5 @@ infra:
k8s-staging-win-op-rdnss:
k8s-staging-gcb-untrusted:
managed_by: infra/gcp/bash/ensure-staging-gcb-untrusted.sh
k8s-staging-authenticated-test:
managed_by: infra/gcp/terraform/k8s-staging-authenticated-test/main.tf
3 changes: 3 additions & 0 deletions infra/gcp/terraform/k8s-staging-authenticated-test/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# k8s-staging-authenticated-test

This projects holds docker images that are used to test private image pulls.
43 changes: 43 additions & 0 deletions infra/gcp/terraform/k8s-staging-authenticated-test/images.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/*
Copyright 2023 The Kubernetes Authors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

// Enable services needed for the project
resource "google_project_service" "project" {
project = google_project.project.id

for_each = toset([
"artifactregistry.googleapis.com",
])

service = each.key
}

// Create the docker registry
resource "google_artifact_registry_repository" "images" {
location = "us-central1"
project = google_project_service.project
repository_id = "images"
description = "e2e private pulls testing"
format = "DOCKER"
}

resource "google_artifact_registry_repository_iam_member" "member" {
project = google_artifact_registry_repository.images.project
location = google_artifact_registry_repository.images.location
repository = google_artifact_registry_repository.images.name
role = "roles/artifactregistry.reader"
member = "allAuthenticatedUsers"
}
32 changes: 32 additions & 0 deletions infra/gcp/terraform/k8s-staging-authenticated-test/provider.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
Copyright 2023 The Kubernetes Authors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

terraform {
backend "gcs" {
bucket = "k8s-staging-authenticated-test-tf"
}

required_providers {
google = {
source = "hashicorp/google"
version = "~> 4.38.0"
}
google-beta = {
source = "hashicorp/google-beta"
version = "~> 4.38.0"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/*
Copyright 2023 The Kubernetes Authors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

project_id = "k8s-staging-authenticated-test"
19 changes: 19 additions & 0 deletions infra/gcp/terraform/k8s-staging-authenticated-test/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
Copyright 2023 The Kubernetes Authors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

variable "project_id" {
type = string
}
24 changes: 24 additions & 0 deletions infra/gcp/terraform/k8s-staging-authenticated-test/versions.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
Copyright 2022 The Kubernetes Authors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

/*
This file defines:
- Required Terraform version
*/

terraform {
required_version = "~> 1.2.0"
}