### Container and Pod Configuration Example Source: https://github.com/kubernetes-client/javascript/blob/main/src/gen/docs/AppsV1Api.md Example configuration for container startup probes, volume mounts, and DNS settings within a pod specification. ```javascript runAsUserName: "runAsUserName_example", }, }, startupProbe: { exec: { command: [ "command_example", ], }, failureThreshold: 1, grpc: { port: 1, service: "service_example", }, httpGet: { host: "host_example", httpHeaders: [ { name: "name_example", value: "value_example", }, ], path: "path_example", port: "port_example", scheme: "scheme_example", }, initialDelaySeconds: 1, periodSeconds: 1, successThreshold: 1, tcpSocket: { host: "host_example", port: "port_example", }, terminationGracePeriodSeconds: 1, timeoutSeconds: 1, }, stdin: true, stdinOnce: true, terminationMessagePath: "terminationMessagePath_example", terminationMessagePolicy: "terminationMessagePolicy_example", tty: true, volumeDevices: [ { devicePath: "devicePath_example", name: "name_example", }, ], volumeMounts: [ { mountPath: "mountPath_example", mountPropagation: "mountPropagation_example", name: "name_example", readOnly: true, recursiveReadOnly: "recursiveReadOnly_example", subPath: "subPath_example", subPathExpr: "subPathExpr_example", }, ], workingDir: "workingDir_example", }, ], dnsConfig: { nameservers: [ "nameservers_example", ], options: [ { name: "name_example", value: "value_example", }, ], searches: [ "searches_example", ], }, dnsPolicy: "dnsPolicy_example", enableServiceLinks: true, ephemeralContainers: [ { args: [ "args_example", ], command: [ "command_example", ], env: [ { name: "name_example", value: "value_example", valueFrom: { configMapKeyRef: { key: "key_example", name: "name_example", optional: true, }, fieldRef: { apiVersion: "apiVersion_example", fieldPath: "fieldPath_example", }, fileKeyRef: { key: "key_example", optional: true, path: "path_example", volumeName: "volumeName_example", }, resourceFieldRef: { containerName: "containerName_example", divisor: "divisor_example", resource: "resource_example", }, secretKeyRef: { key: "key_example", name: "name_example", optional: true, }, }, }, ], envFrom: [ { configMapRef: { name: "name_example", optional: true, }, prefix: "prefix_example", secretRef: { name: "name_example", optional: true, }, }, ], image: "image_example", imagePullPolicy: "imagePullPolicy_example", lifecycle: { postStart: { exec: { command: [ "command_example", ], }, httpGet: { host: "host_example", httpHeaders: [ { name: "name_example", value: "value_example", }, ], path: "path_example", port: "port_example", scheme: "scheme_example", } ``` -------------------------------- ### Kubernetes Object Configuration Example Source: https://github.com/kubernetes-client/javascript/blob/main/src/gen/docs/AppsV1Api.md Example configuration object demonstrating various fields including securityContext, volumes, and topologySpreadConstraints. ```javascript { name: "name_example", }, ], schedulingGroup: { podGroupName: "podGroupName_example", }, securityContext: { appArmorProfile: { localhostProfile: "localhostProfile_example", type: "type_example", }, fsGroup: 1, fsGroupChangePolicy: "fsGroupChangePolicy_example", runAsGroup: 1, runAsNonRoot: true, runAsUser: 1, seLinuxChangePolicy: "seLinuxChangePolicy_example", seLinuxOptions: { level: "level_example", role: "role_example", type: "type_example", user: "user_example", }, seccompProfile: { localhostProfile: "localhostProfile_example", type: "type_example", }, supplementalGroups: [ 1, ], supplementalGroupsPolicy: "supplementalGroupsPolicy_example", sysctls: [ { name: "name_example", value: "value_example", }, ], windowsOptions: { gmsaCredentialSpec: "gmsaCredentialSpec_example", gmsaCredentialSpecName: "gmsaCredentialSpecName_example", hostProcess: true, runAsUserName: "runAsUserName_example", }, }, serviceAccount: "serviceAccount_example", serviceAccountName: "serviceAccountName_example", setHostnameAsFQDN: true, shareProcessNamespace: true, subdomain: "subdomain_example", terminationGracePeriodSeconds: 1, tolerations: [ { effect: "effect_example", key: "key_example", operator: "operator_example", tolerationSeconds: 1, value: "value_example", }, ], topologySpreadConstraints: [ { labelSelector: { matchExpressions: [ { key: "key_example", operator: "operator_example", values: [ "values_example", ], }, ], matchLabels: { "key": "key_example", }, }, matchLabelKeys: [ "matchLabelKeys_example", ], maxSkew: 1, minDomains: 1, nodeAffinityPolicy: "nodeAffinityPolicy_example", nodeTaintsPolicy: "nodeTaintsPolicy_example", topologyKey: "topologyKey_example", whenUnsatisfiable: "whenUnsatisfiable_example", }, ], volumes: [ { awsElasticBlockStore: { fsType: "fsType_example", partition: 1, readOnly: true, volumeID: "volumeID_example", }, azureDisk: { cachingMode: "cachingMode_example", diskName: "diskName_example", diskURI: "diskURI_example", fsType: "fsType_example", kind: "kind_example", readOnly: true, }, azureFile: { readOnly: true, secretName: "secretName_example", shareName: "shareName_example", }, cephfs: { monitors: [ "monitors_example", ], path: "path_example", readOnly: true, secretFile: "secretFile_example", secretRef: { name: "name_example", }, user: "user_example", }, cinder: { fsType: "fsType_example", readOnly: true, secretRef: { name: "name_example", }, volumeID: "volumeID_example", }, configMap: { defaultMode: 1, items: [ { key: "key_example", mode: 1, path: "path_example", }, ], name: "name_example", optional: true, }, csi: { driver: "driver_example", fsType: "fsType_example", nodePublishSecretRef: { name: "name_example", }, readOnly: true, volumeAttributes: { "key": "key_example", }, }, downwardAPI: { defaultMode: 1, ``` -------------------------------- ### Kubernetes Resource Configuration Example Source: https://github.com/kubernetes-client/javascript/blob/main/src/gen/docs/AppsV1Api.md Example structure for defining container specifications, security contexts, and resource constraints. ```javascript name: "name_example", request: "request_example", }, ], limits: { "key": "key_example", }, requests: { "key": "key_example", }, }, restartPolicy: "restartPolicy_example", restartPolicyRules: [ { action: "action_example", exitCodes: { operator: "operator_example", values: [ 1, ], }, }, ], securityContext: { allowPrivilegeEscalation: true, appArmorProfile: { localhostProfile: "localhostProfile_example", type: "type_example", }, capabilities: { add: [ "add_example", ], drop: [ "drop_example", ], }, privileged: true, procMount: "procMount_example", readOnlyRootFilesystem: true, runAsGroup: 1, runAsNonRoot: true, runAsUser: 1, seLinuxOptions: { level: "level_example", role: "role_example", type: "type_example", user: "user_example", }, seccompProfile: { localhostProfile: "localhostProfile_example", type: "type_example", }, windowsOptions: { gmsaCredentialSpec: "gmsaCredentialSpec_example", gmsaCredentialSpecName: "gmsaCredentialSpecName_example", hostProcess: true, runAsUserName: "runAsUserName_example", }, }, startupProbe: { exec: { command: [ "command_example", ], }, failureThreshold: 1, grpc: { port: 1, service: "service_example", }, httpGet: { host: "host_example", httpHeaders: [ { name: "name_example", value: "value_example", }, ], path: "path_example", port: "port_example", scheme: "scheme_example", }, initialDelaySeconds: 1, periodSeconds: 1, successThreshold: 1, tcpSocket: { host: "host_example", port: "port_example", }, terminationGracePeriodSeconds: 1, timeoutSeconds: 1, }, stdin: true, stdinOnce: true, terminationMessagePath: "terminationMessagePath_example", terminationMessagePolicy: "terminationMessagePolicy_example", tty: true, volumeDevices: [ { devicePath: "devicePath_example", name: "name_example", }, ], volumeMounts: [ { mountPath: "mountPath_example", mountPropagation: "mountPropagation_example", name: "name_example", readOnly: true, recursiveReadOnly: "recursiveReadOnly_example", subPath: "subPath_example", subPathExpr: "subPathExpr_example", }, ], workingDir: "workingDir_example", }, ], nodeName: "nodeName_example", nodeSelector: { "key": "key_example", }, os: { name: "name_example", }, overhead: { "key": "key_example", }, preemptionPolicy: "preemptionPolicy_example", priority: 1, priorityClassName: "priorityClassName_example", readinessGates: [ { conditionType: "conditionType_example", }, ], resourceClaims: [ { name: "name_example", resourceClaimName: "resourceClaimName_example", resourceClaimTemplateName: "resourceClaimTemplateName_example", }, ], resources: { claims: [ { name: "name_example", request: "request_example", }, ], limits: { ``` -------------------------------- ### Pod and Container Configuration Example Source: https://github.com/kubernetes-client/javascript/blob/main/src/gen/docs/AppsV1Api.md Example structure for defining pod scheduling constraints, container environment variables, and lifecycle hooks. ```javascript }, ], requiredDuringSchedulingIgnoredDuringExecution: [ { labelSelector: { matchExpressions: [ { key: "key_example", operator: "operator_example", values: [ "values_example", ], }, ], matchLabels: { "key": "key_example", }, }, matchLabelKeys: [ "matchLabelKeys_example", ], mismatchLabelKeys: [ "mismatchLabelKeys_example", ], namespaceSelector: { matchExpressions: [ { key: "key_example", operator: "operator_example", values: [ "values_example", ], }, ], matchLabels: { "key": "key_example", }, }, namespaces: [ "namespaces_example", ], topologyKey: "topologyKey_example", }, ], }, }, automountServiceAccountToken: true, containers: [ { args: [ "args_example", ], command: [ "command_example", ], env: [ { name: "name_example", value: "value_example", valueFrom: { configMapKeyRef: { key: "key_example", name: "name_example", optional: true, }, fieldRef: { apiVersion: "apiVersion_example", fieldPath: "fieldPath_example", }, fileKeyRef: { key: "key_example", optional: true, path: "path_example", volumeName: "volumeName_example", }, resourceFieldRef: { containerName: "containerName_example", divisor: "divisor_example", resource: "resource_example", }, secretKeyRef: { key: "key_example", name: "name_example", optional: true, }, }, }, ], envFrom: [ { configMapRef: { name: "name_example", optional: true, }, prefix: "prefix_example", secretRef: { name: "name_example", optional: true, }, }, ], image: "image_example", imagePullPolicy: "imagePullPolicy_example", lifecycle: { postStart: { exec: { command: [ "command_example", ], }, httpGet: { host: "host_example", httpHeaders: [ { name: "name_example", value: "value_example", }, ], path: "path_example", port: "port_example", scheme: "scheme_example", }, sleep: { seconds: 1, }, tcpSocket: { host: "host_example", port: "port_example", }, }, preStop: { exec: { command: [ "command_example", ], }, httpGet: { host: "host_example", httpHeaders: [ { name: "name_example", value: "value_example", }, ], path: "path_example", port: "port_example", scheme: "scheme_example", }, sleep: { seconds: 1, }, tcpSocket: { host: "host_example", port: "port_example", }, }, }, }, ] ``` -------------------------------- ### BatchV1Api Object Configuration Example Source: https://github.com/kubernetes-client/javascript/blob/main/src/gen/docs/BatchV1Api.md Example structure for defining metadata and specification fields for a Kubernetes resource. ```javascript }, creationTimestamp: new Date('1970-01-01T00:00:00.00Z'), deletionGracePeriodSeconds: 1, deletionTimestamp: new Date('1970-01-01T00:00:00.00Z'), finalizers: [ "finalizers_example", ], generateName: "generateName_example", generation: 1, labels: { "key": "key_example", }, managedFields: [ { apiVersion: "apiVersion_example", fieldsType: "fieldsType_example", fieldsV1: {}, manager: "manager_example", operation: "operation_example", subresource: "subresource_example", time: new Date('1970-01-01T00:00:00.00Z'), }, ], name: "name_example", namespace: "namespace_example", ownerReferences: [ { apiVersion: "apiVersion_example", blockOwnerDeletion: true, controller: true, kind: "kind_example", name: "name_example", uid: "uid_example", }, ], resourceVersion: "resourceVersion_example", selfLink: "selfLink_example", uid: "uid_example", }, spec: { activeDeadlineSeconds: 1, affinity: { nodeAffinity: { preferredDuringSchedulingIgnoredDuringExecution: [ { preference: { matchExpressions: [ { key: "key_example", operator: "operator_example", values: [ "values_example", ], }, ], matchFields: [ { key: "key_example", operator: "operator_example", values: [ "values_example", ], }, ], }, weight: 1, }, ], requiredDuringSchedulingIgnoredDuringExecution: { nodeSelectorTerms: [ { matchExpressions: [ { key: "key_example", operator: "operator_example", values: [ "values_example", ], }, ], matchFields: [ { key: "key_example", operator: "operator_example", values: [ "values_example", ], }, ], }, ], }, }, podAffinity: { preferredDuringSchedulingIgnoredDuringExecution: [ { podAffinityTerm: { labelSelector: { matchExpressions: [ { key: "key_example", operator: "operator_example", values: [ "values_example", ], }, ], matchLabels: { "key": "key_example", }, }, matchLabelKeys: [ "matchLabelKeys_example", ], mismatchLabelKeys: [ "mismatchLabelKeys_example", ], namespaceSelector: { matchExpressions: [ { key: "key_example", operator: "operator_example", values: [ "values_example", ], }, ], matchLabels: { "key": "key_example", }, }, namespaces: [ ``` -------------------------------- ### Install Dependencies Source: https://github.com/kubernetes-client/javascript/blob/main/CONTRIBUTING.md Install project dependencies using npm. This is a prerequisite for development. ```console npm install ``` -------------------------------- ### Install Javascript Kubernetes Client Source: https://github.com/kubernetes-client/javascript/blob/main/README.md Install the Kubernetes client library for Node.js using npm. ```console npm install @kubernetes/client-node ``` -------------------------------- ### Get Server Version Information Source: https://github.com/kubernetes-client/javascript/blob/main/src/gen/docs/VersionApi.md Use this snippet to retrieve the version information for the server. Ensure you have the necessary configuration and API client setup. ```typescript import { createConfiguration, VersionApi } from ''; const configuration = createConfiguration(); const apiInstance = new VersionApi(configuration); const request = {}; const data = await apiInstance.getCode(request); console.log('API called successfully. Returned data:', data); ``` -------------------------------- ### Configure Container and Pod Specifications Source: https://github.com/kubernetes-client/javascript/blob/main/src/gen/docs/AppsV1Api.md Example configuration object demonstrating container security contexts, startup probes, and resource scheduling constraints. ```javascript "key": "key_example", }, requests: { "key": "key_example", }, }, restartPolicy: "restartPolicy_example", restartPolicyRules: [ { action: "action_example", exitCodes: { operator: "operator_example", values: [ 1, ], }, }, ], securityContext: { allowPrivilegeEscalation: true, appArmorProfile: { localhostProfile: "localhostProfile_example", type: "type_example", }, capabilities: { add: [ "add_example", ], drop: [ "drop_example", ], }, privileged: true, procMount: "procMount_example", readOnlyRootFilesystem: true, runAsGroup: 1, runAsNonRoot: true, runAsUser: 1, seLinuxOptions: { level: "level_example", role: "role_example", type: "type_example", user: "user_example", }, seccompProfile: { localhostProfile: "localhostProfile_example", type: "type_example", }, windowsOptions: { gmsaCredentialSpec: "gmsaCredentialSpec_example", gmsaCredentialSpecName: "gmsaCredentialSpecName_example", hostProcess: true, runAsUserName: "runAsUserName_example", }, }, startupProbe: { exec: { command: [ "command_example", ], }, failureThreshold: 1, grpc: { port: 1, service: "service_example", }, httpGet: { host: "host_example", httpHeaders: [ { name: "name_example", value: "value_example", }, ], path: "path_example", port: "port_example", scheme: "scheme_example", }, initialDelaySeconds: 1, periodSeconds: 1, successThreshold: 1, tcpSocket: { host: "host_example", port: "port_example", }, terminationGracePeriodSeconds: 1, timeoutSeconds: 1, }, stdin: true, stdinOnce: true, terminationMessagePath: "terminationMessagePath_example", terminationMessagePolicy: "terminationMessagePolicy_example", tty: true, volumeDevices: [ { devicePath: "devicePath_example", name: "name_example", }, ], volumeMounts: [ { mountPath: "mountPath_example", mountPropagation: "mountPropagation_example", name: "name_example", readOnly: true, recursiveReadOnly: "recursiveReadOnly_example", subPath: "subPath_example", subPathExpr: "subPathExpr_example", }, ], workingDir: "workingDir_example", }, ], nodeName: "nodeName_example", nodeSelector: { "key": "key_example", }, os: { name: "name_example", }, overhead: { "key": "key_example", }, preemptionPolicy: "preemptionPolicy_example", priority: 1, priorityClassName: "priorityClassName_example", readinessGates: [ { conditionType: "conditionType_example", }, ], resourceClaims: [ { name: "name_example", resourceClaimName: "resourceClaimName_example", resourceClaimTemplateName: "resourceClaimTemplateName_example", }, ], resources: { claims: [ { name: "name_example", request: "request_example", }, ], limits: { "key": "key_example", }, requests: { "key": "key_example", }, }, ``` -------------------------------- ### List Deployments for All Namespaces Source: https://github.com/kubernetes-client/javascript/blob/main/src/gen/docs/AppsV1Api.md Example configuration for listing deployments across all namespaces with watch and timeout settings. ```javascript sendInitialEvents: true, shardSelector: "shardSelector_example", timeoutSeconds: 1, watch: true, }; const data = await apiInstance.listDeploymentForAllNamespaces(request); console.log('API called successfully. Returned data:', data); ``` -------------------------------- ### Install Published Package Source: https://github.com/kubernetes-client/javascript/blob/main/src/gen/README.md Install the published version of the kubernetes-client-typescript package using npm. ```bash npm install kubernetes-client-typescript@0.8-SNAPSHOT --save ``` -------------------------------- ### Configure Pod and Security Context Settings Source: https://github.com/kubernetes-client/javascript/blob/main/src/gen/docs/CoreV1Api.md Example configuration for pod specifications including startup probes, volume mounts, and security context definitions. ```javascript localhostProfile: "localhostProfile_example", type: "type_example", }, windowsOptions: { gmsaCredentialSpec: "gmsaCredentialSpec_example", gmsaCredentialSpecName: "gmsaCredentialSpecName_example", hostProcess: true, runAsUserName: "runAsUserName_example", }, }, startupProbe: { exec: { command: [ "command_example", ], }, failureThreshold: 1, grpc: { port: 1, service: "service_example", }, httpGet: { host: "host_example", httpHeaders: [ { name: "name_example", value: "value_example", }, ], path: "path_example", port: "port_example", scheme: "scheme_example", }, initialDelaySeconds: 1, periodSeconds: 1, successThreshold: 1, tcpSocket: { host: "host_example", port: "port_example", }, terminationGracePeriodSeconds: 1, timeoutSeconds: 1, }, stdin: true, stdinOnce: true, terminationMessagePath: "terminationMessagePath_example", terminationMessagePolicy: "terminationMessagePolicy_example", tty: true, volumeDevices: [ { devicePath: "devicePath_example", name: "name_example", }, ], volumeMounts: [ { mountPath: "mountPath_example", mountPropagation: "mountPropagation_example", name: "name_example", readOnly: true, recursiveReadOnly: "recursiveReadOnly_example", subPath: "subPath_example", subPathExpr: "subPathExpr_example", }, ], workingDir: "workingDir_example", }, ], nodeName: "nodeName_example", nodeSelector: { "key": "key_example", }, os: { name: "name_example", }, overhead: { "key": "key_example", }, preemptionPolicy: "preemptionPolicy_example", priority: 1, priorityClassName: "priorityClassName_example", readinessGates: [ { conditionType: "conditionType_example", }, ], resourceClaims: [ { name: "name_example", resourceClaimName: "resourceClaimName_example", resourceClaimTemplateName: "resourceClaimTemplateName_example", }, ], resources: { claims: [ { name: "name_example", request: "request_example", }, ], limits: { "key": "key_example", }, requests: { "key": "key_example", }, }, restartPolicy: "restartPolicy_example", runtimeClassName: "runtimeClassName_example", schedulerName: "schedulerName_example", schedulingGates: [ { name: "name_example", }, ], schedulingGroup: { podGroupName: "podGroupName_example", }, securityContext: { appArmorProfile: { localhostProfile: "localhostProfile_example", type: "type_example", }, fsGroup: 1, fsGroupChangePolicy: "fsGroupChangePolicy_example", runAsGroup: 1, runAsNonRoot: true, runAsUser: 1, seLinuxChangePolicy: "seLinuxChangePolicy_example", seLinuxOptions: { level: "level_example", role: "role_example", type: "type_example", user: "user_example", }, seccompProfile: { localhostProfile: "localhostProfile_example", type: "type_example", }, supplementalGroups: [ 1, ], supplementalGroupsPolicy: "supplementalGroupsPolicy_example", sysctls: [ { name: "name_example", value: "value_example", }, ], windowsOptions: { gmsaCredentialSpec: "gmsaCredentialSpec_example", gmsaCredentialSpecName: "gmsaCredentialSpecName_example", hostProcess: true, runAsUserName: "runAsUserName_example", }, }, serviceAccount: "serviceAccount_example", serviceAccountName: "serviceAccountName_example", setHostnameAsFQDN: true, shareProcessNamespace: true, subdomain: "subdomain_example", terminationGracePeriodSeconds: 1, tolerations: [ { effect: "effect_example", key: "key_example", operator: "operator_example", tolerationSeconds: 1, ``` -------------------------------- ### Delete Collection Namespaced Pod Example Source: https://github.com/kubernetes-client/javascript/blob/main/src/gen/docs/CoreV1Api.md Example of calling the deleteCollectionNamespacedPod method with various configuration options. ```javascript shardSelector: "shardSelector_example", // Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. (optional) timeoutSeconds: 1, body: { apiVersion: "apiVersion_example", dryRun: [ "dryRun_example", ], gracePeriodSeconds: 1, ignoreStoreReadErrorWithClusterBreakingPotential: true, kind: "kind_example", orphanDependents: true, preconditions: { resourceVersion: "resourceVersion_example", uid: "uid_example", }, propagationPolicy: "propagationPolicy_example", }, }; const data = await apiInstance.deleteCollectionNamespacedPod(request); console.log('API called successfully. Returned data:', data); ``` -------------------------------- ### Delete Collection Namespaced CronJob Example Source: https://github.com/kubernetes-client/javascript/blob/main/src/gen/docs/BatchV1Api.md Example of configuring the request body and executing the deleteCollectionNamespacedCronJob method. ```javascript shardSelector: "shardSelector_example", // Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. (optional) timeoutSeconds: 1, body: { apiVersion: "apiVersion_example", dryRun: [ "dryRun_example", ], gracePeriodSeconds: 1, ignoreStoreReadErrorWithClusterBreakingPotential: true, kind: "kind_example", orphanDependents: true, preconditions: { resourceVersion: "resourceVersion_example", uid: "uid_example", }, propagationPolicy: "propagationPolicy_example", }, }; const data = await apiInstance.deleteCollectionNamespacedCronJob(request); console.log('API called successfully. Returned data:', data); ``` -------------------------------- ### List Services Across All Namespaces Source: https://github.com/kubernetes-client/javascript/blob/main/src/gen/docs/CoreV1Api.md Example demonstrating how to configure the request object and call the listServiceForAllNamespaces method. ```javascript sendInitialEvents: true, shardSelector: "shardSelector_example", timeoutSeconds: 1, watch: true, }; const data = await apiInstance.listServiceForAllNamespaces(request); console.log('API called successfully. Returned data:', data); ``` -------------------------------- ### Install Unpublished Package Source: https://github.com/kubernetes-client/javascript/blob/main/src/gen/README.md Install an unpublished version of the kubernetes-client-typescript package from a local path. This is not recommended for production use. ```bash npm install PATH_TO_GENERATED_PACKAGE --save ``` -------------------------------- ### List StatefulSets for all namespaces Source: https://github.com/kubernetes-client/javascript/blob/main/src/gen/docs/AppsV1Api.md Example configuration for listing StatefulSets with watch and initial event options enabled. ```javascript sendInitialEvents: true, // shardSelector restricts the list of returned objects using a CEL-based shard selector expression. The format uses the shardRange() function combined with || (logical OR) to specify one or more hash ranges: shardRange(object.metadata.uid, '0x0', '0x8000000000000000') shardRange(object.metadata.uid, '0x0', '0x8000000000000000') || shardRange(object.metadata.uid, '0x8000000000000000', '0x10000000000000000') Field paths use CEL-style object-rooted syntax (e.g. "object.metadata.uid"), NOT the fieldSelector format ("metadata.uid"). Currently supported paths: - object.metadata.uid - object.metadata.namespace hexStart and hexEnd are single-quoted CEL string literals with a '0x' prefix, defining the inclusive lower and exclusive upper bounds over the 64-bit FNV-1a hash space. The full range is [0x0, 0x10000000000000000), where the exclusive upper bound equals 2^64. Examples: 2-shard split: shard 0: shardRange(object.metadata.uid, '0x0000000000000000', '0x8000000000000000') shard 1: shardRange(object.metadata.uid, '0x8000000000000000', '0x10000000000000000') 4-shard split: shard 0: shardRange(object.metadata.uid, '0x0000000000000000', '0x4000000000000000') shard 1: shardRange(object.metadata.uid, '0x4000000000000000', '0x8000000000000000') shard 2: shardRange(object.metadata.uid, '0x8000000000000000', '0xc000000000000000') shard 3: shardRange(object.metadata.uid, '0xc000000000000000', '0x10000000000000000') This is an alpha field and requires enabling the ShardedListAndWatch feature gate. (optional) shardSelector: "shardSelector_example", // Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. (optional) timeoutSeconds: 1, // Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. (optional) watch: true, }; const data = await apiInstance.listStatefulSetForAllNamespaces(request); console.log('API called successfully. Returned data:', data); ``` -------------------------------- ### List Ingress Resources for All Namespaces Source: https://github.com/kubernetes-client/javascript/blob/main/src/gen/docs/NetworkingV1Api.md Example demonstrating how to call listIngressForAllNamespaces with various configuration options. ```javascript sendInitialEvents: true, shardSelector: "shardSelector_example", timeoutSeconds: 1, watch: true, }; const data = await apiInstance.listIngressForAllNamespaces(request); console.log('API called successfully. Returned data:', data); ``` -------------------------------- ### Configure BatchV1Api Pod and Volume Settings Source: https://github.com/kubernetes-client/javascript/blob/main/src/gen/docs/BatchV1Api.md Example configuration object demonstrating various pod scheduling, security, and volume definitions. ```javascript preemptionPolicy: "preemptionPolicy_example", priority: 1, priorityClassName: "priorityClassName_example", readinessGates: [ { conditionType: "conditionType_example", }, ], resourceClaims: [ { name: "name_example", resourceClaimName: "resourceClaimName_example", resourceClaimTemplateName: "resourceClaimTemplateName_example", }, ], resources: { claims: [ { name: "name_example", request: "request_example", }, ], limits: { "key": "key_example", }, requests: { "key": "key_example", }, }, restartPolicy: "restartPolicy_example", runtimeClassName: "runtimeClassName_example", schedulerName: "schedulerName_example", schedulingGates: [ { name: "name_example", }, ], schedulingGroup: { podGroupName: "podGroupName_example", }, securityContext: { appArmorProfile: { localhostProfile: "localhostProfile_example", type: "type_example", }, fsGroup: 1, fsGroupChangePolicy: "fsGroupChangePolicy_example", runAsGroup: 1, runAsNonRoot: true, runAsUser: 1, seLinuxChangePolicy: "seLinuxChangePolicy_example", seLinuxOptions: { level: "level_example", role: "role_example", type: "type_example", user: "user_example", }, seccompProfile: { localhostProfile: "localhostProfile_example", type: "type_example", }, supplementalGroups: [ 1, ], supplementalGroupsPolicy: "supplementalGroupsPolicy_example", sysctls: [ { name: "name_example", value: "value_example", }, ], windowsOptions: { gmsaCredentialSpec: "gmsaCredentialSpec_example", gmsaCredentialSpecName: "gmsaCredentialSpecName_example", hostProcess: true, runAsUserName: "runAsUserName_example", }, }, serviceAccount: "serviceAccount_example", serviceAccountName: "serviceAccountName_example", setHostnameAsFQDN: true, shareProcessNamespace: true, subdomain: "subdomain_example", terminationGracePeriodSeconds: 1, tolerations: [ { effect: "effect_example", key: "key_example", operator: "operator_example", tolerationSeconds: 1, value: "value_example", }, ], topologySpreadConstraints: [ { labelSelector: { matchExpressions: [ { key: "key_example", operator: "operator_example", values: [ "values_example", ], }, ], matchLabels: { "key": "key_example", }, }, matchLabelKeys: [ "matchLabelKeys_example", ], maxSkew: 1, minDomains: 1, nodeAffinityPolicy: "nodeAffinityPolicy_example", nodeTaintsPolicy: "nodeTaintsPolicy_example", topologyKey: "topologyKey_example", whenUnsatisfiable: "whenUnsatisfiable_example", }, ], volumes: [ { awsElasticBlockStore: { fsType: "fsType_example", partition: 1, readOnly: true, volumeID: "volumeID_example", }, azureDisk: { cachingMode: "cachingMode_example", diskName: "diskName_example", diskURI: "diskURI_example", fsType: "fsType_example", kind: "kind_example", readOnly: true, }, azureFile: { readOnly: true, secretName: "secretName_example", shareName: "shareName_example", }, cephfs: { monitors: [ "monitors_example", ], path: "path_example", readOnly: true, secretFile: "secretFile_example", secretRef: { name: "name_example", }, user: "user_example", ``` -------------------------------- ### Configure CoreV1Api Pod and Container Settings Source: https://github.com/kubernetes-client/javascript/blob/main/src/gen/docs/CoreV1Api.md Example configuration for volume mounts, DNS policies, and ephemeral container specifications. ```javascript mountPropagation: "mountPropagation_example", name: "name_example", readOnly: true, recursiveReadOnly: "recursiveReadOnly_example", subPath: "subPath_example", subPathExpr: "subPathExpr_example", }, ], workingDir: "workingDir_example", }, ], dnsConfig: { nameservers: [ "nameservers_example", ], options: [ { name: "name_example", value: "value_example", }, ], searches: [ "searches_example", ], }, dnsPolicy: "dnsPolicy_example", enableServiceLinks: true, ephemeralContainers: [ { args: [ "args_example", ], command: [ "command_example", ], env: [ { name: "name_example", value: "value_example", valueFrom: { configMapKeyRef: { key: "key_example", name: "name_example", optional: true, }, fieldRef: { apiVersion: "apiVersion_example", fieldPath: "fieldPath_example", }, fileKeyRef: { key: "key_example", optional: true, path: "path_example", volumeName: "volumeName_example", }, resourceFieldRef: { containerName: "containerName_example", divisor: "divisor_example", resource: "resource_example", }, secretKeyRef: { key: "key_example", name: "name_example", optional: true, }, }, }, ], envFrom: [ { configMapRef: { name: "name_example", optional: true, }, prefix: "prefix_example", secretRef: { name: "name_example", optional: true, }, }, ], image: "image_example", imagePullPolicy: "imagePullPolicy_example", lifecycle: { postStart: { exec: { command: [ "command_example", ], }, httpGet: { host: "host_example", httpHeaders: [ { name: "name_example", value: "value_example", }, ], path: "path_example", port: "port_example", scheme: "scheme_example", }, sleep: { seconds: 1, }, tcpSocket: { host: "host_example", port: "port_example", }, }, preStop: { exec: { command: [ "command_example", ], }, httpGet: { host: "host_example", httpHeaders: [ { name: "name_example", value: "value_example", }, ], path: "path_example", port: "port_example", scheme: "scheme_example", }, sleep: { seconds: 1, }, tcpSocket: { host: "host_example", port: "port_example", }, }, stopSignal: "stopSignal_example", }, livenessProbe: { exec: { command: [ "command_example", ], }, failureThreshold: 1, grpc: { port: 1, service: "service_example", }, httpGet: { host: "host_example", httpHeaders: [ { name: "name_example", value: "value_example", }, ], path: "path_example", port: "port_example", scheme: "scheme_example", }, initialDelaySeconds: 1, periodSeconds: 1, successThreshold: 1, ```