bitops
bitops copied to clipboard
Istio Support
Add istioctl
support
Ops repo environments should be able to specify:
operations/
- env1/
- istio/
- bitops.config.yaml
- profiles/ # <- these should be yaml files of `kind: IstioOperator`
- p1.yaml
Items
- [ ] install istioctl into bitops
- [ ] create new plugin or
scripts/istio
directory - [ ] create bitops schema
- [ ] create deploy script
Deploy script
it should first check if istio is installed because it runs different commands for upgrade and install:
#####
##### check if istio is installed
#####
ISTIOCTL="istioctl --kubeconfig=${kubeconfig} --istioNamespace=${namespace}"
ISTIO_INSTALL_COMMAND="$ISTIOCTL"
NO_ISTIO_PODS_STRING="no running Istio pods"
ISTIO_VERSION_RESPONSE="$($ISTIOCTL version)"
set +e
ISTIO_NOT_INSTALLED="$(echo "$ISTIO_VERSION_RESPONSE" | grep "$NO_ISTIO_PODS_STRING")"
set -e
if [ -n "$ISTIO_NOT_INSTALLED" ]; then
echo "istio not installed, installing..."
ISTIO_INSTALL_COMMAND="$ISTIO_INSTALL_COMMAND install"
else
echo "istio installed, upgrading..."
ISTIO_INSTALL_COMMAND="$ISTIO_INSTALL_COMMAND upgrade"
fi
# auto confirm
ISTIO_INSTALL_COMMAND="${ISTIO_INSTALL_COMMAND} -y"
# create namespace if not exists
It should build up to a command like this:
istioctl \
--kubeconfig=${kubeconfig} \
--istioNamespace=${namespace} \
-f $ISTIO_ROOT/profiles/a.yaml \
-f $ISTIO_ROOT/profiles/b.yaml