diff --git a/.gitignore b/.gitignore index 3fd17e09..6fc8f208 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,5 @@ out* *.tar.gz *.out +istio-* +.DS_Store diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e0e0a712..e9bd99c4 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -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 diff --git a/Makefile b/Makefile index 36185303..201e10d1 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/install/sample/overlays/rollout-bluegreen/kustomization.yaml b/install/sample/overlays/rollout-bluegreen/kustomization.yaml index 3d07e34e..6d811ac2 100644 --- a/install/sample/overlays/rollout-bluegreen/kustomization.yaml +++ b/install/sample/overlays/rollout-bluegreen/kustomization.yaml @@ -7,5 +7,4 @@ bases: - ../../base resources: - - greeting.yaml - - namespace.yaml + - greeting.yaml \ No newline at end of file diff --git a/install/sample/overlays/rollout-bluegreen/namespace.yaml b/install/sample/overlays/rollout-bluegreen/namespace.yaml deleted file mode 100644 index 6aa0772c..00000000 --- a/install/sample/overlays/rollout-bluegreen/namespace.yaml +++ /dev/null @@ -1,6 +0,0 @@ -apiVersion: v1 -kind: Namespace -metadata: - name: sample-rollout-bluegreen - labels: - istio-injection: enabled diff --git a/install/sample/overlays/rollout-canary/kustomization.yaml b/install/sample/overlays/rollout-canary/kustomization.yaml index ca0714b5..0ac4a029 100644 --- a/install/sample/overlays/rollout-canary/kustomization.yaml +++ b/install/sample/overlays/rollout-canary/kustomization.yaml @@ -8,4 +8,3 @@ bases: resources: - greeting.yaml - - namespace.yaml diff --git a/install/sample/overlays/rollout-canary/namespace.yaml b/install/sample/overlays/rollout-canary/namespace.yaml deleted file mode 100644 index ea6b5da3..00000000 --- a/install/sample/overlays/rollout-canary/namespace.yaml +++ /dev/null @@ -1,6 +0,0 @@ -apiVersion: v1 -kind: Namespace -metadata: - name: sample-rollout-canary - labels: - istio-injection: enabled diff --git a/tests/create_cluster.sh b/tests/create_cluster.sh index 0bc7dd5e..f0b10e62 100755 --- a/tests/create_cluster.sh +++ b/tests/create_cluster.sh @@ -1,8 +1,14 @@ #!/bin/bash -[ $# -lt 1 ] && { echo "Usage: $0 " ; exit 1; } +[ $# -lt 1 ] && { echo "Usage: $0 "; 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" @@ -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 \ No newline at end of file +fi diff --git a/tests/install_istio.sh b/tests/install_istio.sh index 71085ff0..c1d3e870 100755 --- a/tests/install_istio.sh +++ b/tests/install_istio.sh @@ -2,7 +2,7 @@ function ver { printf "%03d%03d%03d%03d" $(echo "$1" | tr '.' ' '); } -[ $# -lt 2 ] && { echo "Usage: $0 [osx|linux]" ; exit 1; } +[ $# -lt 2 ] && { echo "Usage: $0 [osx|osx-arm64|linux]" ; exit 1; } istio_version=$1 os=$2 @@ -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 < cluster1.yaml apiVersion: install.istio.io/v1alpha1 kind: IstioOperator @@ -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 diff --git a/tests/run.sh b/tests/run.sh index 620159f5..1f2e1b0c 100755 --- a/tests/run.sh +++ b/tests/run.sh @@ -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"