Module roperator::k8s_types[][src]

Since roperator doesn’t use any swagger codegen or specialized kuberntes clients, it needs to have another way to encode and pass around information about the types of resources that it deals with. Instead, roperator uses the K8sType struct. The OperatorConfig api deals with the type &'static K8sType. The various submodules here have predefined &'static K8sTypes for all of the common v1 and v1beta1 (as of 1.15) resources. For any other types, you’d typically use the following:

use roperator::prelude::K8sType;

static MY_TYPE: &K8sType = &K8sType {
    api_version: "my.group/v1",
    kind: "MyType",
    plural_kind: "mytypes"
};

If you need to load the type information at runtime, though, you could use define_type function, which will take its arguments as Strings and return a &'static K8sType by leaking the memory. This is fine, as long as you only do it once, on startup.

Modules

admissionregistration_k8s_io
apiextensions_k8s_io
apiregistration_k8s_io
apps
authentication_k8s_io
authorization_k8s_io
autoscaling
batch
certificates_k8s_io
coordination_k8s_io
core
events_k8s_io
extensions
networking_k8s_io
node_k8s_io
policy
rbac_authorization_k8s_io
scheduling_k8s_io
storage_k8s_io

Structs

K8sType

A basic description of a Kubernetes resource, with just enough information to allow Roperator to communicate with the api server. We use &'static str for all of these so that it’s easy to pass references around without copying. You can define your own k8s types simply by declaring a static, like:

Functions

define_type

Creates a &'static K8sType at runtime by leaking memory. This is totally fine, as long as it’s only done once on application startup, but you definitely want to avoid repeated calls to define the same type.