armory / spinnaker-operator

Open Source Spinnaker Kubernetes Operator source code
Apache License 2.0
186 stars 71 forks source link

resource mapping not found for name: "spinnaker" namespace: "spinnaker" from "STDIN": no matches for kind "SpinnakerService" in version "spinnaker.io/v1alpha2" #264

Open tirelibirefe opened 2 years ago

tirelibirefe commented 2 years ago

Hello, This is what I do...

Installing operator: helm install armory-spinnaker-operator -n spinnaker-operator --wait armory/armory-spinnaker-operator

things work; no problem.

$ k get crd -A | grep spinnaker
armoryaccounts.spinnaker.armory.io                    2022-08-03T23:28:51Z
spinnakerservices.spinnaker.armory.io                 2022-08-03T23:28:51Z

$ k api-resources | grep spin
armoryaccounts                    armoryaccount   spinnaker.armory.io/v1alpha2                true         ArmoryAccount
spinnakerservices                 spinsvc         spinnaker.armory.io/v1alpha2                true         SpinnakerService

this is my spinnakerservice manifest:

apiVersion: spinnaker.io/v1alpha2
kind: SpinnakerService
metadata:
  name: spinnaker
spec:
  spinnakerConfig:
    config:
      version: 1.27.0
      persistentStorage:
        persistentStoreType: s3
        s3:
          bucket: $S3_BUCKET
          rootFolder: front50
          region: eu-central-1
          accessKeyId: AKIAKNLKJNLNLBLAVLA
          secretAccessKey: asdşfhUblalblbalalblawerwrwrt
  expose:
    type: service
    service:
      type: ClusterIP

I get the following error:

error: resource mapping not found for name: "spinnaker" namespace: "spinnaker" from "STDIN": no matches 
for kind "SpinnakerService" in version "spinnaker.io/v1alpha2"
ensure CRDs are installed first

Am I missing something? Could you please advise?

Thanks & Regards

ichi0915 commented 2 years ago

I found a similar issue when you try to install the operator and spinnaker in a single namespace, currently working on this Branch to solve that, I think those changes might also solve this issue.

tirelibirefe commented 2 years ago

Oh thanks for your reply; Maybe there is a quick workaround which you can advise until you fix the problem? I need to deploy a Spinnaker but stuck the problem, cannot progress.

tirelibirefe commented 2 years ago

I installed the operator which you referenced; now I get following error message:

Error from server (InternalError): error when creating "STDIN": Internal error occurred: failed calling webhook "webhook-spinnakerservices-v1alpha2.spinnaker.io": Post "https://spinnaker-operator.spinnaker-operator.svc:443/validate-spinnaker-io-v1alpha2-spinnakerservice?timeout=10s": Address is not allowed

ichi0915 commented 2 years ago

Sorry I just saw that your are using spinnaker.armory.io, those resources come from the armory operator not the spinnaker operator, the armory operator is an extension of the Spinnaker Operator and its on a different repo.

Your manifest is correct you are using apiVersion: spinnaker.io/v1alpha2 but not your operator, to install spinnaker in your current operator you should be using apiVersion: spinnaker.armory.io/v1alpha2 and also change version to 2.27.3.

when using this operator you should see this output:

$ kubectl api-resources | grep spin
spinnakeraccounts                 spinaccount   spinnaker.io/v1alpha2                  true         SpinnakerAccount
spinnakerservices                 spinsvc       spinnaker.io/v1alpha2                  true         SpinnakerService
tirelibirefe commented 2 years ago

@ichi0915 thanks for your advise. Good catch! I think I was misunderstood. Currently I would like to go on with Armory; so I just replaced apiVersion: spinnaker.io/v1alpha2 with apiVersion: spinnaker.armory.io/v1alpha2 and changed version in my SpinnakerService yaml . (I used version: 2.28.0, because I don't have enterprise Armory.) My current config is that;

$ kubectl api-resources | grep spin
armoryaccounts                    armoryaccount   spinnaker.armory.io/v1alpha2                true         ArmoryAccount
spinnakerservices                 spinsvc         spinnaker.armory.io/v1alpha2                true         SpinnakerService

SpinnakerService

apiVersion: spinnaker.armory.io/v1alpha2
kind: SpinnakerService
metadata:
  name: spinnaker
spec:
  spinnakerConfig:
    config:
      version: 2.28.0
      persistentStorage:
        persistentStoreType: s3
        s3:
          bucket: $S3_BUCKET
          rootFolder: front50
          region: eu-central-1
          accessKeyId: AKIAXXXXXXXXX
          secretAccessKey: xxxxxxxxxxxxxxxx
  expose:
    type: service
    service:
      type: ClusterIP
$ k get svc -n spinnaker-operator
NAME                         TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)             AGE
spinnaker-operator           ClusterIP   172.20.232.37   <none>        443/TCP             25m
spinnaker-operator-metrics   ClusterIP   172.20.202.48   <none>        8686/TCP,8383/TCP   25m

...and the result:

Error from server (InternalError): error when creating "STDIN": Internal error occurred: failed calling webhook "webhook-spinnakerservices-v1alpha2.spinnaker.armory.io": Post "https://spinnaker-operator.spinnaker-operator.svc:443/validate-spinnaker-armory-io-v1alpha2-spinnakerservice?timeout=10s": no endpoints available for service "spinnaker-operator"

ichi0915 commented 2 years ago

Hi @tirelibirefe, sorry for the delay, where you able to install spinnaker?

if not I recommend checking this guide Install the Operator

or maybe try using the bash script in this repo to install it Armory kustomize patches the script deploy.sh deploys the operator and then spinnaker

IDK why it is giving you the error failed calling webhook, what version of k8s are you using maybe I can try to replicate the issue or we can talk in slack and get on a call to check this

initisan commented 1 year ago

Hi @ichi0915 we have a similar error failed calling webhook thrown when trying deploy armory/spinnaker-operator:1.3.0-rc.21, could you help to check https://github.com/armory/spinnaker-operator/issues/276

willzhang commented 11 months ago

same error ,when install operator, maybe should wait some time ,then apply spinsvc

kubernetes v1.27.7 operator:v1.4.0 spinnaker: v1.32.2 OS: ubuntu 22.04

root@node40:~# sealos run registry.cn-shenzhen.aliyuncs.com/cnmirror/spinnaker-operator:v1.4.0 
2023-11-22T16:21:24 info start to install app in this cluster
2023-11-22T16:21:24 info Executing SyncStatusAndCheck Pipeline in InstallProcessor
2023-11-22T16:21:24 info Executing ConfirmOverrideApps Pipeline in InstallProcessor
2023-11-22T16:21:24 info Executing PreProcess Pipeline in InstallProcessor
2023-11-22T16:21:24 info Executing pipeline MountRootfs in InstallProcessor.
2023-11-22T16:21:27 info Executing pipeline MirrorRegistry in InstallProcessor.
2023-11-22T16:21:27 info trying default http mode to sync images to hosts [192.168.72.40:22]
2023-11-22T16:23:35 info Executing UpgradeIfNeed Pipeline in InstallProcessor
customresourcedefinition.apiextensions.k8s.io/spinnakeraccounts.spinnaker.io created
customresourcedefinition.apiextensions.k8s.io/spinnakerservices.spinnaker.io created
customresourcedefinition.apiextensions.k8s.io/spinnakeraccounts.spinnaker.io condition met
customresourcedefinition.apiextensions.k8s.io/spinnakerservices.spinnaker.io condition met
deployment.apps/spinnaker-operator created
clusterrole.rbac.authorization.k8s.io/spinnaker-operator-role created
clusterrolebinding.rbac.authorization.k8s.io/spinnaker-operator-binding created
serviceaccount/spinnaker-operator created
Waiting for deployment "spinnaker-operator" rollout to finish: 0 out of 1 new replicas have been updated...
Waiting for deployment "spinnaker-operator" rollout to finish: 0 of 1 updated replicas are available...
deployment "spinnaker-operator" successfully rolled out
ingress.networking.k8s.io/spin-ingress created
Error from server (InternalError): error when creating "manifests/spinnakerservice.yml": Internal error occurred: failed calling webhook "webhook-spinnakerservices-v1alpha2.spinnaker.io": failed to call webhook: Post "https://spinnaker-operator.spinnaker-operator.svc:443/validate-spinnaker-io-v1alpha2-spinnakerservice?timeout=10s": context deadline exceeded
Error: exit status 1