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

Move perfdash under /apps #2317

Merged
merged 4 commits into from
Jul 9, 2021
Merged
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -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

Expand Down
File renamed without changes.
10 changes: 10 additions & 0 deletions apps/perfdash/README.md
Original file line number Diff line number Diff line change
@@ -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
```
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ kind: ManagedCertificate
metadata:
name: perfdash-k8s-io
namespace: perfdash
labels:
app: perfdash
spec:
domains:
- perf-dash.k8s.io
55 changes: 55 additions & 0 deletions apps/perfdash/deploy.sh
Original file line number Diff line number Diff line change
@@ -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"
Comment on lines +53 to +54
Copy link
Member

Choose a reason for hiding this comment

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

Uh, TIL this is how it's always been for this app, so I won't blow your PR's scope. But these files should live here (I was thinking in the direction of a postsubmit job that could run the relevant deploy.sh if any app's files changed). Not a fan of deploy scripts that will deploy something different depending on the time of day they're run.

Copy link
Member

Choose a reason for hiding this comment

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

kubectl --context="${context}" --namespace="${namespace}" apply -f .
File renamed without changes.
12 changes: 0 additions & 12 deletions perf-dash.k8s.io/README.md

This file was deleted.