Skip to content

Commit

Permalink
Updating kustomize version and adding apple silicon instructions
Browse files Browse the repository at this point in the history
Signed-off-by: vgonuguntla <vinay_gonuguntla@intuit.com>
  • Loading branch information
vinaygonuguntla committed Jan 17, 2023
1 parent 5541b68 commit acba4dc
Show file tree
Hide file tree
Showing 12 changed files with 123 additions and 75 deletions.
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
60 changes: 5 additions & 55 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 Down Expand Up @@ -32,61 +32,11 @@ 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
"./istio-$istio_version/bin/istioctl" install -f operator-apple-arm.yaml -y
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
spec:
meshConfig:
defaultConfig:
proxyMetadata:
# Enable Istio agent to handle DNS requests for known hosts
# Unknown hosts will automatically be resolved using upstream dns servers in resolv.conf
ISTIO_META_DNS_CAPTURE: "true"
values:
pilot:
resources:
requests:
cpu: 20m
memory: 128Mi
global:
meshID: admiral1
multiCluster:
clusterName: admiral1
network: admiral1
proxy:
resources:
requests:
cpu: 20m
memory: 64Mi
limits:
cpu: 80m
memory: 256Mi
components:
ingressGateways:
- name: istio-eastwestgateway
label:
istio: eastwestgateway
app: istio-eastwestgateway
enabled: true
k8s:
env:
# sni-dnat adds the clusters required for AUTO_PASSTHROUGH mode
- name: ISTIO_META_ROUTER_MODE
value: "sni-dnat"
service:
ports:
- name: status-port
port: 15021
targetPort: 15021
- name: tls
port: 15443
targetPort: 15443
EOF

"./istio-$istio_version/bin/istioctl" install -f cluster1.yaml -y
"./istio-$istio_version/bin/istioctl" install -f operator.yaml -y
fi
rm -rf cluster1.yaml
kubectl rollout status deployment istiod -n istio-system
Expand Down
51 changes: 51 additions & 0 deletions tests/operator-apple-arm.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# TODO Also add east-west gateway to this installation
apiVersion: install.istio.io/v1alpha1
kind: IstioOperator
spec:
# defalt image does not support iptable manipulation on apple silicon - https://stackoverflow.com/questions/72073613/istio-installation-failed-apple-silicon-m1
hub: ghcr.io/resf/istio
meshConfig:
defaultConfig:
proxyMetadata:
# Enable Istio agent to handle DNS requests for known hosts
# Unknown hosts will automatically be resolved using upstream dns servers in resolv.conf
ISTIO_META_DNS_CAPTURE: "true"
values:
pilot:
resources:
requests:
cpu: 20m
memory: 128Mi
global:
meshID: admiral1
multiCluster:
clusterName: admiral1
network: admiral1
proxy:
resources:
requests:
cpu: 20m
memory: 64Mi
limits:
cpu: 80m
memory: 256Mi
components:
ingressGateways:
- name: istio-eastwestgateway
label:
istio: eastwestgateway
app: istio-eastwestgateway
enabled: true
k8s:
env:
# sni-dnat adds the clusters required for AUTO_PASSTHROUGH mode
- name: ISTIO_META_ROUTER_MODE
value: "sni-dnat"
service:
ports:
- name: status-port
port: 15021
targetPort: 15021
- name: tls
port: 15443
targetPort: 15443
49 changes: 49 additions & 0 deletions tests/operator.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# TODO Also add east-west gateway to this installation
apiVersion: install.istio.io/v1alpha1
kind: IstioOperator
spec:
meshConfig:
defaultConfig:
proxyMetadata:
# Enable Istio agent to handle DNS requests for known hosts
# Unknown hosts will automatically be resolved using upstream dns servers in resolv.conf
ISTIO_META_DNS_CAPTURE: "true"
values:
pilot:
resources:
requests:
cpu: 20m
memory: 128Mi
global:
meshID: admiral1
multiCluster:
clusterName: admiral1
network: admiral1
proxy:
resources:
requests:
cpu: 20m
memory: 64Mi
limits:
cpu: 80m
memory: 256Mi
components:
ingressGateways:
- name: istio-eastwestgateway
label:
istio: eastwestgateway
app: istio-eastwestgateway
enabled: true
k8s:
env:
# sni-dnat adds the clusters required for AUTO_PASSTHROUGH mode
- name: ISTIO_META_ROUTER_MODE
value: "sni-dnat"
service:
ports:
- name: status-port
port: 15021
targetPort: 15021
- name: tls
port: 15443
targetPort: 15443
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

0 comments on commit acba4dc

Please sign in to comment.