Skip to content

Commit

Permalink
added setup_sonobuoy.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
friedrichwilken committed Nov 11, 2021
1 parent 93061fc commit e88999d
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 2 deletions.
1 change: 1 addition & 0 deletions hack/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
kpng-deployment-ds.yaml
/sonobuoy
21 changes: 20 additions & 1 deletion hack/kpng-local-up.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@
#!/bin/bash
# build the kpng image...

# 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.


# build the kpng image...
# TODO Replace with 1.22 once we address
#: ${KIND:="kindest/node:v1.21.1@sha256:69860bda5563ac81e3c0057d654b5253219618a22ec3a346306239bba8cfa1a6"}
: ${KIND:="kindest/node:v1.22.0@sha256:b8bda84bb3a190e6e028b1760d277454a72267a5454b57db34437c34a588d047"}
Expand Down Expand Up @@ -47,6 +62,7 @@ function install_k8s {

function install_kpng {
# substitute it with your changes...

echo "Applying template"
envsubst <kpng-deployment-ds.yaml.tmpl >kpng-deployment-ds.yaml

Expand All @@ -63,6 +79,9 @@ function install_kpng {
kubectl create -f kpng-deployment-ds.yaml
}

# change dir to dir of script
cd "${0%/*}"

# Comment out build if you just want to install the default, i.e. for quickly getting up and running.
build_kpng
install_k8s
Expand Down
2 changes: 1 addition & 1 deletion hack/resolve_all_mod_files.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ for f in $(find -name go.mod);
do d=$(dirname $f);
echo "downloading mods in $d";
( cd $d && go mod download );
done
done
40 changes: 40 additions & 0 deletions hack/setup_sonobuoy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/bin/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.

function is_kind_available() {
if ! command -v kind &> /dev/null
then
echo "kind could not be found"
exit
fi
}

function get_sonobuoy() {
mkdir sonobuoy
wget https://github.com/vmware-tanzu/sonobuoy/releases/download/v0.55.0/sonobuoy_0.55.0_linux_amd64.tar.gz -O ./sonobuoy.tar.gz
tar -xf sonobuoy.tar.gz -C ./sonobuoy
rm sonobuoy.tar.gz
}

is_kind_available

# cd to dir of script
cd "${0%/*}"

get_sonobuoy

# create a kind cluster with kpng instead of kubeproxy
./kpng-local-up.sh

0 comments on commit e88999d

Please sign in to comment.