python icon indicating copy to clipboard operation
python copied to clipboard

create_namespaced_custom_object returns 404

Open cham-d opened this issue 3 years ago • 5 comments

What happened (please include outputs or screenshots): I tried to use create_namespaced_custom_object but i'm getting HTTP response body: 404 page not found image I use k3d locally.

How to reproduce it (as minimally and precisely as possible):

def applyyamlfile(yamlfile,namespace):    
    config.load_kube_config()
    k8s_api = client.CustomObjectsApi()
    group = 'split.smi-spec.io' 
    version = 'v1alpha1' 
    namespace = namespace 
    plural = 'TrafficSplit' 
    body=yaml.safe_load(yamlfile) 
    api_response = k8s_api.create_namespaced_custom_object(group, version, namespace, plural, body)
yamlfile = "apiVersion: split.smi-spec.io/v1alpha1
kind: TrafficSplit
metadata:
  name: traffic-split-v3
  namespace: default
spec:
  service: productcatalogservice
  backends:
  - service: productcatalogservice-first
    weight: 900m
  - service: productcatalogservice
    weight: 100m"

namespace = 'default'

Environment:

  • Kubernetes version (kubectl version): v1.22.4
  • OS (e.g., MacOS 10.13.6): Ubuntu 20.04
  • Python version (python --version) 3.8.10 (i also tried 3.6.15)
  • Python client version (pip list | grep kubernetes) 21.0.0-snapshot

cham-d avatar Jan 25 '22 12:01 cham-d

/assign

roycaihw avatar Jan 31 '22 17:01 roycaihw

The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle stale
  • Mark this issue or PR as rotten with /lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot avatar Jun 16 '22 11:06 k8s-triage-robot

I too have this issue. Any fix I can try?

codezart avatar Jun 23 '22 15:06 codezart

@cham-d

def applyyamlfile(yamlfile,namespace):    
    config.load_kube_config()
    k8s_api = client.CustomObjectsApi()
    group = 'split.smi-spec.io' 
    version = 'v1alpha1' 
    namespace = namespace 
    plural = 'TrafficSplit' 
    body=yaml.safe_load(yamlfile) 
    api_response = k8s_api.create_namespaced_custom_object(group, version, namespace, plural, body)

I think plural = 'trafficsplits' should fix the issue. You need to pass the plural name ('trafficsplits'), not kind ('TrafficSplit'). https://github.com/servicemeshinterface/smi-sdk-go/blob/main/crds/split.yaml#L14

Solpax avatar Jun 30 '22 10:06 Solpax

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten

k8s-triage-robot avatar Jul 30 '22 10:07 k8s-triage-robot

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Reopen this issue or PR with /reopen
  • Mark this issue or PR as fresh with /remove-lifecycle rotten
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/close

k8s-triage-robot avatar Aug 29 '22 11:08 k8s-triage-robot

@k8s-triage-robot: Closing this issue.

In response to this:

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Reopen this issue or PR with /reopen
  • Mark this issue or PR as fresh with /remove-lifecycle rotten
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

k8s-ci-robot avatar Aug 29 '22 11:08 k8s-ci-robot