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

prow: force namespace in deploy.sh #2527

Merged
merged 3 commits into from
Aug 12, 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
20 changes: 15 additions & 5 deletions infra/gcp/terraform/k8s-infra-prow-build-trusted/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,27 @@ function deploy_cluster_terraform() {
}

function deploy_cluster_resources() {
pushd "${SCRIPT_ROOT}/${cluster}/resources"

gcloud \
container clusters get-credentials \
--project="${project}" \
--region="${region}" \
"${cluster}"

kubectl \
--context="${context}" \
apply \
-f "${SCRIPT_ROOT}/${cluster}/resources" \
--recursive
kubectl --context="${context}" apply \
--filename ./*.yaml

find . -type d -mindepth 1 -maxdepth 1 | sed -e 's|^./||' \
| while read -r namespace; do
echo "deploying resources in namespace: ${namespace}"
kubectl --context="${context}" apply \
--namespace "${namespace}" \
--filename "${namespace}/" \
--recursive
done

popd
}

function main() {
Expand Down
20 changes: 15 additions & 5 deletions infra/gcp/terraform/k8s-infra-prow-build/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,27 @@ function deploy_cluster_terraform() {
}

function deploy_cluster_resources() {
pushd "${SCRIPT_ROOT}/${cluster}/resources"
spiffxp marked this conversation as resolved.
Show resolved Hide resolved

gcloud \
container clusters get-credentials \
--project="${project}" \
--region="${region}" \
"${cluster}"

kubectl \
--context="${context}" \
apply \
-f "${SCRIPT_ROOT}/${cluster}/resources" \
--recursive
kubectl --context="${context}" apply \
--filename ./*.yaml

find . -type d -mindepth 1 -maxdepth 1 | sed -e 's|^./||' \
| while read -r namespace; do
echo "deploying resources in namespace: ${namespace}"
kubectl --context="${context}" apply \
--namespace "${namespace}" \
spiffxp marked this conversation as resolved.
Show resolved Hide resolved
--filename "${namespace}/" \
--recursive
done

popd
}

function main() {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
apiVersion: v1
kind: ServiceAccount
metadata:
annotations:
iam.gke.io/gcp-service-account: prow-build@k8s-infra-prow-build.iam.gserviceaccount.com
name: prow-build
namespace: k8s-infra-test-pods
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: v1
kind: LimitRange
metadata:
name: cpu-limit-range
namespace: k8s-infra-test-pods
spec:
limits:
- defaultRequest:
cpu: 250m
type: Container
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: v1
kind: LimitRange
metadata:
name: mem-limit-range
namespace: k8s-infra-test-pods
spec:
limits:
- defaultRequest:
memory: 1Gi
type: Container