Skip to content
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

No Endpoints Showing - MIME type ("text/html") is not a valid JavaScript MIME type. #71

Open
PiePra opened this issue May 17, 2023 · 1 comment

Comments

@PiePra
Copy link

PiePra commented May 17, 2023

After the kserve models webapp was deployed for a standalone installation no isvc endpoints show up.
Browser console tells that ".../dashboard_lib.bundle.js" was loaded even though its MIME type ("text/html") is not a valid JavaScript MIME type.
Then erroring out because of a syntax error. Thus the typescipt is not loaded.
models-web-app-error

I deployed the webapp as follows:

kustomization.yaml

resources:
- rbac.yaml
- service.yaml
- deployment.yaml
- istio.yaml

commonLabels:
  kustomize.component: kserve-models-web-app
  app.kubernetes.io/component: kserve-models-web-app

configMapGenerator:
  - name: kserve-models-web-app-config
    namespace: kserve
    literals:
    - APP_DISABLE_AUTH="True"
    - APP_PREFIX="/"
    - APP_SECURE_COOKIES="True"

deployment.yaml

apiVersion: apps/v1
kind: Deployment
metadata:
  name: kserve-models-web-app
  namespace: kserve
spec:
  replicas: 1
  selector:
    matchLabels:
      app.kubernetes.io/component: kserve-models-web-app
  template:
    metadata:
      labels:
        app.kubernetes.io/component: kserve-models-web-app
    spec:
      containers:
      - image: docker.io/kserve/models-web-app:latest
        imagePullPolicy: Always
        name: kserve-models-web-app
        envFrom:
          - configMapRef:
              name: kserve-models-web-app-config
        ports:
        - containerPort: 5000
          name: http
        livenessProbe:
          httpGet:
            path: /healthz/liveness
            port: http
          initialDelaySeconds: 0
          periodSeconds: 10
          timeoutSeconds: 1
          failureThreshold: 3
          successThreshold: 1
        readinessProbe:
          httpGet:
            path: /healthz/readiness
            port: http
          initialDelaySeconds: 0
          periodSeconds: 10
          timeoutSeconds: 1
          failureThreshold: 3
          successThreshold: 1
      serviceAccountName: kserve-models-web-app

service.yaml

apiVersion: v1
kind: Service
metadata:
  name: kserve-models-web-app
  namespace: kserve
spec:
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: 5000
  selector:
    app.kubernetes.io/component: kserve-models-web-app
  type: ClusterIP

istio.yaml

apiVersion: networking.istio.io/v1beta1
kind: Gateway
metadata:
  name: models
  namespace: kserve
spec:
  selector:
    app: istio-ingressgateway
    istio: ingressgateway
  servers:
  - hosts:
    - {{ host }}
    port:
      name: https
      number: 443
      protocol: HTTPS
    tls:
      credentialName: models
      mode: SIMPLE
  - hosts:
    - {{ host }}
    port:
      name: http
      number: 80
      protocol: HTTP
    tls:
      httpsRedirect: true
---
apiVersion: networking.istio.io/v1beta1
kind: VirtualService
metadata:
  name: models
  namespace: kserve
spec:
  gateways:
  - models
  hosts:
  - '{{ host }}'
  http:
  - match:
    - uri:
        prefix: /
    route:
    - destination:
        host: kserve-models-web-app.kserve.svc.cluster.local
        port:
          number: 80 

rbac.yaml

apiVersion: v1
kind: ServiceAccount
metadata:
  name: kserve-models-web-app
  namespace: kserve
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: kserve-models-web-app-cluster-role
rules:
- apiGroups:
  - authorization.k8s.io
  resources:
  - subjectaccessreviews
  verbs:
  - create
- apiGroups:
  - ""
  resources:
  - namespaces
  - pods
  - pods/log
  - events
  verbs:
  - get
  - list
- apiGroups:
  - serving.kserve.io
  resources:
  - inferenceservices
  - inferenceservices/status
  verbs:
  - get
  - list
  - watch
  - create
  - delete
  - deletecollection
  - patch
  - update
- apiGroups:
  - serving.knative.dev
  resources:
  - services
  - services/status
  - routes
  - routes/status
  - configurations
  - configurations/status
  - revisions
  - revisions/status
  verbs:
  - get
  - list
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: kserve-models-web-app-binding
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: kserve-models-web-app-cluster-role
subjects:
- kind: ServiceAccount
  name: kserve-models-web-app
  namespace: kserve
@capoolebugchat
Copy link

Got the same problem. Any leads on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants