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

"nats-0" not found when using --without-tls #13

Closed
jason-magnetic-io opened this issue Dec 1, 2019 · 2 comments
Closed

"nats-0" not found when using --without-tls #13

jason-magnetic-io opened this issue Dec 1, 2019 · 2 comments

Comments

@jason-magnetic-io
Copy link

jason-magnetic-io commented Dec 1, 2019

On GKE (1.13.11-gke.14), this works as expected:

curl -sSL https://nats-io.github.io/k8s/setup.sh | sh

On an identical GKE (1.13.11-gke.14) this fails with pods "nats-0" not found after 10 attempts when using --without-tls:

curl -sSL https://nats-io.github.io/k8s/setup.sh | sh -s -- --without-tls

The nats StatefulSet reports:

create Pod nats-0 in StatefulSet nats failed error: pods "nats-0" is forbidden:
error looking up service account default/nats-server: serviceaccount "nats-server"
not found
kubectl get pods
NAME                                     READY   STATUS             RESTARTS   AGE
nats-box                                 1/1     Running            0          68s
nats-setup                               1/1     Running            0          73s
nats-surveyor-5cfcb988b8-s46fb           0/1     CrashLoopBackOff   3          64s
nats-surveyor-grafana-7d79564b7c-p4kbs   1/1     Running            0          65s
prometheus-nats-prometheus-0             3/3     Running            1          54s
prometheus-nats-surveyor-0               3/3     Running            1          54s
prometheus-operator-55599c56b5-59c9s     1/1     Running            0          66s
stan-0                                   2/2     Running            0          67s
stan-1                                   2/2     Running            0          48s
stan-2                                   2/2     Running            0          29s

Log:

curl -sSL https://nats-io.github.io/k8s/setup.sh | sh -s -- --without-tls
serviceaccount/nats-setup created
clusterrolebinding.rbac.authorization.k8s.io/nats-setup-binding created
clusterrole.rbac.authorization.k8s.io/nats-setup created
pod/nats-setup created
pod/nats-setup condition met

##############################################
#                                            #
#  _   _    _  _____ ____   _  _____ ____    #
# | \ | |  / \|_   _/ ___| | |/ ( _ ) ___|   #
# |  \| | / _ \ | | \___ \ | ' // _ \___ \   #
# | |\  |/ ___ \| |  ___) || . \ (_) |__) |  #
# |_| \_/_/   \_\_| |____(_)_|\_\___/____/   #
#                                            #
#                    nats-setup (v0.1.6)     #
##############################################

 +---------------------+---------------------+
 |                 OPTIONS                   |
 +---------------------+---------------------+
         nats server   | true
         nats surveyor | true
         nats tls      | false
        enable auth    | true
  install cert_manager | false
      nats streaming   | true
 +-------------------------------------------+
 |                                           |
 | Starting setup...                         |
 |                                           |
 +-------------------------------------------+


[ OK ] generated and stored operator key "OAGZKSUZA3LQ6XVX3ZURBKDOXIUXF2VYGEDA5FYEI645GJMMJ2RHN2II"
[ OK ] added operator "KO"
[ OK ] generated and stored account key "ABXDSNI4AWZMDBNE4JKS5MHWBLALGSPGVRINYDVSVTBOKPTWBDDHBUTC"
[ OK ] added account "SYS"
[ OK ] generated and stored user key "UBMGTZZHLQA66SRYSKJHCMT3SWGJQ5IPNWV7ZU2WTKTUY7D2PW5MODMM"
[ OK ] generated user creds file "/nsc/nkeys/creds/KO/SYS/sys.creds"
[ OK ] added user "sys" to account "SYS"
[ OK ] generated and stored account key "ADYMVM3TEE6PDJTQEDYEQIBVVJE5LK7LJO4CBOZWDWTJQZRZVDELEZAF"
[ OK ] added account "A"
[ OK ] generated and stored user key "UCOTNH5EIHSJDDJEKQ3VWL4UAO6RWHLC7NNKKA2TIYEF2TJ2NVTM6UIB"
[ OK ] generated user creds file "/nsc/nkeys/creds/KO/A/test.creds"
[ OK ] added user "test" to account "A"
[ OK ] added public service export "test"
[ OK ] generated and stored account key "ACQJGNWNDVE6INIYX5J6QFRBMM2XPPG6PCOARJ5ZOPI723M5WZVQ5Y7N"
[ OK ] added account "B"
[ OK ] generated and stored user key "UANCKJBJDNA5ZY5C3OHWLDMSIOIOXOMEGIAVDDA5RUDMS5Q5OT6ECC7C"
[ OK ] generated user creds file "/nsc/nkeys/creds/KO/B/test.creds"
[ OK ] added user "test" to account "B"
[ OK ] added service import "test"
[ OK ] generated and stored account key "ACLWTVMZGU4HIXMFTWK6A3NU2IKXYCYAK36A6TVMEEUS6MXXOBM5SSHY"
[ OK ] added account "STAN"
[ OK ] generated and stored user key "UAFPDILQIOQPRSJKKCZ22SK2OXHXJA24PKCYHIJH3J2BVP5UVVFAQIWC"
[ OK ] generated user creds file "/nsc/nkeys/creds/KO/STAN/stan.creds"
[ OK ] added user "stan" to account "STAN"
secret/nats-sys-creds created
secret/nats-test-creds created
secret/nats-test2-creds created
secret/stan-creds created
configmap/nats-accounts created
configmap/nats-config created
service/nats created
statefulset.apps/nats created
pod/nats-box created
configmap/stan-config created
service/stan created
statefulset.apps/stan created
clusterrolebinding.rbac.authorization.k8s.io/prometheus-operator created
clusterrole.rbac.authorization.k8s.io/prometheus-operator created
deployment.apps/prometheus-operator created
serviceaccount/prometheus-operator created
service/prometheus-operator created
serviceaccount/prometheus created
clusterrole.rbac.authorization.k8s.io/prometheus created
clusterrolebinding.rbac.authorization.k8s.io/prometheus created
service/nats-prometheus created
Retrying in 3 secondsunable to recognize "https://raw.githubusercontent.com/nats-io/k8s/93c2a213bd26791fda29da2b7238e3f3b1ca36e1/tools/nats-prometheus.yml": no matches for kind "Prometheus" in version "monitoring.coreos.com/v1"
unable to recognize "https://raw.githubusercontent.com/nats-io/k8s/93c2a213bd26791fda29da2b7238e3f3b1ca36e1/tools/nats-prometheus.yml": no matches for kind "ServiceMonitor" in version "monitoring.coreos.com/v1"
...
service/nats-prometheus unchanged
Retrying in 3 seconds (2 attempts so far)unable to recognize "https://raw.githubusercontent.com/nats-io/k8s/93c2a213bd26791fda29da2b7238e3f3b1ca36e1/tools/nats-prometheus.yml": no matches for kind "Prometheus" in version "monitoring.coreos.com/v1"
unable to recognize "https://raw.githubusercontent.com/nats-io/k8s/93c2a213bd26791fda29da2b7238e3f3b1ca36e1/tools/nats-prometheus.yml": no matches for kind "ServiceMonitor" in version "monitoring.coreos.com/v1"
...
service/nats-prometheus unchanged
prometheus.monitoring.coreos.com/nats-prometheus created
servicemonitor.monitoring.coreos.com/nats created
service/grafana created
deployment.apps/nats-surveyor-grafana created
service/nats-surveyor-prometheus created
configmap/nats-surveyor-observations created
deployment.apps/nats-surveyor created
service/nats-surveyor created
prometheus.monitoring.coreos.com/nats-surveyor created
servicemonitor.monitoring.coreos.com/nats-surveyor created
Retrying in 3 secondsError from server (NotFound): pods "nats-0" not found
...
Retrying in 3 seconds (2 attempts so far)Error from server (NotFound): pods "nats-0" not found
...
Retrying in 3 seconds (3 attempts so far)Error from server (NotFound): pods "nats-0" not found
...
Retrying in 3 seconds (4 attempts so far)Error from server (NotFound): pods "nats-0" not found
...
Retrying in 3 seconds (5 attempts so far)Error from server (NotFound): pods "nats-0" not found
...
Error from server (NotFound): pods "nats-0" not found
Retrying in 3 seconds (6 attempts so far)...
Retrying in 3 seconds (7 attempts so far)Error from server (NotFound): pods "nats-0" not found
...
Retrying in 3 seconds (8 attempts so far)Error from server (NotFound): pods "nats-0" not found
...
Error from server (NotFound): pods "nats-0" not found
Retrying in 3 seconds (9 attempts so far)...
Retrying in 3 seconds (10 attempts so far)Error from server (NotFound): pods "nats-0" not found
...
Could not finish setting up NATS due to errors in the cluster
command terminated with exit code 1
@wallyqs
Copy link
Member

wallyqs commented Dec 3, 2019

Fixed via #14 Thanks!

@wallyqs wallyqs closed this as completed Dec 3, 2019
@lsoica
Copy link

lsoica commented Dec 22, 2020

The nats-setup image version 0.1.6 references an old commit and the service account is not there yet.
https://raw.githubusercontent.com/nats-io/k8s/93c2a213bd26791fda29da2b7238e3f3b1ca36e1/nats-server/nats-server-with-auth.yml

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

3 participants