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/
- Build pilot
sudo GOOS=linux DEBUG=1 make docker.pilot
- 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
- ssh to minikube
minikube ssh
or switch minikube daemon
eval $(minikube docker-env)
- Import the image into minikube Docker
docker load -i istio_pilot.tar
-
Tag the newly import image docker tag my-local/istio_pilot:latest
-
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
-
Setup istioD port forwarding from 40000.
-
Add Intellij remote debug from host:localhost and port 40000