-
Notifications
You must be signed in to change notification settings - Fork 30
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
e2e multicluster tests #91
Comments
Here are the steps to setup multi-primary in kind with Sail which can be automated if they aren't already in the e2e tests:
mkdir -p certs
pushd certs
make -f istioctl_dir/tools/certs/Makefile.selfsigned.mk root-ca
make -f istioctl_dir/tools/certs/Makefile.selfsigned.mk cluster1-cacerts
make -f istioctl_dir/tools/certs/Makefile.selfsigned.mk cluster2-cacerts
popd
kind create cluster --name cluster1
kind create cluster --name cluster2
kubectl config use-context kind-cluster1
make deploy
kubectl config use-context kind-cluster2
make deploy
kubectl create namespace istio-system --context kind-cluster1
kubectl --context=kind-cluster1 label namespace istio-system topology.istio.io/network=network1
kubectl create secret generic cacerts -n istio-system --context kind-cluster1 \
--from-file=certs/cluster1/ca-cert.pem \
--from-file=certs/cluster1/ca-key.pem \
--from-file=certs/cluster1/root-cert.pem \
--from-file=certs/cluster1/cert-chain.pem
kubectl create namespace istio-system --context kind-cluster2
kubectl --context=kind-cluster2 label namespace istio-system topology.istio.io/network=network2
kubectl create secret generic cacerts -n istio-system --context kind-cluster2 \
--from-file=certs/cluster2/ca-cert.pem \
--from-file=certs/cluster2/ca-key.pem \
--from-file=certs/cluster2/root-cert.pem \
--from-file=certs/cluster2/cert-chain.pem
kubectl apply --context kind-cluster1 -f - <<EOF
apiVersion: operator.istio.io/v1alpha1
kind: Istio
metadata:
name: default
spec:
version: v1.21.0
namespace: istio-system
updateStrategy:
type: InPlace
inactiveRevisionDeletionGracePeriodSeconds: 30
values:
pilot:
resources:
requests:
cpu: 100m
memory: 1024Mi
global:
meshID: mesh1
multiCluster:
clusterName: cluster1
network: network1
EOF
istioctl_dir/samples/multicluster/gen-eastwest-gateway.sh \
--mesh mesh1 --cluster cluster1 --network network1 | \
istioctl --context="kind-cluster1" install -y -f -
kubectl --context="kind-cluster1" apply -n istio-system -f \
istioctl_dir/samples/multicluster/expose-services.yaml
kubectl apply --context kind-cluster2 -f - <<EOF
apiVersion: operator.istio.io/v1alpha1
kind: Istio
metadata:
name: default
spec:
version: v1.21.0
namespace: istio-system
updateStrategy:
type: InPlace
inactiveRevisionDeletionGracePeriodSeconds: 30
values:
pilot:
resources:
requests:
cpu: 100m
memory: 1024Mi
global:
meshID: mesh1
multiCluster:
clusterName: cluster2
network: network2
EOF
istioctl_dir/samples/multicluster/gen-eastwest-gateway.sh \
--mesh mesh1 --cluster cluster2 --network network2 | \
istioctl --context="kind-cluster2" install -y -f -
kubectl --context="kind-cluster2" apply -n istio-system -f \
istioctl_dir/samples/multicluster/expose-services.yaml
CLUSTER2_CONTAINER_IP=$(kubectl get nodes cluster1-control-plane --context "kind-cluster1" -o jsonpath='{.status.addresses[?(@.type == "InternalIP")].address}')
istioctl create-remote-secret \
--context="kind-cluster1" \
--name=cluster1 \
--server="https://${CLUSTER2_CONTAINER_IP}:6443" | \
kubectl apply -f - --context="kind-cluster2"
CLUSTER1_CONTAINER_IP=$(kubectl get nodes cluster2-control-plane --context "kind-cluster2" -o jsonpath='{.status.addresses[?(@.type == "InternalIP")].address}')
istioctl create-remote-secret \
--context="kind-cluster2" \
--name=cluster2 \
--server="https://${CLUSTER1_CONTAINER_IP}:6443" | \
kubectl apply -f - --context="kind-cluster1"
kubectl create --context="kind-cluster1" namespace sample
kubectl create --context="kind-cluster2" namespace sample
kubectl label --context="kind-cluster1" namespace sample istio-injection=enabled
kubectl label --context="kind-cluster2" namespace sample istio-injection=enabled
kubectl apply --context="kind-cluster1" \
-f samples/helloworld/helloworld.yaml \
-l service=helloworld -n sample
kubectl apply --context="kind-cluster2" \
-f samples/helloworld/helloworld.yaml \
-l service=helloworld -n sample
kubectl apply --context="kind-cluster1" \
-f istioctl_dir/samples/helloworld/helloworld.yaml \
-l version=v1 -n sample
kubectl apply --context="kind-cluster2" \
-f istioctl_dir/samples/helloworld/helloworld.yaml \
-l version=v2 -n sample
kubectl apply --context="kind-cluster1" \
-f istioctl_dir/samples/sleep/sleep.yaml -n sample
kubectl apply --context="kind-cluster2" \
-f istioctl_dir/samples/sleep/sleep.yaml -n sample kubectl exec --context="kind-cluster1" -n sample -c sleep \
"$(kubectl get pod --context="kind-cluster1" -n sample -l \
app=sleep -o jsonpath='{.items[0].metadata.name}')" \
-- curl -sS helloworld.sample:5000/hello
kubectl exec --context="kind-cluster2" -n sample -c sleep \
"$(kubectl get pod --context="kind-cluster2" -n sample -l \
app=sleep -o jsonpath='{.items[0].metadata.name}')" \
-- curl -sS helloworld.sample:5000/hello |
I can add this test if @nrfox is ok |
@fjglira sure! |
…/none-main-merge_upstream_main-38a843ce Automator: merge upstream changes to openshift-service-mesh/sail-operator@main
Already created a |
There needs to be e2e tests to ensure you can use the Sail operator and APIs to setup a multicluster istio deployment. The tests need to cover setting up:
These e2e tests should:
istioctl install ...
: https://istio.io/latest/docs/setup/install/multicluster/multi-primary/The text was updated successfully, but these errors were encountered: