
org.cdk8s.plus31.k8s.KubeRuntimeClass Maven / Gradle / Ivy
package org.cdk8s.plus31.k8s;
/**
* RuntimeClass defines a class of container runtime supported in the cluster.
*
* The RuntimeClass is used to determine which container runtime is used to run all containers in a pod. RuntimeClasses are manually defined by a user or cluster provisioner, and referenced in the PodSpec. The Kubelet is responsible for resolving the RuntimeClassName reference before running the pod. For more details, see https://kubernetes.io/docs/concepts/containers/runtime-class/
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.104.0 (build e79254c)", date = "2024-10-12T12:14:17.625Z")
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@software.amazon.jsii.Jsii(module = org.cdk8s.plus31.$Module.class, fqn = "cdk8s-plus-31.k8s.KubeRuntimeClass")
public class KubeRuntimeClass extends org.cdk8s.ApiObject {
protected KubeRuntimeClass(final software.amazon.jsii.JsiiObjectRef objRef) {
super(objRef);
}
protected KubeRuntimeClass(final software.amazon.jsii.JsiiObject.InitializationMode initializationMode) {
super(initializationMode);
}
static {
GVK = software.amazon.jsii.JsiiObject.jsiiStaticGet(org.cdk8s.plus31.k8s.KubeRuntimeClass.class, "GVK", software.amazon.jsii.NativeType.forClass(org.cdk8s.GroupVersionKind.class));
}
/**
* Defines a "io.k8s.api.node.v1.RuntimeClass" API object.
*
* @param scope the scope in which to define this object. This parameter is required.
* @param id a scope-local name for the object. This parameter is required.
* @param props initialization props. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public KubeRuntimeClass(final @org.jetbrains.annotations.NotNull software.constructs.Construct scope, final @org.jetbrains.annotations.NotNull java.lang.String id, final @org.jetbrains.annotations.NotNull org.cdk8s.plus31.k8s.KubeRuntimeClassProps props) {
super(software.amazon.jsii.JsiiObject.InitializationMode.JSII);
software.amazon.jsii.JsiiEngine.getInstance().createNewObject(this, new Object[] { java.util.Objects.requireNonNull(scope, "scope is required"), java.util.Objects.requireNonNull(id, "id is required"), java.util.Objects.requireNonNull(props, "props is required") });
}
/**
* Renders a Kubernetes manifest for "io.k8s.api.node.v1.RuntimeClass".
*
* This can be used to inline resource manifests inside other objects (e.g. as templates).
*
* @param props initialization props. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public static @org.jetbrains.annotations.NotNull java.lang.Object manifest(final @org.jetbrains.annotations.NotNull org.cdk8s.plus31.k8s.KubeRuntimeClassProps props) {
return software.amazon.jsii.JsiiObject.jsiiStaticCall(org.cdk8s.plus31.k8s.KubeRuntimeClass.class, "manifest", software.amazon.jsii.NativeType.forClass(java.lang.Object.class), new Object[] { java.util.Objects.requireNonNull(props, "props is required") });
}
/**
* Renders the object to Kubernetes JSON.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@Override
public @org.jetbrains.annotations.NotNull java.lang.Object toJson() {
return software.amazon.jsii.Kernel.call(this, "toJson", software.amazon.jsii.NativeType.forClass(java.lang.Object.class));
}
/**
* Returns the apiVersion and kind for "io.k8s.api.node.v1.RuntimeClass".
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public final static org.cdk8s.GroupVersionKind GVK;
/**
* A fluent builder for {@link org.cdk8s.plus31.k8s.KubeRuntimeClass}.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public static final class Builder implements software.amazon.jsii.Builder {
/**
* @return a new instance of {@link Builder}.
* @param scope the scope in which to define this object. This parameter is required.
* @param id a scope-local name for the object. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public static Builder create(final software.constructs.Construct scope, final java.lang.String id) {
return new Builder(scope, id);
}
private final software.constructs.Construct scope;
private final java.lang.String id;
private final org.cdk8s.plus31.k8s.KubeRuntimeClassProps.Builder props;
private Builder(final software.constructs.Construct scope, final java.lang.String id) {
this.scope = scope;
this.id = id;
this.props = new org.cdk8s.plus31.k8s.KubeRuntimeClassProps.Builder();
}
/**
* handler specifies the underlying runtime and configuration that the CRI implementation will use to handle pods of this class.
*
* The possible values are specific to the node & CRI configuration. It is assumed that all handlers are available on every node, and handlers of the same name are equivalent on every node. For example, a handler called "runc" might specify that the runc OCI runtime (using native Linux containers) will be used to run the containers in a pod. The Handler must be lowercase, conform to the DNS Label (RFC 1123) requirements, and is immutable.
*
* @return {@code this}
* @param handler handler specifies the underlying runtime and configuration that the CRI implementation will use to handle pods of this class. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder handler(final java.lang.String handler) {
this.props.handler(handler);
return this;
}
/**
* More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata.
*
* @return {@code this}
* @param metadata More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder metadata(final org.cdk8s.plus31.k8s.ObjectMeta metadata) {
this.props.metadata(metadata);
return this;
}
/**
* overhead represents the resource overhead associated with running a pod for a given RuntimeClass.
*
* For more details, see
* https://kubernetes.io/docs/concepts/scheduling-eviction/pod-overhead/
*
* @return {@code this}
* @param overhead overhead represents the resource overhead associated with running a pod for a given RuntimeClass. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder overhead(final org.cdk8s.plus31.k8s.Overhead overhead) {
this.props.overhead(overhead);
return this;
}
/**
* scheduling holds the scheduling constraints to ensure that pods running with this RuntimeClass are scheduled to nodes that support it.
*
* If scheduling is nil, this RuntimeClass is assumed to be supported by all nodes.
*
* @return {@code this}
* @param scheduling scheduling holds the scheduling constraints to ensure that pods running with this RuntimeClass are scheduled to nodes that support it. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder scheduling(final org.cdk8s.plus31.k8s.Scheduling scheduling) {
this.props.scheduling(scheduling);
return this;
}
/**
* @return a newly built instance of {@link org.cdk8s.plus31.k8s.KubeRuntimeClass}.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@Override
public org.cdk8s.plus31.k8s.KubeRuntimeClass build() {
return new org.cdk8s.plus31.k8s.KubeRuntimeClass(
this.scope,
this.id,
this.props.build()
);
}
}
}