Repository navigation
Closed
Labels
help wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.
Description
The *.py files in the examples/ directory need updates for various reasons. Some of them could also use better file names and more commenting within the files (alternatively, there could be a README.md that provides more information about setup and each file). Below are the files that I have tested and found issues for.
- create_deployment.py: seems redundant with
deployment_examples.pyandcreate_deployment_from_yaml.py, I think it should be merged with one of those - create_deployment_from_yaml.py: fix the associated
nginx-deployment.yamlwhich creates pods that go to a state of crashloopbackoff - create_thirdparty_resource.md: in progress of being replaced with a custom resource definition example with add example of using custom resources #848
- deployment_examples.py: add documentation
- example1.py: add documentation and use more descriptive filename
- example2.py: add documentation and use more descriptive filename
- example3.py: add documentation and use more descriptive filename
- example4.py: add documentation and use more descriptive filename, also the
print("Active host is %s" % configuration.host)line throws the errorAttributeError: module 'kubernetes.client.configuration' has no attribute 'host'-- in progress with https://github.com/kubernetes-client/python/pull/846/files - exec.py: add documentation explaining what this does
- in_cluster_config.py: create YAML for in-cluster pod
- manage_node_labels.py: add documentation that it is for minikube only
-
nginx-deployment.yaml: using this withfixed by Deprecate extensions/v1beta1 deployment #888create_deployment_from_yaml.pycreates nginx pods that immediately go to a state of crashloopbackoff - remote_cluster.py: the
list_pod_for_all_namespacesmethod returns a 401 unauthorized error, probably needs RBAC?
Examples without issues:
- multiple_clusters.py
- job_examples.py (https://github.com/kubernetes-client/python/pull/786/files)
Reacted by Haowei Cai (Roy), Xianglong Wang, Douglas Ferreira, Matthew Greenwald and Eva Gonciarczyk
Metadata
Metadata
Assignees
Labels
help wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.
Activity
roycaihw commentedon Jul 19, 2019
This is awesome! Thanks for looking into the examples and putting together this summary.
Some additional thoughts:
micw523 commentedon Jul 19, 2019
The
create_deploymentandcreate_deployment_from_yamldoes the same thing except that the deployment is performed using different ways.I wonder what's happening with the yaml deployment though. The source function for calling the yaml method should be the same.
micw523 commentedon Jul 19, 2019
/help
k8s-ci-robot commentedon Jul 19, 2019
@micw523:
This request has been marked as needing help from a contributor.
Please ensure the request meets the requirements listed here.
If this request no longer meets these requirements, the label can be removed
by commenting with the
/remove-helpcommand.Details
In response to this:
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.
roycaihw commentedon Jul 22, 2019
The yaml file models from https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#creating-a-deployment. It's probably something wrong with the container image 1.7.9. Please update the yaml file to be the same as https://k8s.io/examples/controllers/nginx-deployment.yaml
Deploymenthas been removed fromextensions/v1beta1in 1.15, we should update the examplescreate_deployment.pyandcreate_deployment_from_yaml.pyto useapps/v1insteadmicw523 commentedon Jul 22, 2019
Sounds good. Looks like the e2e tests would need this update too. Let me quickly fix this today.
scottilee commentedon Aug 2, 2019
I will start organizing and fixing these examples in the week after next (busy next week unfortunately) and hopefully most of the pull requests trying to update examples will be merged by then as well.
zmunro commentedon Sep 5, 2019
There is also an issue with the
custom_objects.pyexample, but I am not sure if the issue is with the example or the api itself. I have not been able to call this api without getting an error. Below is the error output when I try to run thecustom_objects.pymodule, and the error is similar when I try to call the API from elsewhere:roycaihw commentedon Sep 10, 2019
@zmunro The 404 error sounds like the apiserver doesn't understand the requested API resource. Have you registered the CRD to apiserver?
python/examples/custom_object.py
Lines 18 to 36 in a5cb3d7
It's probably better to have the example run the CRD creation for you
micw523 commentedon Sep 11, 2019
@roycaihw the comment is addressed in #948, the issue that the author of the comment raised.
Merge pull request #938 from scottilee/examples