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

clusternet hub can not create resource with apiversion that different from prioritized apiversion #677

Open
xrmzju opened this issue Apr 27, 2023 · 1 comment
Labels
kind/bug Something isn't working

Comments

@xrmzju
Copy link
Contributor

xrmzju commented Apr 27, 2023

  • in k8s v1.22, autoscaling/v1 is prioritized for horizontalpodautoscalers
kubectl api-resources --api-group=autoscaling
NAME                       SHORTNAMES   APIVERSION       NAMESPACED   KIND
horizontalpodautoscalers   hpa          autoscaling/v1   true         HorizontalPodAutoscaler
  • create horizontalpodautoscalers with apiversion autoscaling/v2beta2, kubectl(kube-apiserver) resulted with success, but kubectl-clusternet(clusternet-hub) report with the API version in the data (autoscaling/v2beta2) does not match the expected API version (autoscaling/v1).
# use kubectl clusternet
kubectl clusternet apply -f hpa.yaml
Error from server (BadRequest): error when creating "hpa.yaml": the API version in the data (autoscaling/v2beta2) does not match the expected API version (autoscaling/v1)

# use kubectl 
kubectl apply -f hpa.yaml
horizontalpodautoscaler.autoscaling/test-hpa created
  • hpa.yaml
apiVersion: autoscaling/v2beta2
kind: HorizontalPodAutoscaler
metadata:
  creationTimestamp: null
  name: test-hpa
  namespace: default
spec:
  maxReplicas: 10
  metrics:
  - pods:
      metric:
        name: pod_cpu_limit_usage
      target:
        averageValue: 50m
        type: AverageValue
    type: Pods
  minReplicas: 1
  scaleTargetRef:
    apiVersion: apps/v1
    kind: Deployment
    name: test-deployment

Environment:

  • Clusternet version:

    • Clusternet-hub version (user clusternet-hub --version=json): v0.10.0
  • Kubernetes version (use kubectl version): v1.22.5

@xrmzju xrmzju added the kind/bug Something isn't working label Apr 27, 2023
@dixudx
Copy link
Member

dixudx commented Apr 27, 2023

This is a known issue that clusternet-hub will pick out preferred version or highest semantic version. In Kubernetes v1.22, autoscaling/v1 has the highest priority than autoscaling/v2beta2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants