I'm running a react container in Kubernetes
env (AKS) with an istio gateway
In local env, everything works well using docker build && docker run
In Kubernetes, for each npm package, the response I'm getting is status code: 200, response content-type: text/html
, and the response content is of index.html
which is why I'm assuming package was not found?
- When checking docker dist content, I can assert that the package is there (for example
/dist/npm.babel.4fca54....chunk.js
is present - docker image is built using a base context:
docker build -t imagename --build-arg PUBLIC_URL=/base-app .
- index.html is valid and contains valid script declarations. for example
<script type="text/javascript" src="/base-app/npm.babel.743f....chunk.js"></script>
Istio Gateway
spec:
selector:
istio: ingressgateway
servers:
- hosts:
- dev.myDomain.com
port:
name: https
number: 443
protocol: HTTPS
tls:
credentialName: someCreds
mode: SIMPLE
Istio VS
- match:
- uri:
prefix: /base-app
route:
- destination:
host: svc-app
port:
number: 8000
Example for a Request + headers
Request URL: https://dev.myDomain.com/base-app/npm.babel.4fca5....chunk.js
Request Method: GET
Status Code: 200
Remote Address: xxx.xxx.xxx:443
Referrer Policy: no-referrer-when-downgrade
Response Headers
accept-ranges: bytes
content-length: 11920 ---> length of index.html
content-type: text/html --> bad needs to be text/javascript
date: Tue, 11 Aug 2020 21:30:07 GMT
etag: "5f32aff9-2e90"
last-modified: Tue, 11 Aug 2020 14:49:29 GMT
server: istio-envoy
status: 200
x-envoy-upstream-service-time: 4