Skip to content

tahirali-csc/how-build-istio-from-code

Repository files navigation

Install istio from code on minikube.

From base directory, run:

go run istioctl/cmd/istioctl/main.go install

Install examples

From the base directory, follow booksinfo https://istio.io/latest/docs/examples/bookinfo/

Follow all step thru Gateway and access the product page on browser:

minikube service productpage

and replace the browser URL with

http://Host:NodePort/productpage

Build and Debug [Workaround approach]

From Istio base directory, create this mkdir -p ./out/linux_amd64/docker_build/docker.pilot/

a). Add this in pilot/docker/Dockerfile.pilot

#ENTRYPOINT ["/usr/local/bin/pilot-discovery"]

EXPOSE 40000
COPY ./dlv/dlv /usr/local/bin/dlv
ENTRYPOINT ["/usr/local/bin/dlv", "--listen=:40000", "--headless=true", "--api-version=2", "exec", "/usr/local/bin/pilot-discovery", "--"]

b). Copy dlv in ./out/linux_amd64/docker_build/docker.pilot/

  1. Build pilot
sudo GOOS=linux DEBUG=1 make docker.pilot
  1. Export istio/pilot image to tar if we using local machine Docker daemon. Grab the image id.
docker save <IMG ID> -o istio_pilot.tar
  1. ssh to minikube
minikube ssh

or switch minikube daemon

eval $(minikube docker-env)
  1. Import the image into minikube Docker
docker load -i istio_pilot.tar
  1. Tag the newly import image docker tag my-local/istio_pilot:latest

  2. Change IstioD deployment. Update image, pullPolicy and expose DEBUG Port

   image: <IMAGE>
   imagePullPolicy: Never
   ....
       - containerPort: 40000
         protocol: TCP  
```yaml         

You might have tweak securityContext for dlv. Change this in IstioD deploymet:
```yaml
      securityContext:
            capabilities:
              drop:
                - ALL
            runAsUser: 1337
            runAsGroup: 1337
            runAsNonRoot: true
            readOnlyRootFilesystem: false
            allowPrivilegeEscalation: true         
  1. Setup istioD port forwarding from 40000.

  2. Add Intellij remote debug from host:localhost and port 40000

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages