Skip to content
This repository has been archived by the owner on Nov 7, 2023. It is now read-only.

k8s-deploy: error resource mapping not found for name #66

Closed
zzhengzhuo opened this issue May 11, 2022 · 6 comments
Closed

k8s-deploy: error resource mapping not found for name #66

zzhengzhuo opened this issue May 11, 2022 · 6 comments

Comments

@zzhengzhuo
Copy link

zzhengzhuo commented May 11, 2022

When I am deploying axon according to https://github.com/nervosnetwork/axon-devops/blob/main/k8s-deploy/README.md and running command make axon-deploy, it gives me error error: resource mapping not found for name: "axon-ingress" namespace: "axon" from "./k8s/ingress/axon-ingress.yaml": no matches for kind "Ingress" in version "extensions/v1beta1".
The logs are:

./k8s/axon/deploy.sh deploy
DEBUG create configmap for axons, please wait...
configmap/node1-toml created
configmap/node2-toml created
configmap/node3-toml created
configmap/node4-toml created
configmap/genesis created
configmap/db-options created
DEBUG deploy axons, please wait...
service/axon1 unchanged
statefulset.apps/axon1 created
service/axon2 unchanged
statefulset.apps/axon2 created
service/axon3 unchanged
statefulset.apps/axon3 created
service/axon4 unchanged
statefulset.apps/axon4 created
service/axon-chain unchanged
error: resource mapping not found for name: "axon-ingress" namespace: "axon" from "./k8s/ingress/axon-ingress.yaml": no matches for kind "Ingress" in version "extensions/v1beta1"
ensure CRDs are installed first
persistentvolume/axon-logs-pv configured
persistentvolumeclaim/axon-logs-pvc configured
DEBUG waiting for axons running...
axons not stable,please have a check

Running Environment

  • docker: Docker version 20.10.12, build e91ed57

  • kind: kind version 0.13.0

    How can I fix it? Thanks for any help.

@zzhengzhuo zzhengzhuo changed the title k8s-deploy: k8s-deploy: error resource mapping not found for name May 11, 2022
@liya2017
Copy link
Contributor

Did you deploy the ingress-controller?
doc: https://kubernetes.io/zh/docs/concepts/services-networking/ingress/

@zzhengzhuo
Copy link
Author

Maybe I should learn more about k8s.
However, IMHO, the doc may need a guide that starting from zero.
Appreciate for your time, I will close this issue.

@liya2017
Copy link
Contributor

Maybe I should learn more about k8s. However, IMHO, the doc may need a guide that starting from zero. Appreciate for your time, I will close this issue.

Yes, will update the doc later

@e00dan
Copy link

e00dan commented Oct 24, 2022

Can we reopen the issue?

I get the same problem and looks like this repository is using a deprecated version of Kubernetes extensions. Check: https://kubernetes.io/docs/reference/using-api/deprecation-guide/#ingress-v122

I think k8s-deploy/k8s/ingress/axon-ingress.yaml should be using apiVersion: networking.k8s.io/v1 instead of apiVersion: extensions/v1beta1 (deprecated).

cc @liya2017 @zzhengzhuo

@liya2017
Copy link
Contributor

I think k8s-deploy/k8s/ingress/axon-ingress.yaml should be using apiVersion: networking.k8s.io/v1 instead of apiVersion: extensions/v1beta1 (deprecated).

Thanks, will have a try later.

And do you mean get the error error: resource mapping not found for name: "axon-ingress" namespace: "axon" from "./k8s/ingress/axon-ingress.yaml": no matches for kind "Ingress" in version "extensions/v1beta1" ensure CRDs are installed first? If yes ,please follow #66 (comment).

@e00dan
Copy link

e00dan commented Oct 24, 2022

I think k8s-deploy/k8s/ingress/axon-ingress.yaml should be using apiVersion: networking.k8s.io/v1 instead of apiVersion: extensions/v1beta1 (deprecated).

Thanks, will have a try later.

And do you mean get the error error: resource mapping not found for name: "axon-ingress" namespace: "axon" from "./k8s/ingress/axon-ingress.yaml": no matches for kind "Ingress" in version "extensions/v1beta1" ensure CRDs are installed first? If yes ,please follow #66 (comment).

Yes. My version of k8:

➜  k8s-deploy git:(35406eb) ✗ kubectl version --short
Flag --short has been deprecated, and will be removed in the future. The --short output will become the default.
Client Version: v1.25.0
Kustomize Version: v4.5.7
Server Version: v1.25.0

I tried running nginx ingress by using helm command and without and it didn't help:

helm upgrade --install ingress-nginx ingress-nginx   --repo https://kubernetes.github.io/ingress-nginx   --namespace nginx-ingress --create-namespace

It seems that after updating the file is started working:

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  namespace: axon
  annotations:
    kubernetes.io/ingress.class: "nginx"
  name: axon-ingress
spec:
  rules:
  - host: axon1-testnet-monitor.nervos.tech
    http:
      paths:
      - path: /
        pathType: Prefix
        backend:
          service:
            name: axon1
            port:
              number: 8100

  - host: axon2-testnet-monitor.nervos.tech
    http:
      paths:
      - path: /
        pathType: Prefix
        backend:
          service:
            name: axon2
            port:
              number: 8100

  - host: axon3-testnet-monitor.nervos.tech
    http:
      paths:
      - path: /
        pathType: Prefix
        backend:
          service:
            name: axon3
            port:
              number: 8100

  - host: axon4-testnet-monitor.nervos.tech
    http:
      paths:
      - path: /
        pathType: Prefix
        backend:
          service:
            name: axon4
            port:
              number: 8100

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

No branches or pull requests

3 participants