Primary-Remote, vm integration, bookinfo mysql Error: Connection lost: The server closed the connection

Hello,

I have follow Istio / Install Primary-Remote for install istio on 2 clusters.

cluster1:
1 master - 2 worker, kubernetes v1.23.4:

apiVersion: install.istio.io/v1alpha1
kind: IstioOperator
spec:
  values:
    global:
      meshID: mesh1
      multiCluster:
        clusterName: cluster1
      network: network1

cluster2
1 master - 2 worker, rancher-rke2 v1.22.7+rke2r1:

apiVersion: install.istio.io/v1alpha1
kind: IstioOperator
spec:
  values:
    global:
      meshID: mesh1
      multiCluster:
        clusterName: cluster2
      network: network2
      remotePilotAddress: 10.20.0.22

All VMs are on the 10.20.0.0/24 network.
Ok, it’s work.

But I do not understand:
I) Istio / Virtual Machine Installation - prepare-the-guide-environment

$ VM_APP="<the name of the application this VM will run>"
$ VM_NAMESPACE="<the name of your service namespace>"
$ WORK_DIR="<a certificate working directory>"
$ SERVICE_ACCOUNT="<name of the Kubernetes service account you want to use for your VM>"
$ CLUSTER_NETWORK=""
$ VM_NETWORK=""
$ CLUSTER="Kubernetes"

I want to integrate the VM into the cluster1, so I think
CLUSTER_NETWORK="network1"
but for VM_NETWORK it’s

  • ""
  • network1
  • 10.20.0.0/24

:thinking:

At this time, I have:

  • VM_APP=“mysqldb”
  • VM_NAMESPACE=“vm”
  • WORK_DIR="~/istio-1.13.2/vm"
  • SERVICE_ACCOUNT=“vm”
  • CLUSTER_NETWORK=“network1”
  • VM_NETWORK=“10.20.0.0/24”
  • CLUSTER=“cluster1”

2) Istio / Virtual Machine Installation -create-files-to-transfer-to-the-virtual-machine

istioctl x workload entry configure -f workloadgroup.yaml -o "${WORK_DIR}" --clusterID "${CLUSTER}"

create a ${WORK_DIR}/root-cert.pem certificate … but we should not use the certificate ~/istio-1.13.2/certs/cluster1/root-cert.pem
:thinking:

Thank you for your clarification / help

I have test with $ VM_NETWORK=“10.20.0.0/24”.

Everything seems to be working, but in the logs of the pods ratings-v2-mysql-vm-xxxxx, I have

GET /ratings/0
Error: Connection lost: The server closed the connection.
    at Protocol.end (/opt/microservices/node_modules/mysql/lib/protocol/Protocol.js:112:13)
    at Socket.<anonymous> (/opt/microservices/node_modules/mysql/lib/Connection.js:94:28)
    at Socket.<anonymous> (/opt/microservices/node_modules/mysql/lib/Connection.js:526:10)
    at Socket.emit (events.js:327:22)
    at endReadableNT (_stream_readable.js:1221:12)
    at processTicksAndRejections (internal/process/task_queues.js:84:21)
    --------------------
    at Protocol._enqueue (/opt/microservices/node_modules/mysql/lib/protocol/Protocol.js:144:48)
    at Protocol.handshake (/opt/microservices/node_modules/mysql/lib/protocol/Protocol.js:51:23)
    at Connection.connect (/opt/microservices/node_modules/mysql/lib/Connection.js:116:18)
    at /opt/microservices/ratings.js:109:18
    at /opt/microservices/node_modules/httpdispatcher/httpdispatcher.js:130:3
    at HttpChain.next (/opt/microservices/node_modules/httpdispatcher/httpdispatcher.js:123:9)
    at HttpDispatcher.doDispatch (/opt/microservices/node_modules/httpdispatcher/httpdispatcher.js:58:13)
    at HttpDispatcher.dispatch (/opt/microservices/node_modules/httpdispatcher/httpdispatcher.js:74:14)
    at Server.handleRequest (/opt/microservices/ratings.js:248:16)
    at Server.emit (events.js:315:20) {
  fatal: true,
  code: 'PROTOCOL_CONNECTION_LOST'
}

Do you know where this problem can come from ?
Thank you