Class: Deployment#
Hierarchy#
WorkloadKubeObject
↳ Deployment
Table of contents#
Constructors#
Properties#
Accessors#
Methods#
- delete
- getAffinity
- getAffinityNumber
- getAge
- getAnnotations
- getConditions
- getConditionsText
- getCreationTimestamp
- getFinalizers
- getId
- getLabels
- getName
- getNodeSelectors
- getNs
- getOwnerRefs
- getReplicas
- getResourceVersion
- getSearchFields
- getSelectors
- getTemplateLabels
- getTimeDiffFromNow
- getTolerations
- patch
- toPlainObject
- update
- create
- isJsonApiData
- isJsonApiDataList
- isKubeJsonApiListMetadata
- isKubeJsonApiMetadata
- isNonSystem
- isPartialJsonApiData
- isPartialJsonApiMetadata
- stringifyLabels
Constructors#
constructor#
• new Deployment(data)
Parameters#
| Name | Type |
|---|---|
data |
KubeJsonApiData |
Overrides#
WorkloadKubeObject.constructor
Properties#
apiVersion#
• apiVersion: string
Inherited from#
WorkloadKubeObject.apiVersion
kind#
• kind: string
Inherited from#
WorkloadKubeObject.kind
managedFields#
• Optional managedFields: any
Inherited from#
WorkloadKubeObject.managedFields
metadata#
• metadata: KubeObjectMetadata
Inherited from#
WorkloadKubeObject.metadata
spec#
• spec: Object
Type declaration#
| Name | Type |
|---|---|
replicas |
number |
selector |
LabelSelector |
strategy |
Object |
strategy.rollingUpdate |
Object |
strategy.rollingUpdate.maxSurge |
number |
strategy.rollingUpdate.maxUnavailable |
number |
strategy.type |
string |
template |
Object |
template.metadata |
Object |
template.metadata.annotations? |
Object |
template.metadata.creationTimestamp? |
string |
template.metadata.labels |
Object |
template.spec |
Object |
template.spec.affinity? |
IAffinity |
template.spec.containers |
{ args?: string[] ; env?: { name: string ; value: string }[] ; image: string ; imagePullPolicy: string ; livenessProbe?: IContainerProbe ; name: string ; ports?: { containerPort: number ; name: string ; protocol: string }[] ; readinessProbe?: IContainerProbe ; resources: { limits?: { cpu: string ; memory: string } ; requests: { cpu: string ; memory: string } } ; startupProbe?: IContainerProbe ; terminationMessagePath: string ; terminationMessagePolicy: string ; volumeMounts?: { mountPath: string ; name: string }[] }[] |
template.spec.dnsPolicy |
string |
template.spec.nodeSelector? |
Object |
template.spec.restartPolicy |
string |
template.spec.schedulerName |
string |
template.spec.securityContext |
Object |
template.spec.serviceAccount |
string |
template.spec.serviceAccountName |
string |
template.spec.terminationGracePeriodSeconds |
number |
template.spec.tolerations? |
{ effect: string ; key: string ; operator: string ; tolerationSeconds: number }[] |
template.spec.volumes? |
{ configMap: { defaultMode: number ; name: string ; optional: boolean } ; name: string }[] |
Overrides#
WorkloadKubeObject.spec
status#
• status: Object
Type declaration#
| Name | Type |
|---|---|
availableReplicas? |
number |
conditions |
{ lastTransitionTime: string ; lastUpdateTime: string ; message: string ; reason: string ; status: string ; type: string }[] |
observedGeneration |
number |
readyReplicas |
number |
replicas |
number |
unavailableReplicas? |
number |
updatedReplicas |
number |
Overrides#
WorkloadKubeObject.status
apiBase#
▪ Static apiBase: string = "/apis/apps/v1/deployments"
Overrides#
WorkloadKubeObject.apiBase
kind#
▪ Static kind: string = "Deployment"
Overrides#
WorkloadKubeObject.kind
namespaced#
▪ Static namespaced: boolean = true
Overrides#
WorkloadKubeObject.namespaced
Accessors#
selfLink#
• get selfLink(): string
Returns#
string
Inherited from#
WorkloadKubeObject.selfLink
Methods#
delete#
▸ delete(params?): Promise<KubeJsonApiData>
deprecated use KubeApi.delete instead
Parameters#
| Name | Type |
|---|---|
params? |
JsonApiParams<any> |
Returns#
Promise<KubeJsonApiData>
Inherited from#
WorkloadKubeObject.delete
getAffinity#
▸ getAffinity(): IAffinity
Returns#
IAffinity
Inherited from#
WorkloadKubeObject.getAffinity
getAffinityNumber#
▸ getAffinityNumber(): number
Returns#
number
Inherited from#
WorkloadKubeObject.getAffinityNumber
getAge#
▸ getAge(humanize?, compact?, fromNow?): string | number
deprecated This function computes a new "now" on every call might cause subtle issues if called multiple times
NOTE: this function also is not reactive to updates in the current time so it should not be used for renderering
Parameters#
| Name | Type | Default value |
|---|---|---|
humanize |
boolean |
true |
compact |
boolean |
true |
fromNow |
boolean |
false |
Returns#
string | number
Inherited from#
WorkloadKubeObject.getAge
getAnnotations#
▸ getAnnotations(filter?): string[]
Parameters#
| Name | Type | Default value |
|---|---|---|
filter |
boolean |
false |
Returns#
string[]
Inherited from#
WorkloadKubeObject.getAnnotations
getConditions#
▸ getConditions(activeOnly?): { lastTransitionTime: string ; lastUpdateTime: string ; message: string ; reason: string ; status: string ; type: string }[]
Parameters#
| Name | Type | Default value |
|---|---|---|
activeOnly |
boolean |
false |
Returns#
{ lastTransitionTime: string ; lastUpdateTime: string ; message: string ; reason: string ; status: string ; type: string }[]
getConditionsText#
▸ getConditionsText(activeOnly?): string
Parameters#
| Name | Type | Default value |
|---|---|---|
activeOnly |
boolean |
true |
Returns#
string
getCreationTimestamp#
▸ getCreationTimestamp(): number
This function computes the number of milliseconds from the UNIX EPOCH to the creation timestamp of this object.
Returns#
number
Inherited from#
WorkloadKubeObject.getCreationTimestamp
getFinalizers#
▸ getFinalizers(): string[]
Returns#
string[]
Inherited from#
WorkloadKubeObject.getFinalizers
getId#
▸ getId(): string
Returns#
string
Inherited from#
WorkloadKubeObject.getId
getLabels#
▸ getLabels(): string[]
Returns#
string[]
Inherited from#
WorkloadKubeObject.getLabels
getName#
▸ getName(): string
Returns#
string
Inherited from#
WorkloadKubeObject.getName
getNodeSelectors#
▸ getNodeSelectors(): string[]
Returns#
string[]
Inherited from#
WorkloadKubeObject.getNodeSelectors
getNs#
▸ getNs(): string
Returns#
string
Inherited from#
WorkloadKubeObject.getNs
getOwnerRefs#
▸ getOwnerRefs(): { apiVersion: string ; blockOwnerDeletion: boolean ; controller: boolean ; kind: string ; name: string ; namespace: string ; uid: string }[]
Returns#
{ apiVersion: string ; blockOwnerDeletion: boolean ; controller: boolean ; kind: string ; name: string ; namespace: string ; uid: string }[]
Inherited from#
WorkloadKubeObject.getOwnerRefs
getReplicas#
▸ getReplicas(): number
Returns#
number
getResourceVersion#
▸ getResourceVersion(): string
Returns#
string
Inherited from#
WorkloadKubeObject.getResourceVersion
getSearchFields#
▸ getSearchFields(): string[]
Returns#
string[]
Inherited from#
WorkloadKubeObject.getSearchFields
getSelectors#
▸ getSelectors(): string[]
Returns#
string[]
Inherited from#
WorkloadKubeObject.getSelectors
getTemplateLabels#
▸ getTemplateLabels(): string[]
Returns#
string[]
Inherited from#
WorkloadKubeObject.getTemplateLabels
getTimeDiffFromNow#
▸ getTimeDiffFromNow(): number
deprecated This function computes a new "now" on every call which might cause subtle issues if called multiple times
NOTE: Generally you can use getCreationTimestamp instead.
Returns#
number
Inherited from#
WorkloadKubeObject.getTimeDiffFromNow
getTolerations#
▸ getTolerations(): IToleration[]
Returns#
IToleration[]
Inherited from#
WorkloadKubeObject.getTolerations
patch#
▸ patch(patch): Promise<KubeJsonApiData>
deprecated use KubeApi.patch instead
Parameters#
| Name | Type |
|---|---|
patch |
Patch |
Returns#
Promise<KubeJsonApiData>
Inherited from#
WorkloadKubeObject.patch
toPlainObject#
▸ toPlainObject(): object
Returns#
object
Inherited from#
WorkloadKubeObject.toPlainObject
update#
▸ update(data): Promise<KubeJsonApiData>
Perform a full update (or more specifically a replace)
Note: this is brittle if data is not actually partial (but instead whole).
As fields such as resourceVersion will probably out of date. This is a
common race condition.
deprecated use KubeApi.update instead
Parameters#
| Name | Type |
|---|---|
data |
Partial<Deployment> |
Returns#
Promise<KubeJsonApiData>
Inherited from#
WorkloadKubeObject.update
create#
▸ Static create(data): KubeObject<KubeObjectMetadata, any, any>
Parameters#
| Name | Type |
|---|---|
data |
KubeJsonApiData |
Returns#
KubeObject<KubeObjectMetadata, any, any>
Inherited from#
WorkloadKubeObject.create
isJsonApiData#
▸ Static isJsonApiData(object): object is KubeJsonApiData
Parameters#
| Name | Type |
|---|---|
object |
unknown |
Returns#
object is KubeJsonApiData
Inherited from#
WorkloadKubeObject.isJsonApiData
isJsonApiDataList#
▸ Static isJsonApiDataList<T>(object, verifyItem): object is KubeJsonApiDataList<T>
Type parameters#
| Name |
|---|
T |
Parameters#
| Name | Type |
|---|---|
object |
unknown |
verifyItem |
(val: unknown) => val is T |
Returns#
object is KubeJsonApiDataList<T>
Inherited from#
WorkloadKubeObject.isJsonApiDataList
isKubeJsonApiListMetadata#
▸ Static isKubeJsonApiListMetadata(object): object is KubeJsonApiListMetadata
Parameters#
| Name | Type |
|---|---|
object |
unknown |
Returns#
object is KubeJsonApiListMetadata
Inherited from#
WorkloadKubeObject.isKubeJsonApiListMetadata
isKubeJsonApiMetadata#
▸ Static isKubeJsonApiMetadata(object): object is KubeJsonApiMetadata
Parameters#
| Name | Type |
|---|---|
object |
unknown |
Returns#
object is KubeJsonApiMetadata
Inherited from#
WorkloadKubeObject.isKubeJsonApiMetadata
isNonSystem#
▸ Static isNonSystem(item): boolean
Parameters#
| Name | Type |
|---|---|
item |
KubeObject<KubeObjectMetadata, any, any> | KubeJsonApiData |
Returns#
boolean
Inherited from#
WorkloadKubeObject.isNonSystem
isPartialJsonApiData#
▸ Static isPartialJsonApiData(object): object is Partial<KubeJsonApiData>
Parameters#
| Name | Type |
|---|---|
object |
unknown |
Returns#
object is Partial<KubeJsonApiData>
Inherited from#
WorkloadKubeObject.isPartialJsonApiData
isPartialJsonApiMetadata#
▸ Static isPartialJsonApiMetadata(object): object is Partial<KubeJsonApiMetadata>
Parameters#
| Name | Type |
|---|---|
object |
unknown |
Returns#
object is Partial<KubeJsonApiMetadata>
Inherited from#
WorkloadKubeObject.isPartialJsonApiMetadata
stringifyLabels#
▸ Static stringifyLabels(labels?): string[]
Parameters#
| Name | Type |
|---|---|
labels? |
Object |
Returns#
string[]
Inherited from#
WorkloadKubeObject.stringifyLabels