Skip to content

Commit

Permalink
hack: final fixes?
Browse files Browse the repository at this point in the history
  • Loading branch information
mcluseau committed Apr 29, 2021
1 parent be28d9f commit 54cd150
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 28 deletions.
4 changes: 0 additions & 4 deletions hack/kpng-deployment-ds.yaml.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,6 @@ spec:
- name: modules
mountPath: /lib/modules
readOnly: true
- name: host
mountPath: /host-etc/
- name: kubelet
mountPath: /var/lib/kubelet/
command:
- kube-proxy-nftables
- --target=unix:///k8s/proxy.sock
Expand Down
51 changes: 27 additions & 24 deletions hack/kpng-local-up.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,39 +4,42 @@
IMAGE="jayunit100/kpng-server:latest"

function setup_k8s {
# make a gopath if not one existing...
if "$GOPATH" == "" ; then
mkdir -p $HOME/go/
export GOPATH=$HOME/go
# need kind 0.11 bc 0.10 has a bug w/ kubeproxy=none
GO111MODULE="on" go get sigs.k8s.io/kind@master
chmod 755 $GOPATH/bin/kind
cp $GOPATH/bin/kind /usr/local/bin/kind
fi
kind version

echo "****************************************************"
kind delete cluster --name kpng-proxy
kind create cluster --config kind.yaml
echo "****************************************************"
# make a gopath if not one existing...
if "$GOPATH" == "" ; then
mkdir -p $HOME/go/
export GOPATH=$HOME/go
# need kind 0.11 bc 0.10 has a bug w/ kubeproxy=none
GO111MODULE="on" go get sigs.k8s.io/kind@master
chmod 755 $GOPATH/bin/kind
cp $GOPATH/bin/kind /usr/local/bin/kind
fi
kind version

echo "****************************************************"
kind delete cluster --name kpng-proxy
kind create cluster --config kind.yaml
echo "****************************************************"
}

function build {
cd ../
cd ../

docker build -t $IMAGE ./
docker push $IMAGE
docker build -t $IMAGE ./
docker push $IMAGE

cd hack/
cd hack/
}

function install {
# substitute it with your changes...
cat kpng-deployment-ds.yaml.tmpl | sed "s,KPNG_IMAGE,$IMAGE," > kpng-deployment-ds.yaml
kubectl -n kube-system create sa kube-proxy
# substitute it with your changes...
cat kpng-deployment-ds.yaml.tmpl | sed "s,KPNG_IMAGE,$IMAGE," > kpng-deployment-ds.yaml

kubectl -n kube-system create sa kube-proxy
kubectl create clusterrolebinding kube-proxy --clusterrole=system:node-proxier --serviceaccount=kube-system:kube-proxy
kubectl delete -f kpng-deployment-ds.yaml
kubectl create -f kpng-deployment-ds.yaml
kubectl -n kube-system create cm kube-proxy --from-file kubeconfig.conf

kubectl delete -f kpng-deployment-ds.yaml
kubectl create -f kpng-deployment-ds.yaml
}

# Comment out build if you just want to install the default, i.e. for quickly getting up and running.
Expand Down
18 changes: 18 additions & 0 deletions hack/kubeconfig.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
apiVersion: v1
kind: Config
clusters:
- cluster:
certificate-authority: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
server: https://kpng-proxy-control-plane:6443
name: default
contexts:
- context:
cluster: default
namespace: default
user: default
name: default
current-context: default
users:
- name: default
user:
tokenFile: /var/run/secrets/kubernetes.io/serviceaccount/token

0 comments on commit 54cd150

Please sign in to comment.