commit
854672a93a
@ -14,7 +14,7 @@ Here is a simple usage of creating a deployment from a yaml file:
|
||||
.. literalinclude:: ../../examples/create_deployment.py
|
||||
|
||||
|
||||
The following example demostrates how to create, update and delete deployments
|
||||
The following example demonstrates how to create, update and delete deployments
|
||||
without the need to read a file from the disk:
|
||||
|
||||
.. literalinclude:: ../../examples/deployment_examples.py
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
|
||||
This directory contains various examples of how to use the Python client.
|
||||
Please read the description at the top of each example for more information
|
||||
about what the script does and any prequisites. Most scripts also include
|
||||
about what the script does and any prerequisites. Most scripts also include
|
||||
comments throughout the code.
|
||||
|
||||
## Setup
|
||||
|
||||
@ -64,7 +64,7 @@ def create_deployment_object():
|
||||
|
||||
|
||||
def create_deployment(api, deployment):
|
||||
# Create deployement
|
||||
# Create deployment
|
||||
resp = api.create_namespaced_deployment(
|
||||
body=deployment, namespace="default"
|
||||
)
|
||||
|
||||
@ -17,7 +17,7 @@ This example demonstrates the following:
|
||||
- Creation of a custom resource definition (CRD) using dynamic-client
|
||||
- Creation of cluster scoped custom resources (CR) using the above created CRD
|
||||
- List, patch (update), delete the custom resources
|
||||
- Delete the custom resource defintion (CRD)
|
||||
- Delete the custom resource definition (CRD)
|
||||
"""
|
||||
|
||||
from kubernetes import config, dynamic
|
||||
|
||||
@ -98,7 +98,7 @@
|
||||
"editable": true
|
||||
},
|
||||
"source": [
|
||||
"In this example, we only start one container in the Pod. The container is an instnace of the _V1Container_ class. "
|
||||
"In this example, we only start one container in the Pod. The container is an instance of the _V1Container_ class. "
|
||||
]
|
||||
},
|
||||
{
|
||||
|
||||
@ -246,7 +246,7 @@
|
||||
"source": [
|
||||
"### View secret being used within the pod\n",
|
||||
"\n",
|
||||
"Wait for atleast 10 seconds to ensure pod is running before executing this section."
|
||||
"Wait for at least 10 seconds to ensure pod is running before executing this section."
|
||||
]
|
||||
},
|
||||
{
|
||||
|
||||
@ -98,7 +98,7 @@ def main():
|
||||
# Wait for finishing creation of controller revision
|
||||
import time
|
||||
time.sleep(15)
|
||||
# List the controller revison
|
||||
# List the controller revision
|
||||
controller_revisions = list_controller_revision(
|
||||
apps_v1_api, "default", "daemonset-redis")
|
||||
rollout_namespaced_daemon_set(
|
||||
|
||||
@ -3,11 +3,11 @@ This example covers the following:
|
||||
- Create headless server
|
||||
- Create statefulset
|
||||
- Update statefulset
|
||||
- List contoller revisions which belong to specified statefulset
|
||||
- List controller revisions which belong to specified statefulset
|
||||
- Roll out statefulset
|
||||
Note:
|
||||
If your kubernetes version is lower than 1.22(exclude 1.22), the kubernetes-client version must be lower than 1.22(alse exclude 1.22).
|
||||
Because new feature 'AvailableReplicas' for StatefulSetStatus is supported in native kubernetes since version 1.22, mismatch version between kubernetes and kubernetes-client will raise execption ValueError
|
||||
If your kubernetes version is lower than 1.22(exclude 1.22), the kubernetes-client version must be lower than 1.22(also exclude 1.22).
|
||||
Because new feature 'AvailableReplicas' for StatefulSetStatus is supported in native kubernetes since version 1.22, mismatch version between kubernetes and kubernetes-client will raise exception ValueError
|
||||
"""
|
||||
|
||||
|
||||
@ -128,7 +128,7 @@ def main():
|
||||
# Wait for finishing creation of controller revision
|
||||
import time
|
||||
time.sleep(15)
|
||||
# List the controller revison
|
||||
# List the controller revision
|
||||
controller_revisions = list_controller_revision(
|
||||
apps_v1_api, "default", "statefulset-redis")
|
||||
rollout_namespaced_stateful_set(
|
||||
|
||||
@ -665,7 +665,7 @@ class ConfigNode(object):
|
||||
class KubeConfigMerger:
|
||||
|
||||
"""Reads and merges configuration from one or more kube-config's.
|
||||
The propery `config` can be passed to the KubeConfigLoader as config_dict.
|
||||
The property `config` can be passed to the KubeConfigLoader as config_dict.
|
||||
|
||||
It uses a path attribute from ConfigNode to store the path to kubeconfig.
|
||||
This path is required to load certs from relative paths.
|
||||
|
||||
@ -150,7 +150,7 @@ class ResourceList(Resource):
|
||||
raise ValueError('The `items` field in the body must be populated when calling methods on a ResourceList')
|
||||
|
||||
if self.kind != kind:
|
||||
raise ValueError('Methods on a {} must be called with a body containing the same kind. Receieved {} instead'.format(self.kind, kind))
|
||||
raise ValueError('Methods on a {} must be called with a body containing the same kind. Received {} instead'.format(self.kind, kind))
|
||||
|
||||
return {
|
||||
'api_version': api_version,
|
||||
|
||||
@ -94,7 +94,7 @@ class ConfigMapLock:
|
||||
:param name: name of the lock to be updated
|
||||
:param namespace: namespace the lock is in
|
||||
:param updated_record: the updated election record
|
||||
:return: True if update is succesful False if it fails
|
||||
:return: True if update is successful False if it fails
|
||||
"""
|
||||
try:
|
||||
# Set the updated record
|
||||
|
||||
@ -258,7 +258,7 @@ class PortForward:
|
||||
|
||||
Port Forward command sends on 2 channels per port, a read/write
|
||||
data channel and a read only error channel. Both channels are sent an
|
||||
initial frame contaning the port number that channel is associated with.
|
||||
initial frame containing the port number that channel is associated with.
|
||||
"""
|
||||
|
||||
self.websocket = websocket
|
||||
|
||||
@ -94,7 +94,7 @@ class DiscoveryV1EndpointPort(object):
|
||||
def name(self):
|
||||
"""Gets the name of this DiscoveryV1EndpointPort. # noqa: E501
|
||||
|
||||
The name of this port. All ports in an EndpointSlice must have a unique name. If the EndpointSlice is dervied from a Kubernetes service, this corresponds to the Service.ports[].name. Name must either be an empty string or pass DNS_LABEL validation: * must be no more than 63 characters long. * must consist of lower case alphanumeric characters or '-'. * must start and end with an alphanumeric character. Default is empty string. # noqa: E501
|
||||
The name of this port. All ports in an EndpointSlice must have a unique name. If the EndpointSlice is derived from a Kubernetes service, this corresponds to the Service.ports[].name. Name must either be an empty string or pass DNS_LABEL validation: * must be no more than 63 characters long. * must consist of lower case alphanumeric characters or '-'. * must start and end with an alphanumeric character. Default is empty string. # noqa: E501
|
||||
|
||||
:return: The name of this DiscoveryV1EndpointPort. # noqa: E501
|
||||
:rtype: str
|
||||
@ -105,7 +105,7 @@ class DiscoveryV1EndpointPort(object):
|
||||
def name(self, name):
|
||||
"""Sets the name of this DiscoveryV1EndpointPort.
|
||||
|
||||
The name of this port. All ports in an EndpointSlice must have a unique name. If the EndpointSlice is dervied from a Kubernetes service, this corresponds to the Service.ports[].name. Name must either be an empty string or pass DNS_LABEL validation: * must be no more than 63 characters long. * must consist of lower case alphanumeric characters or '-'. * must start and end with an alphanumeric character. Default is empty string. # noqa: E501
|
||||
The name of this port. All ports in an EndpointSlice must have a unique name. If the EndpointSlice is derived from a Kubernetes service, this corresponds to the Service.ports[].name. Name must either be an empty string or pass DNS_LABEL validation: * must be no more than 63 characters long. * must consist of lower case alphanumeric characters or '-'. * must start and end with an alphanumeric character. Default is empty string. # noqa: E501
|
||||
|
||||
:param name: The name of this DiscoveryV1EndpointPort. # noqa: E501
|
||||
:type: str
|
||||
|
||||
@ -5,7 +5,7 @@ EndpointPort represents a Port used by an EndpointSlice
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**app_protocol** | **str** | The application protocol for this port. This field follows standard Kubernetes label syntax. Un-prefixed names are reserved for IANA standard service names (as per RFC-6335 and https://www.iana.org/assignments/service-names). Non-standard protocols should use prefixed names such as mycompany.com/my-custom-protocol. | [optional]
|
||||
**name** | **str** | The name of this port. All ports in an EndpointSlice must have a unique name. If the EndpointSlice is dervied from a Kubernetes service, this corresponds to the Service.ports[].name. Name must either be an empty string or pass DNS_LABEL validation: * must be no more than 63 characters long. * must consist of lower case alphanumeric characters or '-'. * must start and end with an alphanumeric character. Default is empty string. | [optional]
|
||||
**name** | **str** | The name of this port. All ports in an EndpointSlice must have a unique name. If the EndpointSlice is derived from a Kubernetes service, this corresponds to the Service.ports[].name. Name must either be an empty string or pass DNS_LABEL validation: * must be no more than 63 characters long. * must consist of lower case alphanumeric characters or '-'. * must start and end with an alphanumeric character. Default is empty string. | [optional]
|
||||
**port** | **int** | The port number of the endpoint. If this is not specified, ports are not restricted and must be interpreted in the context of the specific consumer. | [optional]
|
||||
**protocol** | **str** | The IP protocol for this port. Must be UDP, TCP, or SCTP. Default is TCP. | [optional]
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
# V1PersistentVolumeClaimCondition
|
||||
|
||||
PersistentVolumeClaimCondition contails details about state of pvc
|
||||
PersistentVolumeClaimCondition contains details about state of pvc
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
|
||||
@ -4,7 +4,7 @@ PodDisruptionBudgetStatus represents information about the status of a PodDisrup
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**conditions** | [**list[V1Condition]**](V1Condition.md) | Conditions contain conditions for PDB. The disruption controller sets the DisruptionAllowed condition. The following are known values for the reason field (additional reasons could be added in the future): - SyncFailed: The controller encountered an error and wasn't able to compute the number of allowed disruptions. Therefore no disruptions are allowed and the status of the condition will be False. - InsufficientPods: The number of pods are either at or below the number required by the PodDisruptionBudget. No disruptions are allowed and the status of the condition will be False. - SufficientPods: There are more pods than required by the PodDisruptionBudget. The condition will be True, and the number of allowed disruptions are provided by the disruptionsAllowed property. | [optional]
|
||||
**conditions** | [**list[V1Condition]**](V1Condition.md) | Conditions contain conditions for PDB. The disruption controller sets the DisruptionAllowed condition. The following are known values for the reason field (additional reasons could be added in the future): - SyncFailed: The controller encountered an error and wasn't't able to compute the number of allowed disruptions. Therefore no disruptions are allowed and the status of the condition will be False. - InsufficientPods: The number of pods are either at or below the number required by the PodDisruptionBudget. No disruptions are allowed and the status of the condition will be False. - SufficientPods: There are more pods than required by the PodDisruptionBudget. The condition will be True, and the number of allowed disruptions are provided by the disruptionsAllowed property. | [optional]
|
||||
**current_healthy** | **int** | current number of healthy pods |
|
||||
**desired_healthy** | **int** | minimum desired number of healthy pods |
|
||||
**disrupted_pods** | **dict(str, datetime)** | DisruptedPods contains information about pods whose eviction was processed by the API server eviction subresource handler but has not yet been observed by the PodDisruptionBudget controller. A pod will be in this map from the time when the API server processed the eviction request to the time when the pod is seen by PDB controller as having been marked for deletion (or after a timeout). The key in the map is the name of the pod and the value is the time when the API server processed the eviction request. If the deletion didn't occur and a pod is still there it will be removed from the list automatically by PodDisruptionBudget controller after some time. If everything goes smooth this map should be empty for the most of the time. Large number of entries in the map may indicate problems with pod deletions. | [optional]
|
||||
|
||||
@ -20,7 +20,7 @@
|
||||
# find_latest_patch_version finds the latest released patch version for the
|
||||
# given branch.
|
||||
# We use the version to track what API surface the generated Python client
|
||||
# cooresponds to, and collect all API change release notes up to that version.
|
||||
# corresponds to, and collect all API change release notes up to that version.
|
||||
# There is one tricky point: the code generator we use pulls the latest OpenAPI
|
||||
# spec from the given branch. The spec may contain API changes that aren't
|
||||
# documented in the Kubernetes release notes. Until the code generator pulls
|
||||
|
||||
Loading…
Reference in New Issue
Block a user