Spinnaker: Unexpected token '<'" at admin login page

12/27/2019

When i try to connect spinnaker ui after install, i get this error on chrome console "Uncaught SyntaxError: Unexpected token '<'" and login form is not loading.

I followed this tutorial to install spinnaker.

Screenshot at login page with errors https://prnt.sc/qe5kwn

This is my bash file prepared to install spinnaker on kubernetes

MINIO_ACCESS_KEY=samplekey
MINIO_SECRET_KEY=samplesecretkey
MINIO_ADDRESS=http://00000000:9000

KB_NS_NAME=spinnaker
KB_SERVICE_ACCOUNT_NAME=service-ac-v1
HAL_ACCOUNT_NAME=hal-account-v1

hal config provider kubernetes enable

kubectl create ns ${KB_NS_NAME}

kubectl create serviceaccount ${KB_SERVICE_ACCOUNT_NAME} -n ${KB_NS_NAME}

kubectl create clusterrolebinding ${KB_SERVICE_ACCOUNT_NAME} --clusterrole cluster-admin --serviceaccount=spinnaker:${KB_SERVICE_ACCOUNT_NAME}

TOKEN_SECRET=$(kubectl get serviceaccount -n ${KB_NS_NAME} ${KB_SERVICE_ACCOUNT_NAME} -o jsonpath='{.secrets[0].name}')

TOKEN=$(kubectl get secret -n ${KB_NS_NAME} $TOKEN_SECRET -o jsonpath='{.data.token}' | base64 --decode)

kubectl config set-credentials spinnaker-token-user --token $TOKEN

kubectl config set-context --current --user spinnaker-token-user

CONTEXT=$(kubectl config current-context)

hal config provider kubernetes account add ${HAL_ACCOUNT_NAME} --provider-version v2 --context ${CONTEXT}

hal config deploy edit --type distributed --account-name ${HAL_ACCOUNT_NAME}

hal config features edit --artifacts true

hal config storage s3 edit --access-key-id ${MINIO_ACCESS_KEY} --secret-access-key ${MINIO_SECRET_KEY} --endpoint ${MINIO_ADDRESS}

hal config storage edit --type s3

hal config security api edit --override-base-url http://spinnaker-api.abc.com

hal config security ui edit --override-base-url http//spinnaker.abc.com

hal config version edit --version 1.17.5

hal deploy apply

This is my ingress file to connect ui.

apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
  name: spin-ingress
  namespace: spinnaker
  annotations:
    kubernetes.io/ingress.class: nginx
spec:
  rules:
    - host: spinnaker-api.abc.com
      http:
        paths:
          - backend:
              serviceName: spin-gate
              servicePort: 8084
    - host: spinnaker.abc.com
      http:
        paths:
          - backend:
              serviceName: spin-deck
              servicePort: 9000
-- Taha Ergun
continuous-delivery
continuous-integration
kubernetes
spinnaker

1 Answer

12/27/2019

I have just solved the problem, it was a url routing rule.

hal config security api edit --override-base-url aaa.com
hal config security ui edit --override-base-url bbb.com
hal deploy apply
-- Taha Ergun
Source: StackOverflow