diff --git a/README.md b/README.md index 53c94ebbb73..5e7bfa07f55 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,7 @@ Kubernetes project infrastructure, managed by the kubernetes comunity via [wg-k8 - `gcsweb`: instance of [gcsweb] at https://gcsweb.k8s.io - owned by [sig-testing] - `kubernetes-external-secrets`: instance of [kubernetes-external-secrets] - owned by [sig-testing] - `node-perf-dash`: instance of [node-perf-dash] - owned by [sig-node] + - `perfdash`: instance of [perfdash] - owned by [sig-scalability] - `publishing-bot`: instance of [publishing-bot] - owned by [sig-release] - `sippy`: instance of [sippy] at https://sippy.k8s.io - owned by [sig-architecture] (on behalf of [wg-reliability]) - `slack-infra`: instance of [slack-infra] including https://slack.k8s.io - owned by [sig-contributor-experience] @@ -21,7 +22,6 @@ Kubernetes project infrastructure, managed by the kubernetes comunity via [wg-k8 - `clusters/projects`: terraform to manage (parts of) GCP projects - `k8s.gcr.io`: container images published by the project, promoted from `gcr.io/k8s-staging-*` repos - `k8s.io`: instance of nginx that provides redirects/reverse-proxying for k8s.io and its subdomains - owned by [sig-contributor-experience] and [sig-testing] (TODO(https://github.com/kubernetes/k8s.io/issues/2150) migrate to apps/) -- `perf-dash.k8s.io`: instance of [perfdash] - owned by [sig-scalability] (TODO(https://github.com/kubernetes/k8s.io/issues/2150) migrate to apps/) - `prow`: work-in-pogress instance of [prow] - owned by [sig-testing] (TODO(https://github.com/kubernetes/k8s.io/issues/2150) migrate to apps/) - `registry.k8s.io`: work-in-progress to support cross-cloud mirroring/hosting of containers and binaries diff --git a/perf-dash.k8s.io/OWNERS b/apps/perfdash/OWNERS similarity index 100% rename from perf-dash.k8s.io/OWNERS rename to apps/perfdash/OWNERS diff --git a/apps/perfdash/README.md b/apps/perfdash/README.md new file mode 100644 index 00000000000..93c9b5a4278 --- /dev/null +++ b/apps/perfdash/README.md @@ -0,0 +1,10 @@ +## How to deploy Perfdash + +To bootstrap [Perfdash](https://github.com/kubernetes/perf-tests/tree/master/perfdash): + +- Have [access](https://github.com/kubernetes/k8s.io/blob/main/running-in-community-clusters.md) to the GKE cluster `aaa`. + +- From the `apps/perfdash` directory run: +```console +./deploy.sh +``` diff --git a/perf-dash.k8s.io/certificate.yaml b/apps/perfdash/certificate.yaml similarity index 84% rename from perf-dash.k8s.io/certificate.yaml rename to apps/perfdash/certificate.yaml index aa533ac2fed..2286c0a45ac 100644 --- a/perf-dash.k8s.io/certificate.yaml +++ b/apps/perfdash/certificate.yaml @@ -3,6 +3,8 @@ kind: ManagedCertificate metadata: name: perfdash-k8s-io namespace: perfdash + labels: + app: perfdash spec: domains: - perf-dash.k8s.io diff --git a/apps/perfdash/deploy.sh b/apps/perfdash/deploy.sh new file mode 100755 index 00000000000..314c3a0cfd8 --- /dev/null +++ b/apps/perfdash/deploy.sh @@ -0,0 +1,55 @@ +#!/usr/bin/env bash + +# Copyright 2021 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. + +# Deploys this app to the aaa cluster, or whatever cluster is pointed to +# by KUBECTL_CONTEXT if set. Assumes the app's namespace already exists. +# +# Members of k8s-infra-rbac-${app}@kubernetes.io can run this. + +set -o errexit +set -o nounset +set -o pipefail + +SCRIPT_ROOT=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd -P) + +app=$(basename "${SCRIPT_ROOT}") + +# coordinates to locate the target cluster in gke +cluster_name="aaa" +cluster_project="kubernetes-public" +cluster_region="us-central1" + +# coordinates to locate the app on the target cluster +namespace="${app}" + +# custom var(s) specific to this apps deployment +perfdash_repo_url="https://raw.githubusercontent.com/kubernetes/perf-tests/master/perfdash" + +# well known name set by `gcloud container clusters get-credentials` +gke_context="gke_${cluster_project}_${cluster_region}_${cluster_name}" +context="${KUBECTL_CONTEXT:-${gke_context}}" + +# ensure we have a context to talk to the target cluster +if ! kubectl config get-contexts "${context}" >/dev/null 2>&1; then + gcloud container clusters get-credentials "${cluster_name}" --project="${cluster_project}" --region="${cluster_region}" + context="${gke_context}" +fi + +# deploy kubernetes resources +pushd "${SCRIPT_ROOT}" >/dev/null +kubectl --context="${context}" --namespace="${namespace}" apply -f "${perfdash_repo_url}/deployment.yaml" +kubectl --context="${context}" --namespace="${namespace}" apply -f "${perfdash_repo_url}/perfdash-service.yaml" +kubectl --context="${context}" --namespace="${namespace}" apply -f . diff --git a/perf-dash.k8s.io/ingress.yaml b/apps/perfdash/ingress.yaml similarity index 100% rename from perf-dash.k8s.io/ingress.yaml rename to apps/perfdash/ingress.yaml diff --git a/perf-dash.k8s.io/README.md b/perf-dash.k8s.io/README.md deleted file mode 100644 index a33edcf9a54..00000000000 --- a/perf-dash.k8s.io/README.md +++ /dev/null @@ -1,12 +0,0 @@ -To bootstrap [Perfdash](https://github.com/kubernetes/perf-tests/tree/master/perfdash): - -```bash -PERFDASH_REPO_URL="https://raw.githubusercontent.com/kubernetes/perf-tests/master/perfdash" -PERFDASH_NAMESPACE="perfdash" - -kubectl apply -n "$PERFDASH_NAMESPACE" -f "${PERFDASH_REPO_URL}/deployment.yaml" -kubectl apply -n "$PERFDASH_NAMESPACE" -f "${PERFDASH_REPO_URL}/perfdash-service.yaml" - -kubectl apply -n "$PERFDASH_NAMESPACE" -f ingress.yaml -kubectl apply -n "$PERFDASH_NAMESPACE" -f certificate.yaml -```