From a2869bae413578bf0b5b9fa5be7e9cad2b2bf796 Mon Sep 17 00:00:00 2001 From: Jim DAgostino Date: Fri, 9 Jul 2021 11:17:18 -0400 Subject: [PATCH 1/3] move perfdash --- {perf-dash.k8s.io => apps/perfdash}/OWNERS | 0 apps/perfdash/README.md | 10 ++++ .../perfdash}/certificate.yaml | 2 + apps/perfdash/deploy.sh | 56 +++++++++++++++++++ .../perfdash}/ingress.yaml | 0 perf-dash.k8s.io/README.md | 12 ---- 6 files changed, 68 insertions(+), 12 deletions(-) rename {perf-dash.k8s.io => apps/perfdash}/OWNERS (100%) create mode 100644 apps/perfdash/README.md rename {perf-dash.k8s.io => apps/perfdash}/certificate.yaml (84%) create mode 100755 apps/perfdash/deploy.sh rename {perf-dash.k8s.io => apps/perfdash}/ingress.yaml (100%) delete mode 100644 perf-dash.k8s.io/README.md 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..b901c0f0bfa --- /dev/null +++ b/apps/perfdash/deploy.sh @@ -0,0 +1,56 @@ +#!/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) specifc to app deploy +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}" -f "${PERFDASH_REPO_URL}/deployment.yaml" +kubectl --context="${context}" --namespace="${namespace}" -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 -``` From 2ad97b95448c3ce1da9aad2a01972937593dee73 Mon Sep 17 00:00:00 2001 From: Jim DAgostino Date: Fri, 9 Jul 2021 11:23:11 -0400 Subject: [PATCH 2/3] few small cleanup changes --- README.md | 2 +- apps/perfdash/deploy.sh | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index a4a1ced776d..a9403464e9e 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] - `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] - `triageparty-release`: instance of [triage-party] - owned by [sig-release] @@ -20,7 +21,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/) - `publishing-bot`: instance of [publishing-bot] - owned by [sig-release] (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/apps/perfdash/deploy.sh b/apps/perfdash/deploy.sh index b901c0f0bfa..17a7415faf6 100755 --- a/apps/perfdash/deploy.sh +++ b/apps/perfdash/deploy.sh @@ -38,7 +38,6 @@ namespace="${app}" # custom var(s) specifc to app deploy 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}}" @@ -51,6 +50,6 @@ fi # deploy kubernetes resources pushd "${SCRIPT_ROOT}" >/dev/null -kubectl --context="${context}" --namespace="${namespace}" -f "${PERFDASH_REPO_URL}/deployment.yaml" -kubectl --context="${context}" --namespace="${namespace}" -f "${PERFDASH_REPO_URL}/perfdash-service.yaml" +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 . From 37d386cd10c5e0bb94fba98a06a2a93fa466afab Mon Sep 17 00:00:00 2001 From: Jim DAgostino Date: Fri, 9 Jul 2021 11:26:59 -0400 Subject: [PATCH 3/3] fix comment --- apps/perfdash/deploy.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/perfdash/deploy.sh b/apps/perfdash/deploy.sh index 17a7415faf6..314c3a0cfd8 100755 --- a/apps/perfdash/deploy.sh +++ b/apps/perfdash/deploy.sh @@ -35,7 +35,7 @@ cluster_region="us-central1" # coordinates to locate the app on the target cluster namespace="${app}" -# custom var(s) specifc to app deploy +# 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`