Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating kustomize version and adding apple silicon instructions #275

Merged
merged 1 commit into from
Jan 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@
out*
*.tar.gz
*.out
istio-*
.DS_Store
2 changes: 2 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ export KUBECONFIG=~/.kube/config

Mac: `$ADMIRAL_HOME/tests/install_istio.sh 1.7.4 osx`

Mac (Apple Silicon): `$ADMIRAL_HOME/tests/install_istio.sh 1.7.4 osx-arm64`

Linux: `$ADMIRAL_HOME/tests/install_istio.sh 1.7.4 linux`

* Set up necessary permissions and configurations for Admiral
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
DOCKER_REPO?=admiralproj
IMAGE?=$(DOCKER_REPO)/admiral
DOCKER_USER?=aattuluri
KUSTOMIZE_VERSION?=3.8.2
KUSTOMIZE_VERSION?=4.5.5

DOCKERFILE?=Dockerfile.admiral

Expand Down
3 changes: 1 addition & 2 deletions install/sample/overlays/rollout-bluegreen/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,4 @@ bases:
- ../../base

resources:
- greeting.yaml
- namespace.yaml
- greeting.yaml
6 changes: 0 additions & 6 deletions install/sample/overlays/rollout-bluegreen/namespace.yaml

This file was deleted.

1 change: 0 additions & 1 deletion install/sample/overlays/rollout-canary/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,3 @@ bases:

resources:
- greeting.yaml
- namespace.yaml
6 changes: 0 additions & 6 deletions install/sample/overlays/rollout-canary/namespace.yaml

This file was deleted.

12 changes: 9 additions & 3 deletions tests/create_cluster.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
#!/bin/bash

[ $# -lt 1 ] && { echo "Usage: $0 <k8s_version>" ; exit 1; }
[ $# -lt 1 ] && { echo "Usage: $0 <k8s_version> "; exit 1; }

k8s_version=$1
driver="--vm-driver=virtualbox"

# apple silicon does not support virtualbox
if [[ "$OSTYPE" == "darwin"* && $(uname -m) == 'arm64' ]]; then
driver="--driver=docker"
fi

echo "Creating K8s cluster with version: $k8s_version"

Expand All @@ -13,7 +19,7 @@ if [[ $IS_LOCAL == "false" ]]; then
sudo -E minikube start --vm-driver=none --kubernetes-version=$k8s_version
else
echo "Creating K8s cluster with virtualbox vm driver"
minikube start --memory=4096 --cpus=4 --kubernetes-version=$k8s_version --vm-driver "virtualbox"
minikube start --memory=4096 --cpus=4 --kubernetes-version=$k8s_version $driver
#label node for locality load balancing
kubectl label nodes minikube --overwrite failure-domain.beta.kubernetes.io/region=us-west-2
fi
fi
18 changes: 10 additions & 8 deletions tests/install_istio.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

function ver { printf "%03d%03d%03d%03d" $(echo "$1" | tr '.' ' '); }

[ $# -lt 2 ] && { echo "Usage: $0 <istio_version> [osx|linux]" ; exit 1; }
[ $# -lt 2 ] && { echo "Usage: $0 <istio_version> [osx|osx-arm64|linux]" ; exit 1; }

istio_version=$1
os=$2
Expand All @@ -28,13 +28,6 @@ kubectl create secret generic cacerts -n istio-system --from-file="istio-$istio_

#Generate, install and verify Istio CRDs

if [ $(ver $istio_version) -lt $(ver 1.8.6) ]
then
echo "Istio version $istio_version is no longer officially supported by this version of Admiral"
exit 1
else
#install istio core with DNS proxying enabled and multicluster enabled
# TODO Also add east-west gateway to this installation
cat <<EOF > cluster1.yaml
apiVersion: install.istio.io/v1alpha1
kind: IstioOperator
Expand Down Expand Up @@ -86,6 +79,15 @@ spec:
targetPort: 15443
EOF

if [ $(ver $istio_version) -lt $(ver 1.8.6) ]
then
echo "Istio version $istio_version is no longer officially supported by this version of Admiral"
exit 1
#install istio core with DNS proxying enabled and multicluster enabled
elif [ "$os" == "osx-arm64" ]; then
# defalt image does not support iptable manipulation on apple silicon - https://stackoverflow.com/questions/72073613/istio-installation-failed-apple-silicon-m1
"./istio-$istio_version/bin/istioctl" install -f cluster1.yaml --set hub=ghcr.io/resf/istio -y
else
"./istio-$istio_version/bin/istioctl" install -f cluster1.yaml -y
fi
rm -rf cluster1.yaml
Expand Down
4 changes: 3 additions & 1 deletion tests/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ source ./create_cluster.sh $k8s_version
# Uncomment below line if setup fails due to KUBECONFIG not set
export KUBECONFIG=~/.kube/config
# change $os from "linux" to "osx" when running on local computer
if [[ "$OSTYPE" == "darwin"* ]]; then
if [[ "$OSTYPE" == "darwin"* && $(uname -m) == 'arm64' ]]; then
os="osx-arm64"
elif [[ "$OSTYPE" == "darwin"* ]]; then
os="osx"
else
os="linux-amd64"
Expand Down