-
Notifications
You must be signed in to change notification settings - Fork 689
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
126 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
#! /usr/bin/env bash | ||
|
||
# Copyright Project Contour 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. | ||
|
||
set -o pipefail | ||
set -o errexit | ||
set -o nounset | ||
|
||
# install-contour-working-remote.sh: Install Contour from the working repo to a remote cluster. Assumes it exists | ||
|
||
readonly KUBECTL=${KUBECTL:-kubectl} | ||
readonly IMAGE=${IMAGE:-"ghcr.io/projectcontour/contour"} | ||
|
||
readonly WAITTIME=${WAITTIME:-5m} | ||
|
||
readonly HERE=$(cd $(dirname $0) && pwd) | ||
readonly REPO=$(cd ${HERE}/../.. && pwd) | ||
|
||
# Set (pseudo) random image tag to trigger restarts at every deployment. | ||
# TODO: Come up with a scheme that doesn't fill up the dev environment with randomly-tagged images. | ||
VERSION="v$$" | ||
|
||
# Build the image. | ||
make -C ${REPO} container IMAGE=${IMAGE} VERSION=${VERSION} | ||
|
||
# Install Contour | ||
${KUBECTL} apply -f ${REPO}/examples/contour/00-common.yaml | ||
${KUBECTL} apply -f ${REPO}/examples/contour/01-contour-config.yaml | ||
${KUBECTL} apply -f ${REPO}/examples/contour/01-crds.yaml | ||
${KUBECTL} apply -f ${REPO}/examples/contour/02-rbac.yaml | ||
${KUBECTL} apply -f ${REPO}/examples/contour/02-role-contour.yaml | ||
${KUBECTL} apply -f ${REPO}/examples/contour/02-service-contour.yaml | ||
${KUBECTL} apply -f ${REPO}/examples/contour/02-service-envoy.yaml | ||
|
||
for file in ${REPO}/examples/contour/02-job-certgen.yaml ${REPO}/examples/contour/03-contour.yaml ${REPO}/examples/contour/03-envoy.yaml ; do | ||
# Set image pull policy to IfNotPresent so kubelet will use the | ||
# images that we loaded onto the node, rather than trying to pull | ||
# them from the registry. | ||
# Set the image tag to $VERSION to unambiguously use the image | ||
# we built above. | ||
sed \ | ||
"-es|imagePullPolicy: Always|imagePullPolicy: IfNotPresent|" \ | ||
"-es|image: ghcr.io/projectcontour/contour:.*$|image: ${IMAGE}:${VERSION}|" \ | ||
"$file" | \ | ||
${KUBECTL} apply -f - | ||
done | ||
|
||
# Wait for Contour and Envoy to report "Ready" status. | ||
${KUBECTL} wait --timeout="${WAITTIME}" -n projectcontour -l app=contour deployments --for=condition=Available | ||
${KUBECTL} wait --timeout="${WAITTIME}" -n projectcontour -l app=envoy pods --for=condition=Ready |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#! /usr/bin/env bash | ||
|
||
# Copyright Project Contour 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. | ||
|
||
# make-kind-cluster.sh: build a kind cluster and install a working copy | ||
# of Contour into it. | ||
|
||
set -o pipefail | ||
set -o errexit | ||
set -o nounset | ||
|
||
readonly KUBECTL=${KUBECTL:-kubectl} | ||
|
||
readonly SKIP_GATEWAY_API_INSTALL=${SKIP_GATEWAY_API_INSTALL:-"false"} | ||
readonly WAITTIME=${WAITTIME:-5m} | ||
|
||
readonly HERE=$(cd "$(dirname "$0")" && pwd) | ||
readonly REPO=$(cd "${HERE}/../.." && pwd) | ||
|
||
|
||
# Install cert-manager. | ||
CERT_MANAGER_VERSION=$(go list -m all | grep github.com/cert-manager/cert-manager | awk '{print $2}') | ||
|
||
${KUBECTL} apply -f https://github.com/cert-manager/cert-manager/releases/download/${CERT_MANAGER_VERSION}/cert-manager.yaml | ||
${KUBECTL} wait --timeout="${WAITTIME}" -n cert-manager -l app=cert-manager deployments --for=condition=Available | ||
${KUBECTL} wait --timeout="${WAITTIME}" -n cert-manager -l app=webhook deployments --for=condition=Available | ||
|
||
if [[ "${SKIP_GATEWAY_API_INSTALL}" != "true" ]]; then | ||
# Install Gateway API CRDs. | ||
${KUBECTL} apply -f "${REPO}/examples/gateway/00-crds.yaml" | ||
fi | ||
|
||
# Install Contour CRDs. | ||
${KUBECTL} apply -f "${REPO}/examples/contour/01-crds.yaml" |