kubernetes-client / kubernetes-client/python

create_from_yaml custom resource

Open
#740 25 comments 14 reactions 1 assignee Claimed by @micw523 View on GitHub
lifecycle/frozen
Dominant language
Python
Stars
7.7k
Forks
3.5k
Avg merge
1d 14h
Merged PRs (30d)
18

Description

I've got a custom resource description and I need to create custom resource for it. I've been able to create it using `client.CustomObjectsApi(api_client).create_namespaced_custom_object(...)` and using `kubectl apply -f`. I tried using the utils.create_from_yaml but it fails with a traceback:

```
utils.create_from_yaml(self._api_client, f.name)
File "/usr/lib/python3.6/site-packages/kubernetes/utils/create_from_yaml.py", line 53, in create_from_yaml
k8s_api = getattr(client, fcn_to_call)(k8s_client)
AttributeError: module 'kubernetes.client' has no attribute 'Brantlk.comV1Api'
```

yaml is like:
```
apiVersion: brantlk.com/v1
kind: MyCustomResource
metadata:
name: brant-instance
namespace: default
spec:
repositories: []
```

Pretty obvious what the problem is from the code.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.