add ns networkpolicy

This commit is contained in:
magicsong
2019-08-05 18:48:32 +08:00
parent cc15fbe983
commit 90fa38851f
101 changed files with 3737 additions and 120 deletions

View File

@@ -4,6 +4,6 @@ set -e
GV="network:v1alpha1 servicemesh:v1alpha2 tenant:v1alpha1"
rm -rf ./pkg/client
./hack/generate_group.sh "client,lister,informer" kubesphere.io/kubesphere/pkg/client kubesphere.io/kubesphere/pkg/apis "$GV" --output-base=./
mv kubesphere.io/kubesphere/pkg/client ./pkg/
./hack/generate_group.sh "client,lister,informer" kubesphere.io/kubesphere/pkg/client kubesphere.io/kubesphere/pkg/apis "$GV" --output-base=./ -h=./hack/boilerplate.go.txt
mv kubesphere.io/kubesphere/pkg/client ./pkg/
rm -rf ./kubesphere.io

View File

@@ -18,6 +18,7 @@ set -o errexit
set -o nounset
set -o pipefail
GOPATH="${HOME}/go"
# generate-groups generates everything for a project with external types only, e.g. a project based
# on CustomResourceDefinitions.

57
hack/network-test.sh Executable file
View File

@@ -0,0 +1,57 @@
#!/bin/bash
#this script must invoked in the root directory of this repo
tag=`git rev-parse --short HEAD`
IMG=magicsong/ks-network:$tag
DEST=/tmp/manager.yaml
SKIP_BUILD=no
echo "try to delete old yaml"
kubectl delete -f $DEST
set -e
while [[ $# -gt 0 ]]
do
key="$1"
case $key in
-s|--skip-build)
SKIP_BUILD=yes
shift # past argument
;;
-n|--NAMESPACE)
TEST_NS=$2
shift # past argument
shift # past value
;;
-t|--tag)
tag="$2"
shift # past argument
shift # past value
;;
--default)
DEFAULT=YES
shift # past argument
;;
*) # unknown option
POSITIONAL+=("$1") # save it in an array for later
shift # past argument
;;
esac
done
if [ $SKIP_BUILD == "no" ]; then
echo "Building binary"
hack/gobuild.sh cmd/ks-network
docker build -f build/ks-network/Dockerfile -t $IMG bin/cmd
echo "Push images"
docker push $IMG
fi
echo "Generating yaml"
sed -e 's@image: .*@image: '"${IMG}"'@' config/manager/network.yaml > $DEST
kubectl apply -f $DEST
kubectl apply -f config/rbac/rbac_role_binding_network.yaml