Skip to content

Commit

Permalink
Merge pull request #17 from edgefarm/remove-taint
Browse files Browse the repository at this point in the history
fixes and chaos-mesh integration
  • Loading branch information
batthebee authored Jul 13, 2022
2 parents 33d1ff9 + 4ae4c3a commit 41f5619
Show file tree
Hide file tree
Showing 8 changed files with 41 additions and 12 deletions.
21 changes: 21 additions & 0 deletions environments/chaos-mesh/devspace.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
version: v1beta11

require:
devspace: '>= 5.0, < 6.0'

commands:
- name: start
command: |
helm repo add chaos-mesh https://charts.chaos-mesh.org
helm install chaos-mesh --create-namespace -n chaos-testing chaos-mesh/chaos-mesh --set chaosDaemon.runtime=containerd --set chaosDaemon.socketPath=/run/containerd/containerd.sock --version 2.2.2
- name: stop
command: |
helm uninstall chaos-testing
# - name: wait
# command: |
# until kubectl wait --for=condition=available deployment/cert-manager -n cert-manager --timeout=60s 2>/dev/null; do echo -n "." && sleep 2; done
# until kubectl wait --for=condition=available deployment/cert-manager-cainjector -n cert-manager --timeout=60s 2>/dev/null; do echo -n "." && sleep 2; done
# until kubectl wait --for=condition=available deployment/cert-manager-webhook -n cert-manager --timeout=60s 2>/dev/null; do echo -n "." && sleep 2; done
# until kubectl wait --for=condition=established crd/certificates.cert-manager.io --timeout=60s 2>/dev/null; do echo -n "." && sleep 2; done
9 changes: 9 additions & 0 deletions environments/kind/devspace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,17 @@ commands:
command: |-
set -e
kind create cluster --name ${KIND_CLUSTER_NAME} --image kindest/node:${KIND_CLUSTER_VERSION} --config ${KIND_CONFIG}
# remove taint `node-role.kubernetes.io/master:NoSchedule` from all control-plane nodes
kubectl taint nodes -l node-role.kubernetes.io/control-plane= node-role.kubernetes.io/master:NoSchedule-
# TODO: this doesn't work as expected, network still crashes, not all daemonsets.apps are scheduled
# needed to be reworked - maybe exchange kindnet with cannel etc..
#
# remove toleration * from kindnet to prevent scheduling on edge nodes
# kubectl patch daemonsets.apps -n kube-system kindnet --type=json -p='[{"op": "remove", "path": "/spec/template/spec/tolerations" }]'
# kubectl patch daemonsets.apps -n kube-system kube-proxy --type=json -p='[{"op": "remove", "path": "/spec/template/spec/tolerations/1" }]'
export KIND_CLUSTER_NAME=${KIND_CLUSTER_NAME}
export KIND_CONFIG=${KIND_CONFIG}
devspace run activate
6 changes: 3 additions & 3 deletions environments/mkcert/hack/create-ca-secret.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ set -u
if [ "$#" -ne 2 ]; then
echo "Illegal number of parameters"
echo "create-ca-secret <ca_secret_name> <ca_secret_namespace>"
exit
exit 1
fi

if ! [ -d "${CAROOT}" ]; then
echo "Creating self-signed CA $1"
mkdir -p ${CAROOT}
mkcert 2>/dev/null
mkcert || true #2>/dev/null
fi

kubectl -n $2 create secret tls $1 \
--key=${CAROOT}/rootCA-key.pem \
--cert=${CAROOT}/rootCA.pem 2>/dev/null
--cert=${CAROOT}/rootCA.pem || true #2>/dev/null
4 changes: 2 additions & 2 deletions environments/mkcert/hack/create-cert.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set -u
if ! [ "$#" -gt 1 ]; then
echo "Illegal number of parameters"
echo "create-certificate <mk_cert_params>"
exit
exit 1
fi

mkcert ${@:2}
mkcert ${@:1} || true
5 changes: 2 additions & 3 deletions environments/mkcert/hack/create-client-cert.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@ set -u
if ! [ "$#" -gt 1 ]; then
echo "Illegal number of parameters"
echo "create-certificate <mkcert_args>"
exit
exit 1
fi

echo $CAROOT

mkcert -client ${@:1}
mkcert -client ${@:1} || true
2 changes: 1 addition & 1 deletion environments/mkcert/hack/init-ca.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ fi
if ! [ -d "${CAROOT}" ]; then
echo "Creating self-signed CA ${CAROOT}"
mkdir -p ${CAROOT}
# mkcert 2>/dev/null
mkcert || true #2>/dev/null
else
echo "CA ${CAROOT} already exists."
fi
4 changes: 2 additions & 2 deletions environments/mkcert/hack/install-ca.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ set -u
if [ "$#" -ne 0 ]; then
echo "Illegal number of parameters"
echo "install-ca"
exit
exit 1
fi

echo "installing ${CAROOT}"
mkcert -install
mkcert -install || true
2 changes: 1 addition & 1 deletion environments/mkcert/hack/uninstall-ca.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set -u
if [ "$#" -ne 0 ]; then
echo "Illegal number of parameters"
echo "uninstall-ca"
exit
exit 1
fi

echo "uninstalling ${CAROOT}"
Expand Down

0 comments on commit 41f5619

Please sign in to comment.