From 0ab49fcf1584d7e363b6ee865298155d9847dc7c Mon Sep 17 00:00:00 2001 From: obaydullahmhs Date: Wed, 17 Jul 2024 15:30:47 +0600 Subject: [PATCH] Add Kafka RestProxy APIs Signed-off-by: obaydullahmhs --- apis/kafka/v1alpha1/constants.go | 10 + apis/kafka/v1alpha1/openapi_generated.go | 235 ++ apis/kafka/v1alpha1/register.go | 2 + apis/kafka/v1alpha1/restproxy_helpers.go | 249 ++ apis/kafka/v1alpha1/restproxy_types.go | 119 + apis/kafka/v1alpha1/restproxy_webhook.go | 202 + apis/kafka/v1alpha1/zz_generated.deepcopy.go | 140 + .../kafka/v1alpha1/fake/fake_kafka_client.go | 4 + .../kafka/v1alpha1/fake/fake_restproxy.go | 142 + .../kafka/v1alpha1/generated_expansion.go | 2 + .../typed/kafka/v1alpha1/kafka_client.go | 5 + .../typed/kafka/v1alpha1/restproxy.go | 196 + client/informers/externalversions/generic.go | 2 + .../kafka/v1alpha1/interface.go | 7 + .../kafka/v1alpha1/restproxy.go | 91 + .../kafka/v1alpha1/expansion_generated.go | 8 + client/listers/kafka/v1alpha1/restproxy.go | 100 + crds/kafka.kubedb.com_restproxies.yaml | 3270 +++++++++++++++++ 18 files changed, 4784 insertions(+) create mode 100644 apis/kafka/v1alpha1/restproxy_helpers.go create mode 100644 apis/kafka/v1alpha1/restproxy_types.go create mode 100644 apis/kafka/v1alpha1/restproxy_webhook.go create mode 100644 client/clientset/versioned/typed/kafka/v1alpha1/fake/fake_restproxy.go create mode 100644 client/clientset/versioned/typed/kafka/v1alpha1/restproxy.go create mode 100644 client/informers/externalversions/kafka/v1alpha1/restproxy.go create mode 100644 client/listers/kafka/v1alpha1/restproxy.go create mode 100644 crds/kafka.kubedb.com_restproxies.yaml diff --git a/apis/kafka/v1alpha1/constants.go b/apis/kafka/v1alpha1/constants.go index 24b212763f..f1dfcda8df 100644 --- a/apis/kafka/v1alpha1/constants.go +++ b/apis/kafka/v1alpha1/constants.go @@ -111,3 +111,13 @@ const ( SchemaRegistryOperatorVolumeConfig = "registry-operator-config" SchemaRegistryOperatorConfigPath = "/deployments/config" ) + +// RestProxy constants + +const ( + RestProxyPrimaryPortName = "primary" + RestProxyPortName = "restproxy" + RestProxyRESTPort = 8082 + RestProxyContainerName = "rest-proxy" + RestProxyConfigFileName = "karapace.config.json" +) diff --git a/apis/kafka/v1alpha1/openapi_generated.go b/apis/kafka/v1alpha1/openapi_generated.go index 228565b07b..2ca7f68805 100644 --- a/apis/kafka/v1alpha1/openapi_generated.go +++ b/apis/kafka/v1alpha1/openapi_generated.go @@ -496,6 +496,11 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "kubedb.dev/apimachinery/apis/kafka/v1alpha1.ConnectorList": schema_apimachinery_apis_kafka_v1alpha1_ConnectorList(ref), "kubedb.dev/apimachinery/apis/kafka/v1alpha1.ConnectorSpec": schema_apimachinery_apis_kafka_v1alpha1_ConnectorSpec(ref), "kubedb.dev/apimachinery/apis/kafka/v1alpha1.ConnectorStatus": schema_apimachinery_apis_kafka_v1alpha1_ConnectorStatus(ref), + "kubedb.dev/apimachinery/apis/kafka/v1alpha1.RestProxy": schema_apimachinery_apis_kafka_v1alpha1_RestProxy(ref), + "kubedb.dev/apimachinery/apis/kafka/v1alpha1.RestProxyApp": schema_apimachinery_apis_kafka_v1alpha1_RestProxyApp(ref), + "kubedb.dev/apimachinery/apis/kafka/v1alpha1.RestProxyList": schema_apimachinery_apis_kafka_v1alpha1_RestProxyList(ref), + "kubedb.dev/apimachinery/apis/kafka/v1alpha1.RestProxySpec": schema_apimachinery_apis_kafka_v1alpha1_RestProxySpec(ref), + "kubedb.dev/apimachinery/apis/kafka/v1alpha1.RestProxyStatus": schema_apimachinery_apis_kafka_v1alpha1_RestProxyStatus(ref), "kubedb.dev/apimachinery/apis/kafka/v1alpha1.SchemaRegistry": schema_apimachinery_apis_kafka_v1alpha1_SchemaRegistry(ref), "kubedb.dev/apimachinery/apis/kafka/v1alpha1.SchemaRegistryApp": schema_apimachinery_apis_kafka_v1alpha1_SchemaRegistryApp(ref), "kubedb.dev/apimachinery/apis/kafka/v1alpha1.SchemaRegistryList": schema_apimachinery_apis_kafka_v1alpha1_SchemaRegistryList(ref), @@ -25562,6 +25567,236 @@ func schema_apimachinery_apis_kafka_v1alpha1_ConnectorStatus(ref common.Referenc } } +func schema_apimachinery_apis_kafka_v1alpha1_RestProxy(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "kind": { + SchemaProps: spec.SchemaProps{ + Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", + Type: []string{"string"}, + Format: "", + }, + }, + "apiVersion": { + SchemaProps: spec.SchemaProps{ + Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", + Type: []string{"string"}, + Format: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), + }, + }, + "spec": { + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("kubedb.dev/apimachinery/apis/kafka/v1alpha1.RestProxySpec"), + }, + }, + "status": { + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("kubedb.dev/apimachinery/apis/kafka/v1alpha1.RestProxyStatus"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta", "kubedb.dev/apimachinery/apis/kafka/v1alpha1.RestProxySpec", "kubedb.dev/apimachinery/apis/kafka/v1alpha1.RestProxyStatus"}, + } +} + +func schema_apimachinery_apis_kafka_v1alpha1_RestProxyApp(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "RestProxy": { + SchemaProps: spec.SchemaProps{ + Ref: ref("kubedb.dev/apimachinery/apis/kafka/v1alpha1.RestProxy"), + }, + }, + }, + Required: []string{"RestProxy"}, + }, + }, + Dependencies: []string{ + "kubedb.dev/apimachinery/apis/kafka/v1alpha1.RestProxy"}, + } +} + +func schema_apimachinery_apis_kafka_v1alpha1_RestProxyList(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "RestProxyList contains a list of RestProxy", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "kind": { + SchemaProps: spec.SchemaProps{ + Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", + Type: []string{"string"}, + Format: "", + }, + }, + "apiVersion": { + SchemaProps: spec.SchemaProps{ + Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", + Type: []string{"string"}, + Format: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), + }, + }, + "items": { + SchemaProps: spec.SchemaProps{ + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("kubedb.dev/apimachinery/apis/kafka/v1alpha1.RestProxy"), + }, + }, + }, + }, + }, + }, + Required: []string{"items"}, + }, + }, + Dependencies: []string{ + "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", "kubedb.dev/apimachinery/apis/kafka/v1alpha1.RestProxy"}, + } +} + +func schema_apimachinery_apis_kafka_v1alpha1_RestProxySpec(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "RestProxySpec defines the desired state of RestProxy", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "version": { + SchemaProps: spec.SchemaProps{ + Description: "Version of RestProxy to be deployed.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "replicas": { + SchemaProps: spec.SchemaProps{ + Description: "Number of instances to deploy for a rest proxy.", + Type: []string{"integer"}, + Format: "int32", + }, + }, + "kafkaRef": { + SchemaProps: spec.SchemaProps{ + Description: "Kafka app-binding reference KafkaRef is a required field, where RestProxy will connect to Kafka", + Ref: ref("kmodules.xyz/client-go/api/v1.ObjectReference"), + }, + }, + "podTemplate": { + SchemaProps: spec.SchemaProps{ + Description: "PodTemplate is an optional configuration for pods used to expose database", + Default: map[string]interface{}{}, + Ref: ref("kmodules.xyz/offshoot-api/api/v2.PodTemplateSpec"), + }, + }, + "serviceTemplates": { + SchemaProps: spec.SchemaProps{ + Description: "ServiceTemplates is an optional configuration for services used to expose database", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("kubedb.dev/apimachinery/apis/kubedb/v1.NamedServiceTemplateSpec"), + }, + }, + }, + }, + }, + "deletionPolicy": { + SchemaProps: spec.SchemaProps{ + Description: "DeletionPolicy controls the delete operation for database", + Type: []string{"string"}, + Format: "", + }, + }, + "healthChecker": { + SchemaProps: spec.SchemaProps{ + Description: "HealthChecker defines attributes of the health checker", + Default: map[string]interface{}{}, + Ref: ref("kmodules.xyz/client-go/api/v1.HealthCheckSpec"), + }, + }, + }, + Required: []string{"version", "kafkaRef"}, + }, + }, + Dependencies: []string{ + "kmodules.xyz/client-go/api/v1.HealthCheckSpec", "kmodules.xyz/client-go/api/v1.ObjectReference", "kmodules.xyz/offshoot-api/api/v2.PodTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1.NamedServiceTemplateSpec"}, + } +} + +func schema_apimachinery_apis_kafka_v1alpha1_RestProxyStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "RestProxyStatus defines the observed state of RestProxy", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "phase": { + SchemaProps: spec.SchemaProps{ + Description: "Specifies the current phase of the database", + Type: []string{"string"}, + Format: "", + }, + }, + "observedGeneration": { + SchemaProps: spec.SchemaProps{ + Description: "observedGeneration is the most recent generation observed for this resource. It corresponds to the resource's generation, which is updated on mutation by the API Server.", + Type: []string{"integer"}, + Format: "int64", + }, + }, + "conditions": { + SchemaProps: spec.SchemaProps{ + Description: "Conditions applied to the database, such as approval or denial.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("kmodules.xyz/client-go/api/v1.Condition"), + }, + }, + }, + }, + }, + }, + }, + }, + Dependencies: []string{ + "kmodules.xyz/client-go/api/v1.Condition"}, + } +} + func schema_apimachinery_apis_kafka_v1alpha1_SchemaRegistry(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ diff --git a/apis/kafka/v1alpha1/register.go b/apis/kafka/v1alpha1/register.go index ab368fa105..91b2d37e7f 100644 --- a/apis/kafka/v1alpha1/register.go +++ b/apis/kafka/v1alpha1/register.go @@ -60,6 +60,8 @@ func addKnownTypes(scheme *runtime.Scheme) error { &ConnectorList{}, &SchemaRegistry{}, &SchemaRegistryList{}, + &RestProxy{}, + &RestProxyList{}, ) scheme.AddKnownTypes(SchemeGroupVersion, diff --git a/apis/kafka/v1alpha1/restproxy_helpers.go b/apis/kafka/v1alpha1/restproxy_helpers.go new file mode 100644 index 0000000000..5d50e1e856 --- /dev/null +++ b/apis/kafka/v1alpha1/restproxy_helpers.go @@ -0,0 +1,249 @@ +/* +Copyright AppsCode Inc. and Contributors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1alpha1 + +import ( + "context" + "fmt" + + "kubedb.dev/apimachinery/apis" + catalog "kubedb.dev/apimachinery/apis/catalog/v1alpha1" + "kubedb.dev/apimachinery/apis/kafka" + "kubedb.dev/apimachinery/apis/kubedb" + dbapi "kubedb.dev/apimachinery/apis/kubedb/v1" + "kubedb.dev/apimachinery/crds" + + "gomodules.xyz/pointer" + core "k8s.io/api/core/v1" + meta "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/types" + "k8s.io/klog/v2" + "kmodules.xyz/client-go/apiextensions" + coreutil "kmodules.xyz/client-go/core/v1" + meta_util "kmodules.xyz/client-go/meta" + "kmodules.xyz/client-go/policy/secomp" + appcat "kmodules.xyz/custom-resources/apis/appcatalog/v1alpha1" + ofst "kmodules.xyz/offshoot-api/api/v1" + ofstv2 "kmodules.xyz/offshoot-api/api/v2" +) + +func (k *RestProxy) CustomResourceDefinition() *apiextensions.CustomResourceDefinition { + return crds.MustCustomResourceDefinition(SchemeGroupVersion.WithResource(ResourcePluralRestProxy)) +} + +func (k *RestProxy) AsOwner() *meta.OwnerReference { + return meta.NewControllerRef(k, SchemeGroupVersion.WithKind(ResourceKindRestProxy)) +} + +func (k *RestProxy) ResourceShortCode() string { + return ResourceCodeRestProxy +} + +func (k *RestProxy) ResourceKind() string { + return ResourceKindRestProxy +} + +func (k *RestProxy) ResourceSingular() string { + return ResourceSingularRestProxy +} + +func (k *RestProxy) ResourcePlural() string { + return ResourcePluralRestProxy +} + +func (k *RestProxy) ResourceFQN() string { + return fmt.Sprintf("%s.%s", k.ResourcePlural(), kafka.GroupName) +} + +// Owner returns owner reference to resources +func (k *RestProxy) Owner() *meta.OwnerReference { + return meta.NewControllerRef(k, SchemeGroupVersion.WithKind(k.ResourceKind())) +} + +func (k *RestProxy) OffshootName() string { + return k.Name +} + +func (k *RestProxy) GoverningServiceName() string { + return meta_util.NameWithSuffix(k.ServiceName(), "pods") +} + +func (k *RestProxy) ServiceName() string { + return k.OffshootName() +} + +func (k *RestProxy) offshootLabels(selector, override map[string]string) map[string]string { + selector[meta_util.ComponentLabelKey] = ComponentKafka + return meta_util.FilterKeys(kafka.GroupName, selector, meta_util.OverwriteKeys(nil, k.Labels, override)) +} + +func (k *RestProxy) OffshootSelectors(extraSelectors ...map[string]string) map[string]string { + selector := map[string]string{ + meta_util.NameLabelKey: k.ResourceFQN(), + meta_util.InstanceLabelKey: k.Name, + meta_util.ManagedByLabelKey: kafka.GroupName, + } + return meta_util.OverwriteKeys(selector, extraSelectors...) +} + +func (k *RestProxy) OffshootLabels() map[string]string { + return k.offshootLabels(k.OffshootSelectors(), nil) +} + +// GetServiceTemplate returns a pointer to the desired serviceTemplate referred by "aliaS". Otherwise, it returns nil. +func (k *RestProxy) GetServiceTemplate(templates []dbapi.NamedServiceTemplateSpec, alias dbapi.ServiceAlias) ofst.ServiceTemplateSpec { + for i := range templates { + c := templates[i] + if c.Alias == alias { + return c.ServiceTemplateSpec + } + } + return ofst.ServiceTemplateSpec{} +} + +func (k *RestProxy) ServiceLabels(alias dbapi.ServiceAlias, extraLabels ...map[string]string) map[string]string { + svcTemplate := k.GetServiceTemplate(k.Spec.ServiceTemplates, alias) + return k.offshootLabels(meta_util.OverwriteKeys(k.OffshootSelectors(), extraLabels...), svcTemplate.Labels) +} + +func (k *RestProxy) PodControllerLabels(extraLabels ...map[string]string) map[string]string { + return k.offshootLabels(meta_util.OverwriteKeys(k.OffshootSelectors(), extraLabels...), k.Spec.PodTemplate.Controller.Labels) +} + +func (k *RestProxy) PodLabels(extraLabels ...map[string]string) map[string]string { + return k.offshootLabels(meta_util.OverwriteKeys(k.OffshootSelectors(), extraLabels...), k.Spec.PodTemplate.Labels) +} + +func (k *RestProxy) PetSetName() string { + return k.OffshootName() +} + +func (k *RestProxy) ConfigSecretName() string { + return meta_util.NameWithSuffix(k.OffshootName(), "config") +} + +func (k *RestProxy) GetPersistentSecrets() []string { + var secrets []string + return secrets +} + +func (k *RestProxy) KafkaClientCredentialsSecretName() string { + return meta_util.NameWithSuffix(k.Name, "kafka-client-cred") +} + +func (k *RestProxy) SetHealthCheckerDefaults() { + if k.Spec.HealthChecker.PeriodSeconds == nil { + k.Spec.HealthChecker.PeriodSeconds = pointer.Int32P(10) + } + if k.Spec.HealthChecker.TimeoutSeconds == nil { + k.Spec.HealthChecker.TimeoutSeconds = pointer.Int32P(10) + } + if k.Spec.HealthChecker.FailureThreshold == nil { + k.Spec.HealthChecker.FailureThreshold = pointer.Int32P(3) + } +} + +func (k *RestProxy) SetDefaults() { + if k.Spec.DeletionPolicy == "" { + k.Spec.DeletionPolicy = dbapi.DeletionPolicyDelete + } + + if k.Spec.Replicas == nil { + k.Spec.Replicas = pointer.Int32P(1) + } + + var ksrVersion catalog.SchemaRegistryVersion + err := DefaultClient.Get(context.TODO(), types.NamespacedName{Name: k.Spec.Version}, &ksrVersion) + if err != nil { + klog.Errorf("can't get the version object %s for %s \n", err.Error(), k.Spec.Version) + return + } + + k.setDefaultContainerSecurityContext(&ksrVersion, &k.Spec.PodTemplate) + + dbContainer := coreutil.GetContainerByName(k.Spec.PodTemplate.Spec.Containers, RestProxyContainerName) + if dbContainer != nil && (dbContainer.Resources.Requests == nil && dbContainer.Resources.Limits == nil) { + apis.SetDefaultResourceLimits(&dbContainer.Resources, kubedb.DefaultResources) + } + + k.SetHealthCheckerDefaults() +} + +func (k *RestProxy) setDefaultContainerSecurityContext(ksrVersion *catalog.SchemaRegistryVersion, podTemplate *ofstv2.PodTemplateSpec) { + if podTemplate == nil { + return + } + if podTemplate.Spec.SecurityContext == nil { + podTemplate.Spec.SecurityContext = &core.PodSecurityContext{} + } + if podTemplate.Spec.SecurityContext.FSGroup == nil { + podTemplate.Spec.SecurityContext.FSGroup = ksrVersion.Spec.SecurityContext.RunAsUser + } + + container := coreutil.GetContainerByName(podTemplate.Spec.Containers, RestProxyContainerName) + if container == nil { + container = &core.Container{ + Name: RestProxyContainerName, + } + } + if container.SecurityContext == nil { + container.SecurityContext = &core.SecurityContext{} + } + k.assignDefaultContainerSecurityContext(ksrVersion, container.SecurityContext) + podTemplate.Spec.Containers = coreutil.UpsertContainer(podTemplate.Spec.Containers, *container) +} + +func (k *RestProxy) assignDefaultContainerSecurityContext(ksrVersion *catalog.SchemaRegistryVersion, sc *core.SecurityContext) { + if sc.AllowPrivilegeEscalation == nil { + sc.AllowPrivilegeEscalation = pointer.BoolP(false) + } + if sc.Capabilities == nil { + sc.Capabilities = &core.Capabilities{ + Drop: []core.Capability{"ALL"}, + } + } + if sc.RunAsNonRoot == nil { + sc.RunAsNonRoot = pointer.BoolP(true) + } + if sc.RunAsUser == nil { + sc.RunAsUser = ksrVersion.Spec.SecurityContext.RunAsUser + } + if sc.SeccompProfile == nil { + sc.SeccompProfile = secomp.DefaultSeccompProfile() + } +} + +type RestProxyApp struct { + *RestProxy +} + +func (r RestProxyApp) Name() string { + return r.RestProxy.Name +} + +func (r RestProxyApp) Type() appcat.AppType { + return appcat.AppType(fmt.Sprintf("%s/%s", kafka.GroupName, ResourceSingularRestProxy)) +} + +func (k *RestProxy) AppBindingMeta() appcat.AppBindingMeta { + return &RestProxyApp{k} +} + +func (k *RestProxy) GetConnectionScheme() string { + scheme := "http" + return scheme +} diff --git a/apis/kafka/v1alpha1/restproxy_types.go b/apis/kafka/v1alpha1/restproxy_types.go new file mode 100644 index 0000000000..f82af01577 --- /dev/null +++ b/apis/kafka/v1alpha1/restproxy_types.go @@ -0,0 +1,119 @@ +/* +Copyright AppsCode Inc. and Contributors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1alpha1 + +import ( + dbapi "kubedb.dev/apimachinery/apis/kubedb/v1" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + kmapi "kmodules.xyz/client-go/api/v1" + ofst "kmodules.xyz/offshoot-api/api/v2" +) + +const ( + ResourceCodeRestProxy = "krp" + ResourceKindRestProxy = "RestProxy" + ResourceSingularRestProxy = "restproxy" + ResourcePluralRestProxy = "restproxies" +) + +// RestProxy defines a runtime server system that stores a specific set of artifacts as files. + +// +genclient +// +k8s:openapi-gen=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// +kubebuilder:object:root=true +// +kubebuilder:subresource:status +// +kubebuilder:resource:shortName=ksr,scope=Namespaced +// +kubebuilder:printcolumn:name="Type",type="string",JSONPath=".apiVersion" +// +kubebuilder:printcolumn:name="Version",type="string",JSONPath=".spec.version" +// +kubebuilder:printcolumn:name="Kafka",type="string",JSONPath=".spec.kafkaRef.name" +// +kubebuilder:printcolumn:name="Status",type="string",JSONPath=".status.phase" +// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp" +type RestProxy struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec RestProxySpec `json:"spec,omitempty"` + Status RestProxyStatus `json:"status,omitempty"` +} + +// RestProxySpec defines the desired state of RestProxy +type RestProxySpec struct { + // Version of RestProxy to be deployed. + Version string `json:"version"` + + // Number of instances to deploy for a rest proxy. + // +optional + Replicas *int32 `json:"replicas,omitempty"` + + // Kafka app-binding reference + // KafkaRef is a required field, where RestProxy will connect to Kafka + KafkaRef *kmapi.ObjectReference `json:"kafkaRef"` + + // PodTemplate is an optional configuration for pods used to expose database + // +optional + PodTemplate ofst.PodTemplateSpec `json:"podTemplate,omitempty"` + + // ServiceTemplates is an optional configuration for services used to expose database + // +optional + ServiceTemplates []dbapi.NamedServiceTemplateSpec `json:"serviceTemplates,omitempty"` + + // DeletionPolicy controls the delete operation for database + // +optional + DeletionPolicy dbapi.DeletionPolicy `json:"deletionPolicy,omitempty"` + + // HealthChecker defines attributes of the health checker + // +optional + // +kubebuilder:default={periodSeconds: 10, timeoutSeconds: 10, failureThreshold: 3} + HealthChecker kmapi.HealthCheckSpec `json:"healthChecker"` +} + +// RestProxyStatus defines the observed state of RestProxy +type RestProxyStatus struct { + // Specifies the current phase of the database + // +optional + Phase RestProxyPhase `json:"phase,omitempty"` + // observedGeneration is the most recent generation observed for this resource. It corresponds to the + // resource's generation, which is updated on mutation by the API Server. + // +optional + ObservedGeneration int64 `json:"observedGeneration,omitempty"` + // Conditions applied to the database, such as approval or denial. + // +optional + Conditions []kmapi.Condition `json:"conditions,omitempty"` +} + +// +kubebuilder:validation:Enum=Provisioning;Ready;NotReady;Critical;Unknown +type RestProxyPhase string + +const ( + RestProxyPhaseProvisioning RestProxyPhase = "Provisioning" + RestProxyPhaseReady RestProxyPhase = "Ready" + RestProxyPhaseNotReady RestProxyPhase = "NotReady" + RestProxyPhaseCritical RestProxyPhase = "Critical" + RestProxyPhaseUnknown RestProxyPhase = "Unknown" +) + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// RestProxyList contains a list of RestProxy +type RestProxyList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []RestProxy `json:"items"` +} diff --git a/apis/kafka/v1alpha1/restproxy_webhook.go b/apis/kafka/v1alpha1/restproxy_webhook.go new file mode 100644 index 0000000000..7c84394fa5 --- /dev/null +++ b/apis/kafka/v1alpha1/restproxy_webhook.go @@ -0,0 +1,202 @@ +/* +Copyright AppsCode Inc. and Contributors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1alpha1 + +import ( + "context" + + catalog "kubedb.dev/apimachinery/apis/catalog/v1alpha1" + dbapi "kubedb.dev/apimachinery/apis/kubedb/v1" + + "github.com/pkg/errors" + apierrors "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" + "k8s.io/apimachinery/pkg/types" + "k8s.io/apimachinery/pkg/util/validation/field" + coreutil "kmodules.xyz/client-go/core/v1" + logf "sigs.k8s.io/controller-runtime/pkg/log" + "sigs.k8s.io/controller-runtime/pkg/webhook" + "sigs.k8s.io/controller-runtime/pkg/webhook/admission" +) + +// log is for logging in this package. +var restproxylog = logf.Log.WithName("restproxy-resource") + +var _ webhook.Defaulter = &RestProxy{} + +// Default implements webhook.Defaulter so a webhook will be registered for the type +func (k *RestProxy) Default() { + if k == nil { + return + } + restproxylog.Info("default", "name", k.Name) + k.SetDefaults() +} + +var _ webhook.Validator = &RestProxy{} + +// ValidateCreate implements webhook.Validator so a webhook will be registered for the type +func (k *RestProxy) ValidateCreate() (admission.Warnings, error) { + restproxylog.Info("validate create", "name", k.Name) + allErr := k.ValidateCreateOrUpdate() + if len(allErr) == 0 { + return nil, nil + } + return nil, apierrors.NewInvalid(schema.GroupKind{Group: "kafka.kubedb.com", Kind: "RestProxy"}, k.Name, allErr) +} + +// ValidateUpdate implements webhook.Validator so a webhook will be registered for the type +func (k *RestProxy) ValidateUpdate(old runtime.Object) (admission.Warnings, error) { + restproxylog.Info("validate update", "name", k.Name) + + oldRegistry := old.(*RestProxy) + allErr := k.ValidateCreateOrUpdate() + + if *oldRegistry.Spec.Replicas == 1 && *k.Spec.Replicas > 1 { + allErr = append(allErr, field.Invalid(field.NewPath("spec").Child("replicas"), + k.Name, + "Cannot scale up from 1 to more than 1 in standalone mode")) + } + + if len(allErr) == 0 { + return nil, nil + } + return nil, apierrors.NewInvalid(schema.GroupKind{Group: "kafka.kubedb.com", Kind: "RestProxy"}, k.Name, allErr) +} + +// ValidateDelete implements webhook.Validator so a webhook will be registered for the type +func (k *RestProxy) ValidateDelete() (admission.Warnings, error) { + restproxylog.Info("validate delete", "name", k.Name) + + var allErr field.ErrorList + if k.Spec.DeletionPolicy == dbapi.DeletionPolicyDoNotTerminate { + allErr = append(allErr, field.Invalid(field.NewPath("spec").Child("terminationPolicy"), + k.Name, + "Can not delete as terminationPolicy is set to \"DoNotTerminate\"")) + return nil, apierrors.NewInvalid(schema.GroupKind{Group: "kafka.kubedb.com", Kind: "RestProxy"}, k.Name, allErr) + } + return nil, nil +} + +func (k *RestProxy) ValidateCreateOrUpdate() field.ErrorList { + var allErr field.ErrorList + + if k.Spec.DeletionPolicy == dbapi.DeletionPolicyHalt { + allErr = append(allErr, field.Invalid(field.NewPath("spec").Child("terminationPolicy"), + k.Name, + "DeletionPolicyHalt is not supported for RestProxy")) + } + + // number of replicas can not be 0 or less + if k.Spec.Replicas != nil && *k.Spec.Replicas <= 0 { + allErr = append(allErr, field.Invalid(field.NewPath("spec").Child("replicas"), + k.Name, + "number of replicas can not be 0 or less")) + } + + err := k.validateVersion() + if err != nil { + allErr = append(allErr, field.Invalid(field.NewPath("spec").Child("version"), + k.Name, + err.Error())) + } + + err = k.validateVolumes() + if err != nil { + allErr = append(allErr, field.Invalid(field.NewPath("spec").Child("podTemplate").Child("spec").Child("volumes"), + k.Name, + err.Error())) + } + + err = k.validateContainerVolumeMountPaths() + if err != nil { + allErr = append(allErr, field.Invalid(field.NewPath("spec").Child("podTemplate").Child("spec").Child("containers").Child("volumeMounts"), + k.Name, + err.Error())) + } + + err = k.validateEnvVars() + if err != nil { + allErr = append(allErr, field.Invalid(field.NewPath("spec").Child("podTemplate").Child("spec").Child("containers").Child("envs"), + k.Name, + err.Error())) + } + + if len(allErr) == 0 { + return nil + } + return allErr +} + +func (k *RestProxy) validateEnvVars() error { + return nil +} + +func (k *RestProxy) validateVersion() error { + ksrVersion := &catalog.SchemaRegistryVersion{} + err := DefaultClient.Get(context.TODO(), types.NamespacedName{Name: k.Spec.Version}, ksrVersion) + if err != nil { + return errors.New("version not supported") + } + if ksrVersion.Spec.Distribution == catalog.SchemaRegistryDistroApicurio { + return errors.New("Distribution Apicurio is not supported") + } + return nil +} + +var restProxyReservedVolumes = []string{ + KafkaClientCertVolumeName, +} + +func (k *RestProxy) validateVolumes() error { + if k.Spec.PodTemplate.Spec.Volumes == nil { + return nil + } + rsv := make([]string, len(restProxyReservedVolumes)) + copy(rsv, restProxyReservedVolumes) + volumes := k.Spec.PodTemplate.Spec.Volumes + for _, rv := range rsv { + for _, ugv := range volumes { + if ugv.Name == rv { + return errors.New("Cannot use a reserve volume name: " + rv) + } + } + } + return nil +} + +var restProxyReservedVolumeMountPaths = []string{ + KafkaClientCertDir, +} + +func (k *RestProxy) validateContainerVolumeMountPaths() error { + container := coreutil.GetContainerByName(k.Spec.PodTemplate.Spec.Containers, RestProxyContainerName) + if container == nil { + return errors.New("container not found") + } + rPaths := restProxyReservedVolumeMountPaths + volumeMountPaths := container.VolumeMounts + for _, rvm := range rPaths { + for _, ugv := range volumeMountPaths { + if ugv.MountPath == rvm { + return errors.New("Cannot use a reserve volume mount path: " + rvm) + } + } + } + return nil +} diff --git a/apis/kafka/v1alpha1/zz_generated.deepcopy.go b/apis/kafka/v1alpha1/zz_generated.deepcopy.go index 245e96b0b7..b333a0f4b2 100644 --- a/apis/kafka/v1alpha1/zz_generated.deepcopy.go +++ b/apis/kafka/v1alpha1/zz_generated.deepcopy.go @@ -310,6 +310,146 @@ func (in *ConnectorStatus) DeepCopy() *ConnectorStatus { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RestProxy) DeepCopyInto(out *RestProxy) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RestProxy. +func (in *RestProxy) DeepCopy() *RestProxy { + if in == nil { + return nil + } + out := new(RestProxy) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *RestProxy) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RestProxyApp) DeepCopyInto(out *RestProxyApp) { + *out = *in + if in.RestProxy != nil { + in, out := &in.RestProxy, &out.RestProxy + *out = new(RestProxy) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RestProxyApp. +func (in *RestProxyApp) DeepCopy() *RestProxyApp { + if in == nil { + return nil + } + out := new(RestProxyApp) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RestProxyList) DeepCopyInto(out *RestProxyList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]RestProxy, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RestProxyList. +func (in *RestProxyList) DeepCopy() *RestProxyList { + if in == nil { + return nil + } + out := new(RestProxyList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *RestProxyList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RestProxySpec) DeepCopyInto(out *RestProxySpec) { + *out = *in + if in.Replicas != nil { + in, out := &in.Replicas, &out.Replicas + *out = new(int32) + **out = **in + } + if in.KafkaRef != nil { + in, out := &in.KafkaRef, &out.KafkaRef + *out = new(v1.ObjectReference) + **out = **in + } + in.PodTemplate.DeepCopyInto(&out.PodTemplate) + if in.ServiceTemplates != nil { + in, out := &in.ServiceTemplates, &out.ServiceTemplates + *out = make([]kubedbv1.NamedServiceTemplateSpec, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + in.HealthChecker.DeepCopyInto(&out.HealthChecker) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RestProxySpec. +func (in *RestProxySpec) DeepCopy() *RestProxySpec { + if in == nil { + return nil + } + out := new(RestProxySpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RestProxyStatus) DeepCopyInto(out *RestProxyStatus) { + *out = *in + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make([]v1.Condition, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RestProxyStatus. +func (in *RestProxyStatus) DeepCopy() *RestProxyStatus { + if in == nil { + return nil + } + out := new(RestProxyStatus) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *SchemaRegistry) DeepCopyInto(out *SchemaRegistry) { *out = *in diff --git a/client/clientset/versioned/typed/kafka/v1alpha1/fake/fake_kafka_client.go b/client/clientset/versioned/typed/kafka/v1alpha1/fake/fake_kafka_client.go index 5edb45a233..c198861653 100644 --- a/client/clientset/versioned/typed/kafka/v1alpha1/fake/fake_kafka_client.go +++ b/client/clientset/versioned/typed/kafka/v1alpha1/fake/fake_kafka_client.go @@ -37,6 +37,10 @@ func (c *FakeKafkaV1alpha1) Connectors(namespace string) v1alpha1.ConnectorInter return &FakeConnectors{c, namespace} } +func (c *FakeKafkaV1alpha1) RestProxies(namespace string) v1alpha1.RestProxyInterface { + return &FakeRestProxies{c, namespace} +} + func (c *FakeKafkaV1alpha1) SchemaRegistries(namespace string) v1alpha1.SchemaRegistryInterface { return &FakeSchemaRegistries{c, namespace} } diff --git a/client/clientset/versioned/typed/kafka/v1alpha1/fake/fake_restproxy.go b/client/clientset/versioned/typed/kafka/v1alpha1/fake/fake_restproxy.go new file mode 100644 index 0000000000..fca5b0b5f9 --- /dev/null +++ b/client/clientset/versioned/typed/kafka/v1alpha1/fake/fake_restproxy.go @@ -0,0 +1,142 @@ +/* +Copyright AppsCode Inc. and Contributors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + + v1alpha1 "kubedb.dev/apimachinery/apis/kafka/v1alpha1" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeRestProxies implements RestProxyInterface +type FakeRestProxies struct { + Fake *FakeKafkaV1alpha1 + ns string +} + +var restproxiesResource = v1alpha1.SchemeGroupVersion.WithResource("restproxies") + +var restproxiesKind = v1alpha1.SchemeGroupVersion.WithKind("RestProxy") + +// Get takes name of the restProxy, and returns the corresponding restProxy object, and an error if there is any. +func (c *FakeRestProxies) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.RestProxy, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(restproxiesResource, c.ns, name), &v1alpha1.RestProxy{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.RestProxy), err +} + +// List takes label and field selectors, and returns the list of RestProxies that match those selectors. +func (c *FakeRestProxies) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.RestProxyList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(restproxiesResource, restproxiesKind, c.ns, opts), &v1alpha1.RestProxyList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1alpha1.RestProxyList{ListMeta: obj.(*v1alpha1.RestProxyList).ListMeta} + for _, item := range obj.(*v1alpha1.RestProxyList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested restProxies. +func (c *FakeRestProxies) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(restproxiesResource, c.ns, opts)) + +} + +// Create takes the representation of a restProxy and creates it. Returns the server's representation of the restProxy, and an error, if there is any. +func (c *FakeRestProxies) Create(ctx context.Context, restProxy *v1alpha1.RestProxy, opts v1.CreateOptions) (result *v1alpha1.RestProxy, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(restproxiesResource, c.ns, restProxy), &v1alpha1.RestProxy{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.RestProxy), err +} + +// Update takes the representation of a restProxy and updates it. Returns the server's representation of the restProxy, and an error, if there is any. +func (c *FakeRestProxies) Update(ctx context.Context, restProxy *v1alpha1.RestProxy, opts v1.UpdateOptions) (result *v1alpha1.RestProxy, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(restproxiesResource, c.ns, restProxy), &v1alpha1.RestProxy{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.RestProxy), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeRestProxies) UpdateStatus(ctx context.Context, restProxy *v1alpha1.RestProxy, opts v1.UpdateOptions) (*v1alpha1.RestProxy, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(restproxiesResource, "status", c.ns, restProxy), &v1alpha1.RestProxy{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.RestProxy), err +} + +// Delete takes name of the restProxy and deletes it. Returns an error if one occurs. +func (c *FakeRestProxies) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(restproxiesResource, c.ns, name, opts), &v1alpha1.RestProxy{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeRestProxies) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(restproxiesResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v1alpha1.RestProxyList{}) + return err +} + +// Patch applies the patch and returns the patched restProxy. +func (c *FakeRestProxies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.RestProxy, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(restproxiesResource, c.ns, name, pt, data, subresources...), &v1alpha1.RestProxy{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.RestProxy), err +} diff --git a/client/clientset/versioned/typed/kafka/v1alpha1/generated_expansion.go b/client/clientset/versioned/typed/kafka/v1alpha1/generated_expansion.go index b8df56845c..2113df9d8b 100644 --- a/client/clientset/versioned/typed/kafka/v1alpha1/generated_expansion.go +++ b/client/clientset/versioned/typed/kafka/v1alpha1/generated_expansion.go @@ -22,4 +22,6 @@ type ConnectClusterExpansion interface{} type ConnectorExpansion interface{} +type RestProxyExpansion interface{} + type SchemaRegistryExpansion interface{} diff --git a/client/clientset/versioned/typed/kafka/v1alpha1/kafka_client.go b/client/clientset/versioned/typed/kafka/v1alpha1/kafka_client.go index d547431fa5..0cfeb9726c 100644 --- a/client/clientset/versioned/typed/kafka/v1alpha1/kafka_client.go +++ b/client/clientset/versioned/typed/kafka/v1alpha1/kafka_client.go @@ -31,6 +31,7 @@ type KafkaV1alpha1Interface interface { RESTClient() rest.Interface ConnectClustersGetter ConnectorsGetter + RestProxiesGetter SchemaRegistriesGetter } @@ -47,6 +48,10 @@ func (c *KafkaV1alpha1Client) Connectors(namespace string) ConnectorInterface { return newConnectors(c, namespace) } +func (c *KafkaV1alpha1Client) RestProxies(namespace string) RestProxyInterface { + return newRestProxies(c, namespace) +} + func (c *KafkaV1alpha1Client) SchemaRegistries(namespace string) SchemaRegistryInterface { return newSchemaRegistries(c, namespace) } diff --git a/client/clientset/versioned/typed/kafka/v1alpha1/restproxy.go b/client/clientset/versioned/typed/kafka/v1alpha1/restproxy.go new file mode 100644 index 0000000000..acd0474b4a --- /dev/null +++ b/client/clientset/versioned/typed/kafka/v1alpha1/restproxy.go @@ -0,0 +1,196 @@ +/* +Copyright AppsCode Inc. and Contributors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + "context" + "time" + + v1alpha1 "kubedb.dev/apimachinery/apis/kafka/v1alpha1" + scheme "kubedb.dev/apimachinery/client/clientset/versioned/scheme" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" +) + +// RestProxiesGetter has a method to return a RestProxyInterface. +// A group's client should implement this interface. +type RestProxiesGetter interface { + RestProxies(namespace string) RestProxyInterface +} + +// RestProxyInterface has methods to work with RestProxy resources. +type RestProxyInterface interface { + Create(ctx context.Context, restProxy *v1alpha1.RestProxy, opts v1.CreateOptions) (*v1alpha1.RestProxy, error) + Update(ctx context.Context, restProxy *v1alpha1.RestProxy, opts v1.UpdateOptions) (*v1alpha1.RestProxy, error) + UpdateStatus(ctx context.Context, restProxy *v1alpha1.RestProxy, opts v1.UpdateOptions) (*v1alpha1.RestProxy, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.RestProxy, error) + List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.RestProxyList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.RestProxy, err error) + RestProxyExpansion +} + +// restProxies implements RestProxyInterface +type restProxies struct { + client rest.Interface + ns string +} + +// newRestProxies returns a RestProxies +func newRestProxies(c *KafkaV1alpha1Client, namespace string) *restProxies { + return &restProxies{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the restProxy, and returns the corresponding restProxy object, and an error if there is any. +func (c *restProxies) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.RestProxy, err error) { + result = &v1alpha1.RestProxy{} + err = c.client.Get(). + Namespace(c.ns). + Resource("restproxies"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of RestProxies that match those selectors. +func (c *restProxies) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.RestProxyList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1alpha1.RestProxyList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("restproxies"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested restProxies. +func (c *restProxies) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Namespace(c.ns). + Resource("restproxies"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a restProxy and creates it. Returns the server's representation of the restProxy, and an error, if there is any. +func (c *restProxies) Create(ctx context.Context, restProxy *v1alpha1.RestProxy, opts v1.CreateOptions) (result *v1alpha1.RestProxy, err error) { + result = &v1alpha1.RestProxy{} + err = c.client.Post(). + Namespace(c.ns). + Resource("restproxies"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(restProxy). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a restProxy and updates it. Returns the server's representation of the restProxy, and an error, if there is any. +func (c *restProxies) Update(ctx context.Context, restProxy *v1alpha1.RestProxy, opts v1.UpdateOptions) (result *v1alpha1.RestProxy, err error) { + result = &v1alpha1.RestProxy{} + err = c.client.Put(). + Namespace(c.ns). + Resource("restproxies"). + Name(restProxy.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(restProxy). + Do(ctx). + Into(result) + return +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *restProxies) UpdateStatus(ctx context.Context, restProxy *v1alpha1.RestProxy, opts v1.UpdateOptions) (result *v1alpha1.RestProxy, err error) { + result = &v1alpha1.RestProxy{} + err = c.client.Put(). + Namespace(c.ns). + Resource("restproxies"). + Name(restProxy.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(restProxy). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the restProxy and deletes it. Returns an error if one occurs. +func (c *restProxies) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("restproxies"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *restProxies) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("restproxies"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched restProxy. +func (c *restProxies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.RestProxy, err error) { + result = &v1alpha1.RestProxy{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("restproxies"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/client/informers/externalversions/generic.go b/client/informers/externalversions/generic.go index 17a6f69a05..da8272a021 100644 --- a/client/informers/externalversions/generic.go +++ b/client/informers/externalversions/generic.go @@ -165,6 +165,8 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource return &genericInformer{resource: resource.GroupResource(), informer: f.Kafka().V1alpha1().ConnectClusters().Informer()}, nil case kafkav1alpha1.SchemeGroupVersion.WithResource("connectors"): return &genericInformer{resource: resource.GroupResource(), informer: f.Kafka().V1alpha1().Connectors().Informer()}, nil + case kafkav1alpha1.SchemeGroupVersion.WithResource("restproxies"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Kafka().V1alpha1().RestProxies().Informer()}, nil case kafkav1alpha1.SchemeGroupVersion.WithResource("schemaregistries"): return &genericInformer{resource: resource.GroupResource(), informer: f.Kafka().V1alpha1().SchemaRegistries().Informer()}, nil diff --git a/client/informers/externalversions/kafka/v1alpha1/interface.go b/client/informers/externalversions/kafka/v1alpha1/interface.go index 41dfff85b2..a093f36de6 100644 --- a/client/informers/externalversions/kafka/v1alpha1/interface.go +++ b/client/informers/externalversions/kafka/v1alpha1/interface.go @@ -28,6 +28,8 @@ type Interface interface { ConnectClusters() ConnectClusterInformer // Connectors returns a ConnectorInformer. Connectors() ConnectorInformer + // RestProxies returns a RestProxyInformer. + RestProxies() RestProxyInformer // SchemaRegistries returns a SchemaRegistryInformer. SchemaRegistries() SchemaRegistryInformer } @@ -53,6 +55,11 @@ func (v *version) Connectors() ConnectorInformer { return &connectorInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } +// RestProxies returns a RestProxyInformer. +func (v *version) RestProxies() RestProxyInformer { + return &restProxyInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} +} + // SchemaRegistries returns a SchemaRegistryInformer. func (v *version) SchemaRegistries() SchemaRegistryInformer { return &schemaRegistryInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} diff --git a/client/informers/externalversions/kafka/v1alpha1/restproxy.go b/client/informers/externalversions/kafka/v1alpha1/restproxy.go new file mode 100644 index 0000000000..d4fab6ae37 --- /dev/null +++ b/client/informers/externalversions/kafka/v1alpha1/restproxy.go @@ -0,0 +1,91 @@ +/* +Copyright AppsCode Inc. and Contributors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by informer-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + "context" + time "time" + + kafkav1alpha1 "kubedb.dev/apimachinery/apis/kafka/v1alpha1" + versioned "kubedb.dev/apimachinery/client/clientset/versioned" + internalinterfaces "kubedb.dev/apimachinery/client/informers/externalversions/internalinterfaces" + v1alpha1 "kubedb.dev/apimachinery/client/listers/kafka/v1alpha1" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// RestProxyInformer provides access to a shared informer and lister for +// RestProxies. +type RestProxyInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1alpha1.RestProxyLister +} + +type restProxyInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc + namespace string +} + +// NewRestProxyInformer constructs a new informer for RestProxy type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewRestProxyInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredRestProxyInformer(client, namespace, resyncPeriod, indexers, nil) +} + +// NewFilteredRestProxyInformer constructs a new informer for RestProxy type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredRestProxyInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.KafkaV1alpha1().RestProxies(namespace).List(context.TODO(), options) + }, + WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.KafkaV1alpha1().RestProxies(namespace).Watch(context.TODO(), options) + }, + }, + &kafkav1alpha1.RestProxy{}, + resyncPeriod, + indexers, + ) +} + +func (f *restProxyInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredRestProxyInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *restProxyInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&kafkav1alpha1.RestProxy{}, f.defaultInformer) +} + +func (f *restProxyInformer) Lister() v1alpha1.RestProxyLister { + return v1alpha1.NewRestProxyLister(f.Informer().GetIndexer()) +} diff --git a/client/listers/kafka/v1alpha1/expansion_generated.go b/client/listers/kafka/v1alpha1/expansion_generated.go index 85c4ca58a4..d1ac3060a6 100644 --- a/client/listers/kafka/v1alpha1/expansion_generated.go +++ b/client/listers/kafka/v1alpha1/expansion_generated.go @@ -34,6 +34,14 @@ type ConnectorListerExpansion interface{} // ConnectorNamespaceLister. type ConnectorNamespaceListerExpansion interface{} +// RestProxyListerExpansion allows custom methods to be added to +// RestProxyLister. +type RestProxyListerExpansion interface{} + +// RestProxyNamespaceListerExpansion allows custom methods to be added to +// RestProxyNamespaceLister. +type RestProxyNamespaceListerExpansion interface{} + // SchemaRegistryListerExpansion allows custom methods to be added to // SchemaRegistryLister. type SchemaRegistryListerExpansion interface{} diff --git a/client/listers/kafka/v1alpha1/restproxy.go b/client/listers/kafka/v1alpha1/restproxy.go new file mode 100644 index 0000000000..f4e5d79c8c --- /dev/null +++ b/client/listers/kafka/v1alpha1/restproxy.go @@ -0,0 +1,100 @@ +/* +Copyright AppsCode Inc. and Contributors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by lister-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + v1alpha1 "kubedb.dev/apimachinery/apis/kafka/v1alpha1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// RestProxyLister helps list RestProxies. +// All objects returned here must be treated as read-only. +type RestProxyLister interface { + // List lists all RestProxies in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1alpha1.RestProxy, err error) + // RestProxies returns an object that can list and get RestProxies. + RestProxies(namespace string) RestProxyNamespaceLister + RestProxyListerExpansion +} + +// restProxyLister implements the RestProxyLister interface. +type restProxyLister struct { + indexer cache.Indexer +} + +// NewRestProxyLister returns a new RestProxyLister. +func NewRestProxyLister(indexer cache.Indexer) RestProxyLister { + return &restProxyLister{indexer: indexer} +} + +// List lists all RestProxies in the indexer. +func (s *restProxyLister) List(selector labels.Selector) (ret []*v1alpha1.RestProxy, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1alpha1.RestProxy)) + }) + return ret, err +} + +// RestProxies returns an object that can list and get RestProxies. +func (s *restProxyLister) RestProxies(namespace string) RestProxyNamespaceLister { + return restProxyNamespaceLister{indexer: s.indexer, namespace: namespace} +} + +// RestProxyNamespaceLister helps list and get RestProxies. +// All objects returned here must be treated as read-only. +type RestProxyNamespaceLister interface { + // List lists all RestProxies in the indexer for a given namespace. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1alpha1.RestProxy, err error) + // Get retrieves the RestProxy from the indexer for a given namespace and name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1alpha1.RestProxy, error) + RestProxyNamespaceListerExpansion +} + +// restProxyNamespaceLister implements the RestProxyNamespaceLister +// interface. +type restProxyNamespaceLister struct { + indexer cache.Indexer + namespace string +} + +// List lists all RestProxies in the indexer for a given namespace. +func (s restProxyNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.RestProxy, err error) { + err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { + ret = append(ret, m.(*v1alpha1.RestProxy)) + }) + return ret, err +} + +// Get retrieves the RestProxy from the indexer for a given namespace and name. +func (s restProxyNamespaceLister) Get(name string) (*v1alpha1.RestProxy, error) { + obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1alpha1.Resource("restproxy"), name) + } + return obj.(*v1alpha1.RestProxy), nil +} diff --git a/crds/kafka.kubedb.com_restproxies.yaml b/crds/kafka.kubedb.com_restproxies.yaml new file mode 100644 index 0000000000..5d5612ab57 --- /dev/null +++ b/crds/kafka.kubedb.com_restproxies.yaml @@ -0,0 +1,3270 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + creationTimestamp: null + labels: + app.kubernetes.io/name: kubedb + name: restproxies.kafka.kubedb.com +spec: + group: kafka.kubedb.com + names: + kind: RestProxy + listKind: RestProxyList + plural: restproxies + shortNames: + - ksr + singular: restproxy + scope: Namespaced + versions: + - additionalPrinterColumns: + - jsonPath: .apiVersion + name: Type + type: string + - jsonPath: .spec.version + name: Version + type: string + - jsonPath: .spec.kafkaRef.name + name: Kafka + type: string + - jsonPath: .status.phase + name: Status + type: string + - jsonPath: .metadata.creationTimestamp + name: Age + type: date + name: v1alpha1 + schema: + openAPIV3Schema: + properties: + apiVersion: + type: string + kind: + type: string + metadata: + type: object + spec: + properties: + deletionPolicy: + enum: + - Halt + - Delete + - WipeOut + - DoNotTerminate + type: string + healthChecker: + default: + failureThreshold: 3 + periodSeconds: 10 + timeoutSeconds: 10 + properties: + disableWriteCheck: + type: boolean + failureThreshold: + default: 1 + format: int32 + type: integer + periodSeconds: + default: 10 + format: int32 + type: integer + timeoutSeconds: + default: 10 + format: int32 + type: integer + type: object + kafkaRef: + properties: + name: + type: string + namespace: + type: string + required: + - name + type: object + podTemplate: + properties: + controller: + properties: + annotations: + additionalProperties: + type: string + type: object + labels: + additionalProperties: + type: string + type: object + type: object + metadata: + properties: + annotations: + additionalProperties: + type: string + type: object + labels: + additionalProperties: + type: string + type: object + type: object + spec: + properties: + activeDeadlineSeconds: + format: int64 + type: integer + automountServiceAccountToken: + type: boolean + containers: + items: + properties: + args: + items: + type: string + type: array + x-kubernetes-list-type: atomic + command: + items: + type: string + type: array + x-kubernetes-list-type: atomic + env: + items: + properties: + name: + type: string + value: + type: string + valueFrom: + properties: + configMapKeyRef: + properties: + key: + type: string + name: + default: "" + type: string + optional: + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + fieldRef: + properties: + apiVersion: + type: string + fieldPath: + type: string + required: + - fieldPath + type: object + x-kubernetes-map-type: atomic + resourceFieldRef: + properties: + containerName: + type: string + divisor: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + resource: + type: string + required: + - resource + type: object + x-kubernetes-map-type: atomic + secretKeyRef: + properties: + key: + type: string + name: + default: "" + type: string + optional: + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + type: object + required: + - name + type: object + type: array + x-kubernetes-list-map-keys: + - name + x-kubernetes-list-type: map + envFrom: + items: + properties: + configMapRef: + properties: + name: + default: "" + type: string + optional: + type: boolean + type: object + x-kubernetes-map-type: atomic + prefix: + type: string + secretRef: + properties: + name: + default: "" + type: string + optional: + type: boolean + type: object + x-kubernetes-map-type: atomic + type: object + type: array + x-kubernetes-list-type: atomic + image: + type: string + imagePullPolicy: + type: string + lifecycle: + properties: + postStart: + properties: + exec: + properties: + command: + items: + type: string + type: array + x-kubernetes-list-type: atomic + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + x-kubernetes-list-type: atomic + path: + type: string + port: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + scheme: + type: string + required: + - port + type: object + sleep: + properties: + seconds: + format: int64 + type: integer + required: + - seconds + type: object + tcpSocket: + properties: + host: + type: string + port: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + required: + - port + type: object + type: object + preStop: + properties: + exec: + properties: + command: + items: + type: string + type: array + x-kubernetes-list-type: atomic + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + x-kubernetes-list-type: atomic + path: + type: string + port: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + scheme: + type: string + required: + - port + type: object + sleep: + properties: + seconds: + format: int64 + type: integer + required: + - seconds + type: object + tcpSocket: + properties: + host: + type: string + port: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + required: + - port + type: object + type: object + type: object + livenessProbe: + properties: + exec: + properties: + command: + items: + type: string + type: array + x-kubernetes-list-type: atomic + type: object + failureThreshold: + format: int32 + type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + required: + - port + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + x-kubernetes-list-type: atomic + path: + type: string + port: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + scheme: + type: string + required: + - port + type: object + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: + properties: + host: + type: string + port: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + required: + - port + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer + type: object + name: + type: string + ports: + items: + properties: + containerPort: + format: int32 + type: integer + hostIP: + type: string + hostPort: + format: int32 + type: integer + name: + type: string + protocol: + default: TCP + type: string + required: + - containerPort + type: object + type: array + x-kubernetes-list-map-keys: + - containerPort + - protocol + x-kubernetes-list-type: map + readinessProbe: + properties: + exec: + properties: + command: + items: + type: string + type: array + x-kubernetes-list-type: atomic + type: object + failureThreshold: + format: int32 + type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + required: + - port + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + x-kubernetes-list-type: atomic + path: + type: string + port: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + scheme: + type: string + required: + - port + type: object + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: + properties: + host: + type: string + port: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + required: + - port + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer + type: object + resizePolicy: + items: + properties: + resourceName: + type: string + restartPolicy: + type: string + required: + - resourceName + - restartPolicy + type: object + type: array + x-kubernetes-list-type: atomic + resources: + properties: + claims: + items: + properties: + name: + type: string + required: + - name + type: object + type: array + x-kubernetes-list-map-keys: + - name + x-kubernetes-list-type: map + limits: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + type: object + requests: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + type: object + type: object + restartPolicy: + type: string + securityContext: + properties: + allowPrivilegeEscalation: + type: boolean + appArmorProfile: + properties: + localhostProfile: + type: string + type: + type: string + required: + - type + type: object + capabilities: + properties: + add: + items: + type: string + type: array + x-kubernetes-list-type: atomic + drop: + items: + type: string + type: array + x-kubernetes-list-type: atomic + type: object + privileged: + type: boolean + procMount: + type: string + readOnlyRootFilesystem: + type: boolean + runAsGroup: + format: int64 + type: integer + runAsNonRoot: + type: boolean + runAsUser: + format: int64 + type: integer + seLinuxOptions: + properties: + level: + type: string + role: + type: string + type: + type: string + user: + type: string + type: object + seccompProfile: + properties: + localhostProfile: + type: string + type: + type: string + required: + - type + type: object + windowsOptions: + properties: + gmsaCredentialSpec: + type: string + gmsaCredentialSpecName: + type: string + hostProcess: + type: boolean + runAsUserName: + type: string + type: object + type: object + startupProbe: + properties: + exec: + properties: + command: + items: + type: string + type: array + x-kubernetes-list-type: atomic + type: object + failureThreshold: + format: int32 + type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + required: + - port + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + x-kubernetes-list-type: atomic + path: + type: string + port: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + scheme: + type: string + required: + - port + type: object + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: + properties: + host: + type: string + port: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + required: + - port + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer + type: object + stdin: + type: boolean + stdinOnce: + type: boolean + terminationMessagePath: + type: string + terminationMessagePolicy: + type: string + tty: + type: boolean + volumeDevices: + items: + properties: + devicePath: + type: string + name: + type: string + required: + - devicePath + - name + type: object + type: array + x-kubernetes-list-map-keys: + - devicePath + x-kubernetes-list-type: map + volumeMounts: + items: + properties: + mountPath: + type: string + mountPropagation: + type: string + name: + type: string + readOnly: + type: boolean + recursiveReadOnly: + type: string + subPath: + type: string + subPathExpr: + type: string + required: + - mountPath + - name + type: object + type: array + x-kubernetes-list-map-keys: + - mountPath + x-kubernetes-list-type: map + workingDir: + type: string + required: + - name + type: object + type: array + dnsConfig: + properties: + nameservers: + items: + type: string + type: array + x-kubernetes-list-type: atomic + options: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + x-kubernetes-list-type: atomic + searches: + items: + type: string + type: array + x-kubernetes-list-type: atomic + type: object + dnsPolicy: + type: string + enableServiceLinks: + type: boolean + ephemeralContainers: + items: + properties: + args: + items: + type: string + type: array + x-kubernetes-list-type: atomic + command: + items: + type: string + type: array + x-kubernetes-list-type: atomic + env: + items: + properties: + name: + type: string + value: + type: string + valueFrom: + properties: + configMapKeyRef: + properties: + key: + type: string + name: + default: "" + type: string + optional: + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + fieldRef: + properties: + apiVersion: + type: string + fieldPath: + type: string + required: + - fieldPath + type: object + x-kubernetes-map-type: atomic + resourceFieldRef: + properties: + containerName: + type: string + divisor: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + resource: + type: string + required: + - resource + type: object + x-kubernetes-map-type: atomic + secretKeyRef: + properties: + key: + type: string + name: + default: "" + type: string + optional: + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + type: object + required: + - name + type: object + type: array + x-kubernetes-list-map-keys: + - name + x-kubernetes-list-type: map + envFrom: + items: + properties: + configMapRef: + properties: + name: + default: "" + type: string + optional: + type: boolean + type: object + x-kubernetes-map-type: atomic + prefix: + type: string + secretRef: + properties: + name: + default: "" + type: string + optional: + type: boolean + type: object + x-kubernetes-map-type: atomic + type: object + type: array + x-kubernetes-list-type: atomic + image: + type: string + imagePullPolicy: + type: string + lifecycle: + properties: + postStart: + properties: + exec: + properties: + command: + items: + type: string + type: array + x-kubernetes-list-type: atomic + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + x-kubernetes-list-type: atomic + path: + type: string + port: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + scheme: + type: string + required: + - port + type: object + sleep: + properties: + seconds: + format: int64 + type: integer + required: + - seconds + type: object + tcpSocket: + properties: + host: + type: string + port: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + required: + - port + type: object + type: object + preStop: + properties: + exec: + properties: + command: + items: + type: string + type: array + x-kubernetes-list-type: atomic + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + x-kubernetes-list-type: atomic + path: + type: string + port: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + scheme: + type: string + required: + - port + type: object + sleep: + properties: + seconds: + format: int64 + type: integer + required: + - seconds + type: object + tcpSocket: + properties: + host: + type: string + port: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + required: + - port + type: object + type: object + type: object + livenessProbe: + properties: + exec: + properties: + command: + items: + type: string + type: array + x-kubernetes-list-type: atomic + type: object + failureThreshold: + format: int32 + type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + required: + - port + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + x-kubernetes-list-type: atomic + path: + type: string + port: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + scheme: + type: string + required: + - port + type: object + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: + properties: + host: + type: string + port: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + required: + - port + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer + type: object + name: + type: string + ports: + items: + properties: + containerPort: + format: int32 + type: integer + hostIP: + type: string + hostPort: + format: int32 + type: integer + name: + type: string + protocol: + default: TCP + type: string + required: + - containerPort + type: object + type: array + x-kubernetes-list-map-keys: + - containerPort + - protocol + x-kubernetes-list-type: map + readinessProbe: + properties: + exec: + properties: + command: + items: + type: string + type: array + x-kubernetes-list-type: atomic + type: object + failureThreshold: + format: int32 + type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + required: + - port + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + x-kubernetes-list-type: atomic + path: + type: string + port: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + scheme: + type: string + required: + - port + type: object + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: + properties: + host: + type: string + port: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + required: + - port + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer + type: object + resizePolicy: + items: + properties: + resourceName: + type: string + restartPolicy: + type: string + required: + - resourceName + - restartPolicy + type: object + type: array + x-kubernetes-list-type: atomic + resources: + properties: + claims: + items: + properties: + name: + type: string + required: + - name + type: object + type: array + x-kubernetes-list-map-keys: + - name + x-kubernetes-list-type: map + limits: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + type: object + requests: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + type: object + type: object + restartPolicy: + type: string + securityContext: + properties: + allowPrivilegeEscalation: + type: boolean + appArmorProfile: + properties: + localhostProfile: + type: string + type: + type: string + required: + - type + type: object + capabilities: + properties: + add: + items: + type: string + type: array + x-kubernetes-list-type: atomic + drop: + items: + type: string + type: array + x-kubernetes-list-type: atomic + type: object + privileged: + type: boolean + procMount: + type: string + readOnlyRootFilesystem: + type: boolean + runAsGroup: + format: int64 + type: integer + runAsNonRoot: + type: boolean + runAsUser: + format: int64 + type: integer + seLinuxOptions: + properties: + level: + type: string + role: + type: string + type: + type: string + user: + type: string + type: object + seccompProfile: + properties: + localhostProfile: + type: string + type: + type: string + required: + - type + type: object + windowsOptions: + properties: + gmsaCredentialSpec: + type: string + gmsaCredentialSpecName: + type: string + hostProcess: + type: boolean + runAsUserName: + type: string + type: object + type: object + startupProbe: + properties: + exec: + properties: + command: + items: + type: string + type: array + x-kubernetes-list-type: atomic + type: object + failureThreshold: + format: int32 + type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + required: + - port + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + x-kubernetes-list-type: atomic + path: + type: string + port: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + scheme: + type: string + required: + - port + type: object + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: + properties: + host: + type: string + port: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + required: + - port + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer + type: object + stdin: + type: boolean + stdinOnce: + type: boolean + targetContainerName: + type: string + terminationMessagePath: + type: string + terminationMessagePolicy: + type: string + tty: + type: boolean + volumeDevices: + items: + properties: + devicePath: + type: string + name: + type: string + required: + - devicePath + - name + type: object + type: array + x-kubernetes-list-map-keys: + - devicePath + x-kubernetes-list-type: map + volumeMounts: + items: + properties: + mountPath: + type: string + mountPropagation: + type: string + name: + type: string + readOnly: + type: boolean + recursiveReadOnly: + type: string + subPath: + type: string + subPathExpr: + type: string + required: + - mountPath + - name + type: object + type: array + x-kubernetes-list-map-keys: + - mountPath + x-kubernetes-list-type: map + workingDir: + type: string + required: + - name + type: object + type: array + hostAliases: + items: + properties: + hostnames: + items: + type: string + type: array + x-kubernetes-list-type: atomic + ip: + type: string + required: + - ip + type: object + type: array + hostIPC: + type: boolean + hostNetwork: + type: boolean + hostPID: + type: boolean + hostUsers: + type: boolean + imagePullSecrets: + items: + properties: + name: + default: "" + type: string + type: object + x-kubernetes-map-type: atomic + type: array + initContainers: + items: + properties: + args: + items: + type: string + type: array + x-kubernetes-list-type: atomic + command: + items: + type: string + type: array + x-kubernetes-list-type: atomic + env: + items: + properties: + name: + type: string + value: + type: string + valueFrom: + properties: + configMapKeyRef: + properties: + key: + type: string + name: + default: "" + type: string + optional: + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + fieldRef: + properties: + apiVersion: + type: string + fieldPath: + type: string + required: + - fieldPath + type: object + x-kubernetes-map-type: atomic + resourceFieldRef: + properties: + containerName: + type: string + divisor: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + resource: + type: string + required: + - resource + type: object + x-kubernetes-map-type: atomic + secretKeyRef: + properties: + key: + type: string + name: + default: "" + type: string + optional: + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + type: object + required: + - name + type: object + type: array + x-kubernetes-list-map-keys: + - name + x-kubernetes-list-type: map + envFrom: + items: + properties: + configMapRef: + properties: + name: + default: "" + type: string + optional: + type: boolean + type: object + x-kubernetes-map-type: atomic + prefix: + type: string + secretRef: + properties: + name: + default: "" + type: string + optional: + type: boolean + type: object + x-kubernetes-map-type: atomic + type: object + type: array + x-kubernetes-list-type: atomic + image: + type: string + imagePullPolicy: + type: string + lifecycle: + properties: + postStart: + properties: + exec: + properties: + command: + items: + type: string + type: array + x-kubernetes-list-type: atomic + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + x-kubernetes-list-type: atomic + path: + type: string + port: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + scheme: + type: string + required: + - port + type: object + sleep: + properties: + seconds: + format: int64 + type: integer + required: + - seconds + type: object + tcpSocket: + properties: + host: + type: string + port: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + required: + - port + type: object + type: object + preStop: + properties: + exec: + properties: + command: + items: + type: string + type: array + x-kubernetes-list-type: atomic + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + x-kubernetes-list-type: atomic + path: + type: string + port: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + scheme: + type: string + required: + - port + type: object + sleep: + properties: + seconds: + format: int64 + type: integer + required: + - seconds + type: object + tcpSocket: + properties: + host: + type: string + port: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + required: + - port + type: object + type: object + type: object + livenessProbe: + properties: + exec: + properties: + command: + items: + type: string + type: array + x-kubernetes-list-type: atomic + type: object + failureThreshold: + format: int32 + type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + required: + - port + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + x-kubernetes-list-type: atomic + path: + type: string + port: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + scheme: + type: string + required: + - port + type: object + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: + properties: + host: + type: string + port: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + required: + - port + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer + type: object + name: + type: string + ports: + items: + properties: + containerPort: + format: int32 + type: integer + hostIP: + type: string + hostPort: + format: int32 + type: integer + name: + type: string + protocol: + default: TCP + type: string + required: + - containerPort + type: object + type: array + x-kubernetes-list-map-keys: + - containerPort + - protocol + x-kubernetes-list-type: map + readinessProbe: + properties: + exec: + properties: + command: + items: + type: string + type: array + x-kubernetes-list-type: atomic + type: object + failureThreshold: + format: int32 + type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + required: + - port + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + x-kubernetes-list-type: atomic + path: + type: string + port: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + scheme: + type: string + required: + - port + type: object + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: + properties: + host: + type: string + port: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + required: + - port + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer + type: object + resizePolicy: + items: + properties: + resourceName: + type: string + restartPolicy: + type: string + required: + - resourceName + - restartPolicy + type: object + type: array + x-kubernetes-list-type: atomic + resources: + properties: + claims: + items: + properties: + name: + type: string + required: + - name + type: object + type: array + x-kubernetes-list-map-keys: + - name + x-kubernetes-list-type: map + limits: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + type: object + requests: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + type: object + type: object + restartPolicy: + type: string + securityContext: + properties: + allowPrivilegeEscalation: + type: boolean + appArmorProfile: + properties: + localhostProfile: + type: string + type: + type: string + required: + - type + type: object + capabilities: + properties: + add: + items: + type: string + type: array + x-kubernetes-list-type: atomic + drop: + items: + type: string + type: array + x-kubernetes-list-type: atomic + type: object + privileged: + type: boolean + procMount: + type: string + readOnlyRootFilesystem: + type: boolean + runAsGroup: + format: int64 + type: integer + runAsNonRoot: + type: boolean + runAsUser: + format: int64 + type: integer + seLinuxOptions: + properties: + level: + type: string + role: + type: string + type: + type: string + user: + type: string + type: object + seccompProfile: + properties: + localhostProfile: + type: string + type: + type: string + required: + - type + type: object + windowsOptions: + properties: + gmsaCredentialSpec: + type: string + gmsaCredentialSpecName: + type: string + hostProcess: + type: boolean + runAsUserName: + type: string + type: object + type: object + startupProbe: + properties: + exec: + properties: + command: + items: + type: string + type: array + x-kubernetes-list-type: atomic + type: object + failureThreshold: + format: int32 + type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + required: + - port + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + x-kubernetes-list-type: atomic + path: + type: string + port: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + scheme: + type: string + required: + - port + type: object + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: + properties: + host: + type: string + port: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + required: + - port + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer + type: object + stdin: + type: boolean + stdinOnce: + type: boolean + terminationMessagePath: + type: string + terminationMessagePolicy: + type: string + tty: + type: boolean + volumeDevices: + items: + properties: + devicePath: + type: string + name: + type: string + required: + - devicePath + - name + type: object + type: array + x-kubernetes-list-map-keys: + - devicePath + x-kubernetes-list-type: map + volumeMounts: + items: + properties: + mountPath: + type: string + mountPropagation: + type: string + name: + type: string + readOnly: + type: boolean + recursiveReadOnly: + type: string + subPath: + type: string + subPathExpr: + type: string + required: + - mountPath + - name + type: object + type: array + x-kubernetes-list-map-keys: + - mountPath + x-kubernetes-list-type: map + workingDir: + type: string + required: + - name + type: object + type: array + nodeName: + type: string + nodeSelector: + additionalProperties: + type: string + type: object + x-kubernetes-map-type: atomic + os: + properties: + name: + type: string + required: + - name + type: object + overhead: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + type: object + podPlacementPolicy: + default: + name: default + properties: + name: + default: "" + type: string + type: object + x-kubernetes-map-type: atomic + preemptionPolicy: + type: string + priority: + format: int32 + type: integer + priorityClassName: + type: string + readinessGates: + items: + properties: + conditionType: + type: string + required: + - conditionType + type: object + type: array + restartPolicy: + type: string + runtimeClassName: + type: string + schedulerName: + type: string + securityContext: + properties: + appArmorProfile: + properties: + localhostProfile: + type: string + type: + type: string + required: + - type + type: object + fsGroup: + format: int64 + type: integer + fsGroupChangePolicy: + type: string + runAsGroup: + format: int64 + type: integer + runAsNonRoot: + type: boolean + runAsUser: + format: int64 + type: integer + seLinuxOptions: + properties: + level: + type: string + role: + type: string + type: + type: string + user: + type: string + type: object + seccompProfile: + properties: + localhostProfile: + type: string + type: + type: string + required: + - type + type: object + supplementalGroups: + items: + format: int64 + type: integer + type: array + x-kubernetes-list-type: atomic + sysctls: + items: + properties: + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + x-kubernetes-list-type: atomic + windowsOptions: + properties: + gmsaCredentialSpec: + type: string + gmsaCredentialSpecName: + type: string + hostProcess: + type: boolean + runAsUserName: + type: string + type: object + type: object + serviceAccountName: + type: string + setHostnameAsFQDN: + type: boolean + shareProcessNamespace: + type: boolean + terminationGracePeriodSeconds: + format: int64 + type: integer + tolerations: + items: + properties: + effect: + type: string + key: + type: string + operator: + type: string + tolerationSeconds: + format: int64 + type: integer + value: + type: string + type: object + type: array + volumes: + items: + properties: + awsElasticBlockStore: + properties: + fsType: + type: string + partition: + format: int32 + type: integer + readOnly: + type: boolean + volumeID: + type: string + required: + - volumeID + type: object + azureDisk: + properties: + cachingMode: + type: string + diskName: + type: string + diskURI: + type: string + fsType: + type: string + kind: + type: string + readOnly: + type: boolean + required: + - diskName + - diskURI + type: object + azureFile: + properties: + readOnly: + type: boolean + secretName: + type: string + shareName: + type: string + required: + - secretName + - shareName + type: object + cephfs: + properties: + monitors: + items: + type: string + type: array + x-kubernetes-list-type: atomic + path: + type: string + readOnly: + type: boolean + secretFile: + type: string + secretRef: + properties: + name: + default: "" + type: string + type: object + x-kubernetes-map-type: atomic + user: + type: string + required: + - monitors + type: object + cinder: + properties: + fsType: + type: string + readOnly: + type: boolean + secretRef: + properties: + name: + default: "" + type: string + type: object + x-kubernetes-map-type: atomic + volumeID: + type: string + required: + - volumeID + type: object + configMap: + properties: + defaultMode: + format: int32 + type: integer + items: + items: + properties: + key: + type: string + mode: + format: int32 + type: integer + path: + type: string + required: + - key + - path + type: object + type: array + x-kubernetes-list-type: atomic + name: + default: "" + type: string + optional: + type: boolean + type: object + x-kubernetes-map-type: atomic + csi: + properties: + driver: + type: string + fsType: + type: string + nodePublishSecretRef: + properties: + name: + default: "" + type: string + type: object + x-kubernetes-map-type: atomic + readOnly: + type: boolean + volumeAttributes: + additionalProperties: + type: string + type: object + required: + - driver + type: object + downwardAPI: + properties: + defaultMode: + format: int32 + type: integer + items: + items: + properties: + fieldRef: + properties: + apiVersion: + type: string + fieldPath: + type: string + required: + - fieldPath + type: object + x-kubernetes-map-type: atomic + mode: + format: int32 + type: integer + path: + type: string + resourceFieldRef: + properties: + containerName: + type: string + divisor: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + resource: + type: string + required: + - resource + type: object + x-kubernetes-map-type: atomic + required: + - path + type: object + type: array + x-kubernetes-list-type: atomic + type: object + emptyDir: + properties: + medium: + type: string + sizeLimit: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + type: object + ephemeral: + properties: + volumeClaimTemplate: + properties: + metadata: + properties: + annotations: + additionalProperties: + type: string + type: object + generateName: + type: string + labels: + additionalProperties: + type: string + type: object + name: + type: string + namespace: + type: string + ownerReferences: + items: + properties: + apiVersion: + type: string + blockOwnerDeletion: + type: boolean + controller: + type: boolean + kind: + type: string + name: + type: string + uid: + type: string + required: + - apiVersion + - kind + - name + - uid + type: object + x-kubernetes-map-type: atomic + type: array + type: object + spec: + properties: + accessModes: + items: + type: string + type: array + x-kubernetes-list-type: atomic + dataSource: + properties: + apiGroup: + type: string + kind: + type: string + name: + type: string + required: + - kind + - name + type: object + x-kubernetes-map-type: atomic + dataSourceRef: + properties: + apiGroup: + type: string + kind: + type: string + name: + type: string + namespace: + type: string + required: + - kind + - name + type: object + resources: + properties: + limits: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + type: object + requests: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + type: object + type: object + selector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + x-kubernetes-list-type: atomic + required: + - key + - operator + type: object + type: array + x-kubernetes-list-type: atomic + matchLabels: + additionalProperties: + type: string + type: object + type: object + x-kubernetes-map-type: atomic + storageClassName: + type: string + volumeAttributesClassName: + type: string + volumeMode: + type: string + volumeName: + type: string + type: object + required: + - spec + type: object + type: object + fc: + properties: + fsType: + type: string + lun: + format: int32 + type: integer + readOnly: + type: boolean + targetWWNs: + items: + type: string + type: array + x-kubernetes-list-type: atomic + wwids: + items: + type: string + type: array + x-kubernetes-list-type: atomic + type: object + flexVolume: + properties: + driver: + type: string + fsType: + type: string + options: + additionalProperties: + type: string + type: object + readOnly: + type: boolean + secretRef: + properties: + name: + default: "" + type: string + type: object + x-kubernetes-map-type: atomic + required: + - driver + type: object + flocker: + properties: + datasetName: + type: string + datasetUUID: + type: string + type: object + gcePersistentDisk: + properties: + fsType: + type: string + partition: + format: int32 + type: integer + pdName: + type: string + readOnly: + type: boolean + required: + - pdName + type: object + glusterfs: + properties: + endpoints: + type: string + path: + type: string + readOnly: + type: boolean + required: + - endpoints + - path + type: object + hostPath: + properties: + path: + type: string + type: + type: string + required: + - path + type: object + iscsi: + properties: + chapAuthDiscovery: + type: boolean + chapAuthSession: + type: boolean + fsType: + type: string + initiatorName: + type: string + iqn: + type: string + iscsiInterface: + type: string + lun: + format: int32 + type: integer + portals: + items: + type: string + type: array + x-kubernetes-list-type: atomic + readOnly: + type: boolean + secretRef: + properties: + name: + default: "" + type: string + type: object + x-kubernetes-map-type: atomic + targetPortal: + type: string + required: + - iqn + - lun + - targetPortal + type: object + name: + type: string + nfs: + properties: + path: + type: string + readOnly: + type: boolean + server: + type: string + required: + - path + - server + type: object + persistentVolumeClaim: + properties: + claimName: + type: string + readOnly: + type: boolean + required: + - claimName + type: object + photonPersistentDisk: + properties: + fsType: + type: string + pdID: + type: string + required: + - pdID + type: object + portworxVolume: + properties: + fsType: + type: string + readOnly: + type: boolean + volumeID: + type: string + required: + - volumeID + type: object + projected: + properties: + defaultMode: + format: int32 + type: integer + sources: + items: + properties: + clusterTrustBundle: + properties: + labelSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + x-kubernetes-list-type: atomic + required: + - key + - operator + type: object + type: array + x-kubernetes-list-type: atomic + matchLabels: + additionalProperties: + type: string + type: object + type: object + x-kubernetes-map-type: atomic + name: + type: string + optional: + type: boolean + path: + type: string + signerName: + type: string + required: + - path + type: object + configMap: + properties: + items: + items: + properties: + key: + type: string + mode: + format: int32 + type: integer + path: + type: string + required: + - key + - path + type: object + type: array + x-kubernetes-list-type: atomic + name: + default: "" + type: string + optional: + type: boolean + type: object + x-kubernetes-map-type: atomic + downwardAPI: + properties: + items: + items: + properties: + fieldRef: + properties: + apiVersion: + type: string + fieldPath: + type: string + required: + - fieldPath + type: object + x-kubernetes-map-type: atomic + mode: + format: int32 + type: integer + path: + type: string + resourceFieldRef: + properties: + containerName: + type: string + divisor: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + resource: + type: string + required: + - resource + type: object + x-kubernetes-map-type: atomic + required: + - path + type: object + type: array + x-kubernetes-list-type: atomic + type: object + secret: + properties: + items: + items: + properties: + key: + type: string + mode: + format: int32 + type: integer + path: + type: string + required: + - key + - path + type: object + type: array + x-kubernetes-list-type: atomic + name: + default: "" + type: string + optional: + type: boolean + type: object + x-kubernetes-map-type: atomic + serviceAccountToken: + properties: + audience: + type: string + expirationSeconds: + format: int64 + type: integer + path: + type: string + required: + - path + type: object + type: object + type: array + x-kubernetes-list-type: atomic + type: object + quobyte: + properties: + group: + type: string + readOnly: + type: boolean + registry: + type: string + tenant: + type: string + user: + type: string + volume: + type: string + required: + - registry + - volume + type: object + rbd: + properties: + fsType: + type: string + image: + type: string + keyring: + type: string + monitors: + items: + type: string + type: array + x-kubernetes-list-type: atomic + pool: + type: string + readOnly: + type: boolean + secretRef: + properties: + name: + default: "" + type: string + type: object + x-kubernetes-map-type: atomic + user: + type: string + required: + - image + - monitors + type: object + scaleIO: + properties: + fsType: + type: string + gateway: + type: string + protectionDomain: + type: string + readOnly: + type: boolean + secretRef: + properties: + name: + default: "" + type: string + type: object + x-kubernetes-map-type: atomic + sslEnabled: + type: boolean + storageMode: + type: string + storagePool: + type: string + system: + type: string + volumeName: + type: string + required: + - gateway + - secretRef + - system + type: object + secret: + properties: + defaultMode: + format: int32 + type: integer + items: + items: + properties: + key: + type: string + mode: + format: int32 + type: integer + path: + type: string + required: + - key + - path + type: object + type: array + x-kubernetes-list-type: atomic + optional: + type: boolean + secretName: + type: string + type: object + storageos: + properties: + fsType: + type: string + readOnly: + type: boolean + secretRef: + properties: + name: + default: "" + type: string + type: object + x-kubernetes-map-type: atomic + volumeName: + type: string + volumeNamespace: + type: string + type: object + vsphereVolume: + properties: + fsType: + type: string + storagePolicyID: + type: string + storagePolicyName: + type: string + volumePath: + type: string + required: + - volumePath + type: object + required: + - name + type: object + type: array + type: object + type: object + replicas: + format: int32 + type: integer + serviceTemplates: + items: + properties: + alias: + enum: + - primary + - standby + - stats + type: string + metadata: + properties: + annotations: + additionalProperties: + type: string + type: object + labels: + additionalProperties: + type: string + type: object + type: object + spec: + properties: + clusterIP: + type: string + externalIPs: + items: + type: string + type: array + externalTrafficPolicy: + type: string + healthCheckNodePort: + format: int32 + type: integer + loadBalancerIP: + type: string + loadBalancerSourceRanges: + items: + type: string + type: array + ports: + items: + properties: + name: + type: string + nodePort: + format: int32 + type: integer + port: + format: int32 + type: integer + required: + - port + type: object + type: array + sessionAffinityConfig: + properties: + clientIP: + properties: + timeoutSeconds: + format: int32 + type: integer + type: object + type: object + type: + type: string + type: object + required: + - alias + type: object + type: array + version: + type: string + required: + - kafkaRef + - version + type: object + status: + properties: + conditions: + items: + properties: + lastTransitionTime: + format: date-time + type: string + message: + type: string + observedGeneration: + format: int64 + type: integer + reason: + type: string + severity: + type: string + status: + type: string + type: + type: string + required: + - lastTransitionTime + - status + - type + type: object + type: array + observedGeneration: + format: int64 + type: integer + phase: + enum: + - Provisioning + - Ready + - NotReady + - Critical + - Unknown + type: string + type: object + type: object + served: true + storage: true + subresources: + status: {}