From 506f308b8f16205e6eb543fc6d950b35ecd59d15 Mon Sep 17 00:00:00 2001 From: tunahanertekin Date: Wed, 20 Mar 2024 17:35:22 +0300 Subject: [PATCH 1/5] refactor(api): create api for edgeproxy --- PROJECT | 13 +++ .../roboscale.io/v1alpha2/toolkit_types.go | 35 ++++++++ .../roboscale.io/v1alpha2/toolkit_webhook.go | 44 +++++++++ .../v1alpha2/webhook_suite_test.go | 3 + .../v1alpha2/zz_generated.deepcopy.go | 89 +++++++++++++++++++ 5 files changed, 184 insertions(+) diff --git a/PROJECT b/PROJECT index c8125e63..2d32e865 100644 --- a/PROJECT +++ b/PROJECT @@ -195,4 +195,17 @@ resources: defaulting: true validation: true webhookVersion: v1 +- api: + crdVersion: v1 + namespaced: true + controller: true + domain: roboscale.io + group: robot + kind: EdgeProxy + path: github.com/robolaunch/robot-operator/pkg/api/roboscale.io/v1alpha2 + version: v1alpha2 + webhooks: + defaulting: true + validation: true + webhookVersion: v1 version: "3" diff --git a/pkg/api/roboscale.io/v1alpha2/toolkit_types.go b/pkg/api/roboscale.io/v1alpha2/toolkit_types.go index bb8289f9..dbac370b 100644 --- a/pkg/api/roboscale.io/v1alpha2/toolkit_types.go +++ b/pkg/api/roboscale.io/v1alpha2/toolkit_types.go @@ -25,6 +25,7 @@ import ( func init() { SchemeBuilder.Register(&ROS2Bridge{}, &ROS2BridgeList{}) SchemeBuilder.Register(&CodeEditor{}, &CodeEditorList{}) + SchemeBuilder.Register(&EdgeProxy{}, &EdgeProxyList{}) } //+genclient @@ -73,6 +74,28 @@ type CodeEditorList struct { Items []CodeEditor `json:"items"` } +//+genclient +//+kubebuilder:object:root=true +//+kubebuilder:subresource:status + +// EdgeProxy is the Schema for the edgeproxies API. +type EdgeProxy struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec EdgeProxySpec `json:"spec,omitempty"` + Status EdgeProxyStatus `json:"status,omitempty"` +} + +//+kubebuilder:object:root=true + +// EdgeProxyList contains a list of EdgeProxy. +type EdgeProxyList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []EdgeProxy `json:"items"` +} + // ******************************** // ROS2Bridge types // ******************************** @@ -171,3 +194,15 @@ type CodeEditorStatus struct { // Field to indicate if the workload should be restarted. WorkloadUpdateNeeded bool `json:"workloadUpdateNeeded,omitempty"` } + +// ******************************** +// EdgeProxy types +// ******************************** + +// EdgeProxySpec defines the desired state of EdgeProxy. +type EdgeProxySpec struct { +} + +// EdgeProxyStatus defines the observed state of EdgeProxy. +type EdgeProxyStatus struct { +} diff --git a/pkg/api/roboscale.io/v1alpha2/toolkit_webhook.go b/pkg/api/roboscale.io/v1alpha2/toolkit_webhook.go index 4027b4aa..d208a8ab 100644 --- a/pkg/api/roboscale.io/v1alpha2/toolkit_webhook.go +++ b/pkg/api/roboscale.io/v1alpha2/toolkit_webhook.go @@ -145,3 +145,47 @@ func (r *CodeEditor) validateVersion() error { return nil } + +// ******************************** +// EdgeProxy webhooks +// ******************************** + +// log is for logging in this package. +var edgeproxylog = logf.Log.WithName("edgeproxy-resource") + +func (r *EdgeProxy) SetupWebhookWithManager(mgr ctrl.Manager) error { + return ctrl.NewWebhookManagedBy(mgr). + For(r). + Complete() +} + +//+kubebuilder:webhook:path=/mutate-robot-roboscale-io-v1alpha2-edgeproxy,mutating=true,failurePolicy=fail,sideEffects=None,groups=robot.roboscale.io,resources=edgeproxies,verbs=create;update,versions=v1alpha2,name=medgeproxy.kb.io,admissionReviewVersions=v1 + +var _ webhook.Defaulter = &EdgeProxy{} + +// Default implements webhook.Defaulter so a webhook will be registered for the type +func (r *EdgeProxy) Default() { + edgeproxylog.Info("default", "name", r.Name) +} + +//+kubebuilder:webhook:path=/validate-robot-roboscale-io-v1alpha2-edgeproxy,mutating=false,failurePolicy=fail,sideEffects=None,groups=robot.roboscale.io,resources=edgeproxies,verbs=create;update,versions=v1alpha2,name=vedgeproxy.kb.io,admissionReviewVersions=v1 + +var _ webhook.Validator = &EdgeProxy{} + +// ValidateCreate implements webhook.Validator so a webhook will be registered for the type +func (r *EdgeProxy) ValidateCreate() error { + edgeproxylog.Info("validate create", "name", r.Name) + return nil +} + +// ValidateUpdate implements webhook.Validator so a webhook will be registered for the type +func (r *EdgeProxy) ValidateUpdate(old runtime.Object) error { + edgeproxylog.Info("validate update", "name", r.Name) + return nil +} + +// ValidateDelete implements webhook.Validator so a webhook will be registered for the type +func (r *EdgeProxy) ValidateDelete() error { + edgeproxylog.Info("validate delete", "name", r.Name) + return nil +} diff --git a/pkg/api/roboscale.io/v1alpha2/webhook_suite_test.go b/pkg/api/roboscale.io/v1alpha2/webhook_suite_test.go index 8db442f6..7ea0fd3c 100644 --- a/pkg/api/roboscale.io/v1alpha2/webhook_suite_test.go +++ b/pkg/api/roboscale.io/v1alpha2/webhook_suite_test.go @@ -105,6 +105,9 @@ var _ = BeforeSuite(func() { err = (&ROS2Bridge{}).SetupWebhookWithManager(mgr) Expect(err).NotTo(HaveOccurred()) + err = (&EdgeProxy{}).SetupWebhookWithManager(mgr) + Expect(err).NotTo(HaveOccurred()) + //+kubebuilder:scaffold:webhook go func() { diff --git a/pkg/api/roboscale.io/v1alpha2/zz_generated.deepcopy.go b/pkg/api/roboscale.io/v1alpha2/zz_generated.deepcopy.go index 98898c47..854a38d3 100644 --- a/pkg/api/roboscale.io/v1alpha2/zz_generated.deepcopy.go +++ b/pkg/api/roboscale.io/v1alpha2/zz_generated.deepcopy.go @@ -168,6 +168,95 @@ func (in *CodeEditorStatus) DeepCopy() *CodeEditorStatus { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *EdgeProxy) DeepCopyInto(out *EdgeProxy) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + out.Status = in.Status +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EdgeProxy. +func (in *EdgeProxy) DeepCopy() *EdgeProxy { + if in == nil { + return nil + } + out := new(EdgeProxy) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *EdgeProxy) 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 *EdgeProxyList) DeepCopyInto(out *EdgeProxyList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]EdgeProxy, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EdgeProxyList. +func (in *EdgeProxyList) DeepCopy() *EdgeProxyList { + if in == nil { + return nil + } + out := new(EdgeProxyList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *EdgeProxyList) 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 *EdgeProxySpec) DeepCopyInto(out *EdgeProxySpec) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EdgeProxySpec. +func (in *EdgeProxySpec) DeepCopy() *EdgeProxySpec { + if in == nil { + return nil + } + out := new(EdgeProxySpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *EdgeProxyStatus) DeepCopyInto(out *EdgeProxyStatus) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EdgeProxyStatus. +func (in *EdgeProxyStatus) DeepCopy() *EdgeProxyStatus { + if in == nil { + return nil + } + out := new(EdgeProxyStatus) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ExternalVolumeStatus) DeepCopyInto(out *ExternalVolumeStatus) { *out = *in From f46201a5b8359ee493829da0e3aada6bba462ff9 Mon Sep 17 00:00:00 2001 From: tunahanertekin Date: Wed, 20 Mar 2024 17:35:39 +0300 Subject: [PATCH 2/5] refactor(controller): create controller module for edgeproxy --- main.go | 16 +++- .../edge_proxy/edgeproxy_controller.go | 50 ++++++++++++ .../v1alpha2/toolkit/edge_proxy/suite_test.go | 80 +++++++++++++++++++ 3 files changed, 145 insertions(+), 1 deletion(-) create mode 100644 pkg/controllers/v1alpha2/toolkit/edge_proxy/edgeproxy_controller.go create mode 100644 pkg/controllers/v1alpha2/toolkit/edge_proxy/suite_test.go diff --git a/main.go b/main.go index fc507ee4..3f5f2a37 100644 --- a/main.go +++ b/main.go @@ -52,6 +52,7 @@ import ( workspaceManager "github.com/robolaunch/robot-operator/pkg/controllers/v1alpha1/workspace_manager" ros2Workload "github.com/robolaunch/robot-operator/pkg/controllers/v1alpha2/production/ros2_workload" codeEditor "github.com/robolaunch/robot-operator/pkg/controllers/v1alpha2/toolkit/code_editor" + edgeProxy "github.com/robolaunch/robot-operator/pkg/controllers/v1alpha2/toolkit/edge_proxy" ros2Bridge "github.com/robolaunch/robot-operator/pkg/controllers/v1alpha2/toolkit/ros2_bridge" //+kubebuilder:scaffold:imports ) @@ -363,7 +364,7 @@ func startToolkitCRDsAndWebhooks(mgr manager.Manager) { os.Exit(1) } - // ROS2Bridge controller & webhook + // CodeEditor controller & webhook if err := (&codeEditor.CodeEditorReconciler{ Client: mgr.GetClient(), Scheme: mgr.GetScheme(), @@ -376,4 +377,17 @@ func startToolkitCRDsAndWebhooks(mgr manager.Manager) { setupLog.Error(err, "unable to create webhook", "webhook", "CodeEditor") os.Exit(1) } + + // EdgeProxy controller & webhook + if err := (&edgeProxy.EdgeProxyReconciler{ + Client: mgr.GetClient(), + Scheme: mgr.GetScheme(), + }).SetupWithManager(mgr); err != nil { + setupLog.Error(err, "unable to create controller", "controller", "EdgeProxy") + os.Exit(1) + } + if err := (&robotv1alpha2.EdgeProxy{}).SetupWebhookWithManager(mgr); err != nil { + setupLog.Error(err, "unable to create webhook", "webhook", "EdgeProxy") + os.Exit(1) + } } diff --git a/pkg/controllers/v1alpha2/toolkit/edge_proxy/edgeproxy_controller.go b/pkg/controllers/v1alpha2/toolkit/edge_proxy/edgeproxy_controller.go new file mode 100644 index 00000000..a9c678ea --- /dev/null +++ b/pkg/controllers/v1alpha2/toolkit/edge_proxy/edgeproxy_controller.go @@ -0,0 +1,50 @@ +/* +Copyright 2022. + +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 edge_proxy + +import ( + "context" + + "k8s.io/apimachinery/pkg/runtime" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" + "sigs.k8s.io/controller-runtime/pkg/log" + + robotv1alpha2 "github.com/robolaunch/robot-operator/pkg/api/roboscale.io/v1alpha2" +) + +// EdgeProxyReconciler reconciles a EdgeProxy object +type EdgeProxyReconciler struct { + client.Client + Scheme *runtime.Scheme +} + +//+kubebuilder:rbac:groups=robot.roboscale.io,resources=edgeproxies,verbs=get;list;watch;create;update;patch;delete +//+kubebuilder:rbac:groups=robot.roboscale.io,resources=edgeproxies/status,verbs=get;update;patch +//+kubebuilder:rbac:groups=robot.roboscale.io,resources=edgeproxies/finalizers,verbs=update + +func (r *EdgeProxyReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) { + _ = log.FromContext(ctx) + return ctrl.Result{}, nil +} + +// SetupWithManager sets up the controller with the Manager. +func (r *EdgeProxyReconciler) SetupWithManager(mgr ctrl.Manager) error { + return ctrl.NewControllerManagedBy(mgr). + For(&robotv1alpha2.EdgeProxy{}). + Complete(r) +} diff --git a/pkg/controllers/v1alpha2/toolkit/edge_proxy/suite_test.go b/pkg/controllers/v1alpha2/toolkit/edge_proxy/suite_test.go new file mode 100644 index 00000000..aa7fb55b --- /dev/null +++ b/pkg/controllers/v1alpha2/toolkit/edge_proxy/suite_test.go @@ -0,0 +1,80 @@ +/* +Copyright 2022. + +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 edge_proxy + +import ( + "path/filepath" + "testing" + + . "github.com/onsi/ginkgo/v2" + . "github.com/onsi/gomega" + + "k8s.io/client-go/kubernetes/scheme" + "k8s.io/client-go/rest" + "sigs.k8s.io/controller-runtime/pkg/client" + "sigs.k8s.io/controller-runtime/pkg/envtest" + logf "sigs.k8s.io/controller-runtime/pkg/log" + "sigs.k8s.io/controller-runtime/pkg/log/zap" + + robotv1alpha2 "github.com/robolaunch/robot-operator/pkg/api/roboscale.io/v1alpha2" + //+kubebuilder:scaffold:imports +) + +// These tests use Ginkgo (BDD-style Go testing framework). Refer to +// http://onsi.github.io/ginkgo/ to learn more about Ginkgo. + +var cfg *rest.Config +var k8sClient client.Client +var testEnv *envtest.Environment + +func TestAPIs(t *testing.T) { + RegisterFailHandler(Fail) + + RunSpecs(t, "Controller Suite") +} + +var _ = BeforeSuite(func() { + logf.SetLogger(zap.New(zap.WriteTo(GinkgoWriter), zap.UseDevMode(true))) + + By("bootstrapping test environment") + testEnv = &envtest.Environment{ + CRDDirectoryPaths: []string{filepath.Join("..", "config", "crd", "bases")}, + ErrorIfCRDPathMissing: true, + } + + var err error + // cfg is defined in this file globally. + cfg, err = testEnv.Start() + Expect(err).NotTo(HaveOccurred()) + Expect(cfg).NotTo(BeNil()) + + err = robotv1alpha2.AddToScheme(scheme.Scheme) + Expect(err).NotTo(HaveOccurred()) + + //+kubebuilder:scaffold:scheme + + k8sClient, err = client.New(cfg, client.Options{Scheme: scheme.Scheme}) + Expect(err).NotTo(HaveOccurred()) + Expect(k8sClient).NotTo(BeNil()) + +}) + +var _ = AfterSuite(func() { + By("tearing down the test environment") + err := testEnv.Stop() + Expect(err).NotTo(HaveOccurred()) +}) From 42f8e9ac983fc455fca9f528e1bc4e1bf407bb40 Mon Sep 17 00:00:00 2001 From: tunahanertekin Date: Wed, 20 Mar 2024 17:38:48 +0300 Subject: [PATCH 3/5] build(manifests): :whale: update internal manifests --- .../bases/robot.roboscale.io_edgeproxies.yaml | 45 +++++++++++++++++++ config/crd/kustomization.yaml | 3 ++ .../patches/cainjection_in_edgeproxies.yaml | 7 +++ .../crd/patches/webhook_in_edgeproxies.yaml | 16 +++++++ config/rbac/edgeproxy_editor_role.yaml | 31 +++++++++++++ config/rbac/edgeproxy_viewer_role.yaml | 27 +++++++++++ config/rbac/role.yaml | 26 +++++++++++ config/samples/robot_v1alpha2_edgeproxy.yaml | 12 +++++ config/webhook/manifests.yaml | 40 +++++++++++++++++ 9 files changed, 207 insertions(+) create mode 100644 config/crd/bases/robot.roboscale.io_edgeproxies.yaml create mode 100644 config/crd/patches/cainjection_in_edgeproxies.yaml create mode 100644 config/crd/patches/webhook_in_edgeproxies.yaml create mode 100644 config/rbac/edgeproxy_editor_role.yaml create mode 100644 config/rbac/edgeproxy_viewer_role.yaml create mode 100644 config/samples/robot_v1alpha2_edgeproxy.yaml diff --git a/config/crd/bases/robot.roboscale.io_edgeproxies.yaml b/config/crd/bases/robot.roboscale.io_edgeproxies.yaml new file mode 100644 index 00000000..85cef36c --- /dev/null +++ b/config/crd/bases/robot.roboscale.io_edgeproxies.yaml @@ -0,0 +1,45 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.9.2 + creationTimestamp: null + name: edgeproxies.robot.roboscale.io +spec: + group: robot.roboscale.io + names: + kind: EdgeProxy + listKind: EdgeProxyList + plural: edgeproxies + singular: edgeproxy + scope: Namespaced + versions: + - name: v1alpha2 + schema: + openAPIV3Schema: + description: EdgeProxy is the Schema for the edgeproxies API. + properties: + apiVersion: + 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 + kind: + 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 + metadata: + type: object + spec: + description: EdgeProxySpec defines the desired state of EdgeProxy. + type: object + status: + description: EdgeProxyStatus defines the observed state of EdgeProxy. + type: object + type: object + served: true + storage: true + subresources: + status: {} diff --git a/config/crd/kustomization.yaml b/config/crd/kustomization.yaml index c05b8d32..7a7ebbb1 100644 --- a/config/crd/kustomization.yaml +++ b/config/crd/kustomization.yaml @@ -21,6 +21,7 @@ resources: - bases/robot.roboscale.io_ros2workloads.yaml - bases/robot.roboscale.io_ros2bridges.yaml - bases/robot.roboscale.io_codeeditors.yaml +- bases/robot.roboscale.io_edgeproxies.yaml #+kubebuilder:scaffold:crdkustomizeresource patchesStrategicMerge: @@ -43,6 +44,7 @@ patchesStrategicMerge: #- patches/webhook_in_ros2workloads.yaml #- patches/webhook_in_ros2bridges.yaml #- patches/webhook_in_codeeditors.yaml +#- patches/webhook_in_edgeproxies.yaml #+kubebuilder:scaffold:crdkustomizewebhookpatch # [CERTMANAGER] To enable cert-manager, uncomment all the sections with [CERTMANAGER] prefix. @@ -64,6 +66,7 @@ patchesStrategicMerge: #- patches/cainjection_in_ros2workloads.yaml #- patches/cainjection_in_ros2bridges.yaml #- patches/cainjection_in_codeeditors.yaml +#- patches/cainjection_in_edgeproxies.yaml #+kubebuilder:scaffold:crdkustomizecainjectionpatch # the following config is for teaching kustomize how to do kustomization for CRDs. diff --git a/config/crd/patches/cainjection_in_edgeproxies.yaml b/config/crd/patches/cainjection_in_edgeproxies.yaml new file mode 100644 index 00000000..d2182c9f --- /dev/null +++ b/config/crd/patches/cainjection_in_edgeproxies.yaml @@ -0,0 +1,7 @@ +# The following patch adds a directive for certmanager to inject CA into the CRD +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME) + name: edgeproxies.robot.roboscale.io diff --git a/config/crd/patches/webhook_in_edgeproxies.yaml b/config/crd/patches/webhook_in_edgeproxies.yaml new file mode 100644 index 00000000..e82d7a26 --- /dev/null +++ b/config/crd/patches/webhook_in_edgeproxies.yaml @@ -0,0 +1,16 @@ +# The following patch enables a conversion webhook for the CRD +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + name: edgeproxies.robot.roboscale.io +spec: + conversion: + strategy: Webhook + webhook: + clientConfig: + service: + namespace: system + name: webhook-service + path: /convert + conversionReviewVersions: + - v1 diff --git a/config/rbac/edgeproxy_editor_role.yaml b/config/rbac/edgeproxy_editor_role.yaml new file mode 100644 index 00000000..8bc8b712 --- /dev/null +++ b/config/rbac/edgeproxy_editor_role.yaml @@ -0,0 +1,31 @@ +# permissions for end users to edit edgeproxies. +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + labels: + app.kubernetes.io/name: clusterrole + app.kubernetes.io/instance: edgeproxy-editor-role + app.kubernetes.io/component: rbac + app.kubernetes.io/created-by: robot-operator + app.kubernetes.io/part-of: robot-operator + app.kubernetes.io/managed-by: kustomize + name: edgeproxy-editor-role +rules: +- apiGroups: + - robot.roboscale.io + resources: + - edgeproxies + verbs: + - create + - delete + - get + - list + - patch + - update + - watch +- apiGroups: + - robot.roboscale.io + resources: + - edgeproxies/status + verbs: + - get diff --git a/config/rbac/edgeproxy_viewer_role.yaml b/config/rbac/edgeproxy_viewer_role.yaml new file mode 100644 index 00000000..3f0bb1dc --- /dev/null +++ b/config/rbac/edgeproxy_viewer_role.yaml @@ -0,0 +1,27 @@ +# permissions for end users to view edgeproxies. +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + labels: + app.kubernetes.io/name: clusterrole + app.kubernetes.io/instance: edgeproxy-viewer-role + app.kubernetes.io/component: rbac + app.kubernetes.io/created-by: robot-operator + app.kubernetes.io/part-of: robot-operator + app.kubernetes.io/managed-by: kustomize + name: edgeproxy-viewer-role +rules: +- apiGroups: + - robot.roboscale.io + resources: + - edgeproxies + verbs: + - get + - list + - watch +- apiGroups: + - robot.roboscale.io + resources: + - edgeproxies/status + verbs: + - get diff --git a/config/rbac/role.yaml b/config/rbac/role.yaml index b6c6e76f..cdd7e8fa 100644 --- a/config/rbac/role.yaml +++ b/config/rbac/role.yaml @@ -263,6 +263,32 @@ rules: - get - patch - update +- apiGroups: + - robot.roboscale.io + resources: + - edgeproxies + verbs: + - create + - delete + - get + - list + - patch + - update + - watch +- apiGroups: + - robot.roboscale.io + resources: + - edgeproxies/finalizers + verbs: + - update +- apiGroups: + - robot.roboscale.io + resources: + - edgeproxies/status + verbs: + - get + - patch + - update - apiGroups: - robot.roboscale.io resources: diff --git a/config/samples/robot_v1alpha2_edgeproxy.yaml b/config/samples/robot_v1alpha2_edgeproxy.yaml new file mode 100644 index 00000000..51670216 --- /dev/null +++ b/config/samples/robot_v1alpha2_edgeproxy.yaml @@ -0,0 +1,12 @@ +apiVersion: robot.roboscale.io/v1alpha2 +kind: EdgeProxy +metadata: + labels: + app.kubernetes.io/name: edgeproxy + app.kubernetes.io/instance: edgeproxy-sample + app.kubernetes.io/part-of: robot-operator + app.kuberentes.io/managed-by: kustomize + app.kubernetes.io/created-by: robot-operator + name: edgeproxy-sample +spec: + # TODO(user): Add fields here diff --git a/config/webhook/manifests.yaml b/config/webhook/manifests.yaml index 840b0b40..39e1c92d 100644 --- a/config/webhook/manifests.yaml +++ b/config/webhook/manifests.yaml @@ -245,6 +245,26 @@ webhooks: resources: - codeeditors sideEffects: None +- admissionReviewVersions: + - v1 + clientConfig: + service: + name: webhook-service + namespace: system + path: /mutate-robot-roboscale-io-v1alpha2-edgeproxy + failurePolicy: Fail + name: medgeproxy.kb.io + rules: + - apiGroups: + - robot.roboscale.io + apiVersions: + - v1alpha2 + operations: + - CREATE + - UPDATE + resources: + - edgeproxies + sideEffects: None --- apiVersion: admissionregistration.k8s.io/v1 kind: ValidatingWebhookConfiguration @@ -492,3 +512,23 @@ webhooks: resources: - codeeditors sideEffects: None +- admissionReviewVersions: + - v1 + clientConfig: + service: + name: webhook-service + namespace: system + path: /validate-robot-roboscale-io-v1alpha2-edgeproxy + failurePolicy: Fail + name: vedgeproxy.kb.io + rules: + - apiGroups: + - robot.roboscale.io + apiVersions: + - v1alpha2 + operations: + - CREATE + - UPDATE + resources: + - edgeproxies + sideEffects: None From 4c2131d5c3df020c0c91c66383394250d80e52d9 Mon Sep 17 00:00:00 2001 From: tunahanertekin Date: Thu, 21 Mar 2024 09:41:04 +0300 Subject: [PATCH 4/5] build(manifests): :whale: update manifests and chart for v0.2.7-alpha.6.4 --- CHANGELOG.md | 12 +- config/manager/kustomization.yaml | 2 +- docs/_coverpage.md | 2 +- hack/deploy/chart/robot-operator/Chart.yaml | 4 +- .../templates/codeeditor-crd.yaml | 58 ++++++ .../templates/edgeproxy-crd.yaml | 51 ++++++ .../templates/manager-rbac.yaml | 38 ++++ .../mutating-webhook-configuration.yaml | 20 +++ .../validating-webhook-configuration.yaml | 20 +++ hack/deploy/chart/robot-operator/values.yaml | 2 +- hack/deploy/manifests/robot_operator.yaml | 168 +++++++++++++++++- 11 files changed, 370 insertions(+), 7 deletions(-) create mode 100644 hack/deploy/chart/robot-operator/templates/edgeproxy-crd.yaml diff --git a/CHANGELOG.md b/CHANGELOG.md index e8ea499b..6f0aeab7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,15 @@ ## [Unreleased] +### Feat +- **code-editor:** :rocket: implement code editor (robotide in v1alpha1) + +### Fix +- **update:** remove already exists condition from update to prevent redundant reconciles + + + +## [v0.2.7-alpha.6.3] - 2024-03-18 ## [v0.2.7-alpha.6.2] - 2024-03-18 @@ -440,7 +449,8 @@ - Merge pull request [#24](https://github.com/robolaunch/robot-operator/issues/24) from robolaunch/23-allow-multiple-launches -[Unreleased]: https://github.com/robolaunch/robot-operator/compare/v0.2.7-alpha.6.2...HEAD +[Unreleased]: https://github.com/robolaunch/robot-operator/compare/v0.2.7-alpha.6.3...HEAD +[v0.2.7-alpha.6.3]: https://github.com/robolaunch/robot-operator/compare/v0.2.7-alpha.6.2...v0.2.7-alpha.6.3 [v0.2.7-alpha.6.2]: https://github.com/robolaunch/robot-operator/compare/v0.2.7-alpha.6...v0.2.7-alpha.6.2 [v0.2.7-alpha.6]: https://github.com/robolaunch/robot-operator/compare/v0.2.7-alpha.4...v0.2.7-alpha.6 [v0.2.7-alpha.4]: https://github.com/robolaunch/robot-operator/compare/v0.2.7-alpha.1...v0.2.7-alpha.4 diff --git a/config/manager/kustomization.yaml b/config/manager/kustomization.yaml index fbffece1..93ed51b4 100644 --- a/config/manager/kustomization.yaml +++ b/config/manager/kustomization.yaml @@ -5,4 +5,4 @@ kind: Kustomization images: - name: controller newName: robolaunchio/robot-controller-manager - newTag: v0.2.7-alpha.6.3 + newTag: v0.2.7-alpha.6.4 diff --git a/docs/_coverpage.md b/docs/_coverpage.md index 693ee0cb..5bbf68b0 100644 --- a/docs/_coverpage.md +++ b/docs/_coverpage.md @@ -4,6 +4,6 @@ ![](https://raw.githubusercontent.com/robolaunch/trademark/main/logos/svg/rocket.svg) -# Robot Operator 0.2.7-alpha.6.3 +# Robot Operator 0.2.7-alpha.6.4 robolaunch Kubernetes Robot Operator manages lifecycle of ROS 2 based robots and enables defining, deploying and distributing robots declaratively. \ No newline at end of file diff --git a/hack/deploy/chart/robot-operator/Chart.yaml b/hack/deploy/chart/robot-operator/Chart.yaml index 066d3d39..723fe091 100644 --- a/hack/deploy/chart/robot-operator/Chart.yaml +++ b/hack/deploy/chart/robot-operator/Chart.yaml @@ -13,9 +13,9 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.2.7-alpha.6.3 +version: 0.2.7-alpha.6.4 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. -appVersion: "v0.2.7-alpha.6.3" +appVersion: "v0.2.7-alpha.6.4" diff --git a/hack/deploy/chart/robot-operator/templates/codeeditor-crd.yaml b/hack/deploy/chart/robot-operator/templates/codeeditor-crd.yaml index c9e2afcc..524f8f0c 100644 --- a/hack/deploy/chart/robot-operator/templates/codeeditor-crd.yaml +++ b/hack/deploy/chart/robot-operator/templates/codeeditor-crd.yaml @@ -1773,6 +1773,9 @@ spec: - name type: object type: array + ingress: + description: CodeEditor will create an Ingress resource if `true`. + type: boolean port: default: 9000 description: Port that code editor will use inside the container. @@ -1789,6 +1792,9 @@ spec: - ClusterIP - NodePort type: string + tlsSecretName: + description: Name of the TLS secret for ingress resource. + type: string version: default: 4.22.0 description: App version of the code editor. @@ -2338,6 +2344,55 @@ spec: type: string type: object type: array + ingressStatus: + description: Status of CodeEditor Ingress. + properties: + created: + description: Shows if the owned resource is created. + type: boolean + phase: + description: Phase of the owned resource. + type: string + reference: + description: Reference to the owned resource. + properties: + apiVersion: + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of + an entire object, this string should contain a valid JSON/Go + field access statement, such as desiredState.manifest.containers[2]. + For example, if the object reference is to a container within + a pod, this would take on a value like: "spec.containers{name}" + (where "name" refers to the name of the container that triggered + the event) or if no container name is specified "spec.containers[2]" + (container with index 2 in this pod). This syntax is chosen + only to have some well-defined way of referencing a part of + an object. TODO: this design is not final and this field is + subject to change in the future.' + type: string + kind: + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference + is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' + type: string + uid: + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' + type: string + type: object + x-kubernetes-map-type: atomic + required: + - created + type: object phase: description: Phase of CodeEditor. It sums the general status of code editor. @@ -2547,6 +2602,9 @@ spec: description: Connection URL. type: object type: object + workloadUpdateNeeded: + description: Field to indicate if the workload should be restarted. + type: boolean type: object type: object served: true diff --git a/hack/deploy/chart/robot-operator/templates/edgeproxy-crd.yaml b/hack/deploy/chart/robot-operator/templates/edgeproxy-crd.yaml new file mode 100644 index 00000000..77ef8c0f --- /dev/null +++ b/hack/deploy/chart/robot-operator/templates/edgeproxy-crd.yaml @@ -0,0 +1,51 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + name: edgeproxies.robot.roboscale.io + annotations: + controller-gen.kubebuilder.io/version: v0.9.2 + labels: + {{- include "robot-operator.labels" . | nindent 4 }} +spec: + group: robot.roboscale.io + names: + kind: EdgeProxy + listKind: EdgeProxyList + plural: edgeproxies + singular: edgeproxy + scope: Namespaced + versions: + - name: v1alpha2 + schema: + openAPIV3Schema: + description: EdgeProxy is the Schema for the edgeproxies API. + properties: + apiVersion: + 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 + kind: + 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 + metadata: + type: object + spec: + description: EdgeProxySpec defines the desired state of EdgeProxy. + type: object + status: + description: EdgeProxyStatus defines the observed state of EdgeProxy. + type: object + type: object + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: [] + storedVersions: [] \ No newline at end of file diff --git a/hack/deploy/chart/robot-operator/templates/manager-rbac.yaml b/hack/deploy/chart/robot-operator/templates/manager-rbac.yaml index 229cbd65..9f8b840b 100644 --- a/hack/deploy/chart/robot-operator/templates/manager-rbac.yaml +++ b/hack/deploy/chart/robot-operator/templates/manager-rbac.yaml @@ -53,6 +53,18 @@ rules: - patch - update - watch +- apiGroups: + - "" + resources: + - events + verbs: + - create + - delete + - get + - list + - patch + - update + - watch - apiGroups: - "" resources: @@ -251,6 +263,32 @@ rules: - get - patch - update +- apiGroups: + - robot.roboscale.io + resources: + - edgeproxies + verbs: + - create + - delete + - get + - list + - patch + - update + - watch +- apiGroups: + - robot.roboscale.io + resources: + - edgeproxies/finalizers + verbs: + - update +- apiGroups: + - robot.roboscale.io + resources: + - edgeproxies/status + verbs: + - get + - patch + - update - apiGroups: - robot.roboscale.io resources: diff --git a/hack/deploy/chart/robot-operator/templates/mutating-webhook-configuration.yaml b/hack/deploy/chart/robot-operator/templates/mutating-webhook-configuration.yaml index 7871774e..a1313986 100644 --- a/hack/deploy/chart/robot-operator/templates/mutating-webhook-configuration.yaml +++ b/hack/deploy/chart/robot-operator/templates/mutating-webhook-configuration.yaml @@ -246,4 +246,24 @@ webhooks: - UPDATE resources: - codeeditors + sideEffects: None +- admissionReviewVersions: + - v1 + clientConfig: + service: + name: '{{ include "robot-operator.fullname" . }}-webhook-service' + namespace: '{{ .Release.Namespace }}' + path: /mutate-robot-roboscale-io-v1alpha2-edgeproxy + failurePolicy: Fail + name: medgeproxy.kb.io + rules: + - apiGroups: + - robot.roboscale.io + apiVersions: + - v1alpha2 + operations: + - CREATE + - UPDATE + resources: + - edgeproxies sideEffects: None \ No newline at end of file diff --git a/hack/deploy/chart/robot-operator/templates/validating-webhook-configuration.yaml b/hack/deploy/chart/robot-operator/templates/validating-webhook-configuration.yaml index 08c678b5..d3915e59 100644 --- a/hack/deploy/chart/robot-operator/templates/validating-webhook-configuration.yaml +++ b/hack/deploy/chart/robot-operator/templates/validating-webhook-configuration.yaml @@ -246,4 +246,24 @@ webhooks: - UPDATE resources: - codeeditors + sideEffects: None +- admissionReviewVersions: + - v1 + clientConfig: + service: + name: '{{ include "robot-operator.fullname" . }}-webhook-service' + namespace: '{{ .Release.Namespace }}' + path: /validate-robot-roboscale-io-v1alpha2-edgeproxy + failurePolicy: Fail + name: vedgeproxy.kb.io + rules: + - apiGroups: + - robot.roboscale.io + apiVersions: + - v1alpha2 + operations: + - CREATE + - UPDATE + resources: + - edgeproxies sideEffects: None \ No newline at end of file diff --git a/hack/deploy/chart/robot-operator/values.yaml b/hack/deploy/chart/robot-operator/values.yaml index ca2bca55..165f9cea 100644 --- a/hack/deploy/chart/robot-operator/values.yaml +++ b/hack/deploy/chart/robot-operator/values.yaml @@ -32,7 +32,7 @@ controllerManager: - ALL image: repository: robolaunchio/robot-controller-manager - tag: v0.2.7-alpha.6.3 + tag: v0.2.7-alpha.6.4 resources: limits: cpu: 500m diff --git a/hack/deploy/manifests/robot_operator.yaml b/hack/deploy/manifests/robot_operator.yaml index 0b7d5fdd..d95ed0ea 100644 --- a/hack/deploy/manifests/robot_operator.yaml +++ b/hack/deploy/manifests/robot_operator.yaml @@ -1510,6 +1510,9 @@ spec: - name type: object type: array + ingress: + description: CodeEditor will create an Ingress resource if `true`. + type: boolean port: default: 9000 description: Port that code editor will use inside the container. @@ -1525,6 +1528,9 @@ spec: - ClusterIP - NodePort type: string + tlsSecretName: + description: Name of the TLS secret for ingress resource. + type: string version: default: 4.22.0 description: App version of the code editor. @@ -1927,6 +1933,44 @@ spec: type: string type: object type: array + ingressStatus: + description: Status of CodeEditor Ingress. + properties: + created: + description: Shows if the owned resource is created. + type: boolean + phase: + description: Phase of the owned resource. + type: string + reference: + description: Reference to the owned resource. + properties: + apiVersion: + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' + type: string + kind: + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' + type: string + uid: + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' + type: string + type: object + x-kubernetes-map-type: atomic + required: + - created + type: object phase: description: Phase of CodeEditor. It sums the general status of code editor. type: string @@ -2083,6 +2127,9 @@ spec: description: Connection URL. type: object type: object + workloadUpdateNeeded: + description: Field to indicate if the workload should be restarted. + type: boolean type: object type: object served: true @@ -2382,6 +2429,47 @@ spec: --- apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.9.2 + creationTimestamp: null + name: edgeproxies.robot.roboscale.io +spec: + group: robot.roboscale.io + names: + kind: EdgeProxy + listKind: EdgeProxyList + plural: edgeproxies + singular: edgeproxy + scope: Namespaced + versions: + - name: v1alpha2 + schema: + openAPIV3Schema: + description: EdgeProxy is the Schema for the edgeproxies API. + properties: + apiVersion: + 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 + kind: + 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 + metadata: + type: object + spec: + description: EdgeProxySpec defines the desired state of EdgeProxy. + type: object + status: + description: EdgeProxyStatus defines the observed state of EdgeProxy. + type: object + type: object + served: true + storage: true + subresources: + status: {} +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition metadata: annotations: cert-manager.io/inject-ca-from: robot-system/robot-serving-cert @@ -10596,6 +10684,18 @@ rules: - patch - update - watch + - apiGroups: + - "" + resources: + - events + verbs: + - create + - delete + - get + - list + - patch + - update + - watch - apiGroups: - "" resources: @@ -10794,6 +10894,32 @@ rules: - get - patch - update + - apiGroups: + - robot.roboscale.io + resources: + - edgeproxies + verbs: + - create + - delete + - get + - list + - patch + - update + - watch + - apiGroups: + - robot.roboscale.io + resources: + - edgeproxies/finalizers + verbs: + - update + - apiGroups: + - robot.roboscale.io + resources: + - edgeproxies/status + verbs: + - get + - patch + - update - apiGroups: - robot.roboscale.io resources: @@ -11323,7 +11449,7 @@ spec: - --leader-elect command: - /manager - image: robolaunchio/robot-controller-manager:v0.2.7-alpha.6.3 + image: robolaunchio/robot-controller-manager:v0.2.7-alpha.6.4 livenessProbe: httpGet: path: /healthz @@ -11663,6 +11789,26 @@ webhooks: resources: - codeeditors sideEffects: None + - admissionReviewVersions: + - v1 + clientConfig: + service: + name: robot-webhook-service + namespace: robot-system + path: /mutate-robot-roboscale-io-v1alpha2-edgeproxy + failurePolicy: Fail + name: medgeproxy.kb.io + rules: + - apiGroups: + - robot.roboscale.io + apiVersions: + - v1alpha2 + operations: + - CREATE + - UPDATE + resources: + - edgeproxies + sideEffects: None --- apiVersion: admissionregistration.k8s.io/v1 kind: ValidatingWebhookConfiguration @@ -11918,3 +12064,23 @@ webhooks: resources: - codeeditors sideEffects: None + - admissionReviewVersions: + - v1 + clientConfig: + service: + name: robot-webhook-service + namespace: robot-system + path: /validate-robot-roboscale-io-v1alpha2-edgeproxy + failurePolicy: Fail + name: vedgeproxy.kb.io + rules: + - apiGroups: + - robot.roboscale.io + apiVersions: + - v1alpha2 + operations: + - CREATE + - UPDATE + resources: + - edgeproxies + sideEffects: None From 933c5b23a4ccb7a6cf1e2bb3434eaa89a1cb4e4b Mon Sep 17 00:00:00 2001 From: tunahanertekin Date: Thu, 21 Mar 2024 10:19:10 +0300 Subject: [PATCH 5/5] docs(reference): update reference docs --- docs/reference_v1alpha2/README.md | 151 +++++++++++++++++- .../reference-gen-config.yaml | 2 + 2 files changed, 151 insertions(+), 2 deletions(-) diff --git a/docs/reference_v1alpha2/README.md b/docs/reference_v1alpha2/README.md index cc9b2818..5377cd57 100644 --- a/docs/reference_v1alpha2/README.md +++ b/docs/reference_v1alpha2/README.md @@ -7,6 +7,8 @@ Package v1alpha2 contains API Schema definitions for the robot v1alpha2 API grou ### Resource Types - [ROS2Workload](#ros2workload) +- [CodeEditor](#codeeditor) +- [EdgeProxy](#edgeproxy) - [ROS2Bridge](#ros2bridge) @@ -42,7 +44,7 @@ _Appears in:_ | `discoveryServerTemplate` _[DiscoveryServerSpec](#discoveryserverspec)_ | Discovery server configurational parameters. | | `ros2BridgeTemplate` _[ROS2BridgeSpec](#ros2bridgespec)_ | ROS 2 Bridge configurational parameters. | | `volumeClaimTemplates` _[PersistentVolumeClaimTemplate](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.22/#persistentvolumeclaimtemplate-v1-core) array_ | Volume templates for ROS 2 workload. For each volume template, operator will create a PersistentVolumeClaim that can be mounted to the ROS 2 workload. | -| `containers` _[LaunchContainer](#launchcontainer) array_ | Configurational parameters for containers that will be encapsulated within the ROS 2 workload StatefulSet. | +| `launchContainers` _[LaunchContainer](#launchcontainer) array_ | Configurational parameters for containers that will be encapsulated within the ROS 2 workload StatefulSet. | #### ROS2WorkloadStatus @@ -63,6 +65,86 @@ _Appears in:_ | `statefulSetStatuses` _[OwnedStatefulSetStatus](#ownedstatefulsetstatus) array_ | Status of owned StatefulSet and containers. | +#### CodeEditor + + + +CodeEditor is the Schema for the codeeditors API + + + +| Field | Description | +| --- | --- | +| `apiVersion` _string_ | `robot.roboscale.io/v1alpha2` +| `kind` _string_ | `CodeEditor` +| `metadata` _[ObjectMeta](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.22/#objectmeta-v1-meta)_ | Refer to Kubernetes API documentation for fields of `metadata`. | +| `spec` _[CodeEditorSpec](#codeeditorspec)_ | Specification of the desired behavior of the CodeEditor. | +| `status` _[CodeEditorStatus](#codeeditorstatus)_ | Most recently observed status of the CodeEditor. | + + +#### CodeEditorSpec + + + +CodeEditorSpec defines the desired state of CodeEditor. + +_Appears in:_ +- [CodeEditor](#codeeditor) + +| Field | Description | +| --- | --- | +| `version` _string_ | App version of the code editor. | +| `remote` _boolean_ | If `true`, code editor will be consumed remotely. | +| `container` _[CodeEditorContainer](#codeeditorcontainer)_ | Configurational parameters for code editor container. | +| `port` _integer_ | Port that code editor will use inside the container. | +| `serviceType` _[ServiceType](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.22/#servicetype-v1-core)_ | Service type of CodeEditor. `ClusterIP` and `NodePort` is supported. | +| `ingress` _boolean_ | CodeEditor will create an Ingress resource if `true`. | +| `tlsSecretName` _string_ | Name of the TLS secret for ingress resource. | +| `volumeClaimTemplates` _[PersistentVolumeClaimTemplate](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.22/#persistentvolumeclaimtemplate-v1-core) array_ | Volume templates for ROS 2 workload. For each volume template, operator will create a PersistentVolumeClaim that can be mounted to the ROS 2 workload. | +| `externalVolumes` _[Volume](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.22/#volume-v1-core) array_ | External volumes. | + + +#### CodeEditorStatus + + + +CodeEditorStatus defines the observed state of CodeEditor. + +_Appears in:_ +- [CodeEditor](#codeeditor) + +| Field | Description | +| --- | --- | +| `phase` _CodeEditorPhase_ | Phase of CodeEditor. It sums the general status of code editor. | +| `pvcStatuses` _[OwnedPVCStatus](#ownedpvcstatus) array_ | Statuses of owned PersistentVolumeClaims. | +| `externalVolumeStatuses` _[ExternalVolumeStatus](#externalvolumestatus) array_ | Statuses of external volumes. | +| `deploymentStatus` _[OwnedDeploymentStatus](#owneddeploymentstatus)_ | Status of code editor deployment. | +| `serviceStatus` _[OwnedServiceStatus](#ownedservicestatus)_ | Status of code editor service. | +| `ingressStatus` _[OwnedResourceStatus](#ownedresourcestatus)_ | Status of CodeEditor Ingress. | +| `workloadUpdateNeeded` _boolean_ | Field to indicate if the workload should be restarted. | + + +#### EdgeProxy + + + +EdgeProxy is the Schema for the edgeproxies API. + + + +| Field | Description | +| --- | --- | +| `apiVersion` _string_ | `robot.roboscale.io/v1alpha2` +| `kind` _string_ | `EdgeProxy` +| `metadata` _[ObjectMeta](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.22/#objectmeta-v1-meta)_ | Refer to Kubernetes API documentation for fields of `metadata`. | +| `spec` _[EdgeProxySpec](#edgeproxyspec)_ | | +| `status` _[EdgeProxyStatus](#edgeproxystatus)_ | | + + + + + + #### ROS2Bridge @@ -118,6 +200,36 @@ _Appears in:_ | `ingressStatus` _[OwnedResourceStatus](#ownedresourcestatus)_ | Status of ROS2Bridge Ingress. | +#### CodeEditorContainer + + + + + +_Appears in:_ +- [CodeEditorSpec](#codeeditorspec) + +| Field | Description | +| --- | --- | +| `securityContext` _[SecurityContext](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.22/#securitycontext-v1-core)_ | Security context of the code editor container. | +| `volumeMounts` _[VolumeMount](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.22/#volumemount-v1-core) array_ | Mounted volumes of the code editor container. | + + +#### ExternalVolumeStatus + + + + + +_Appears in:_ +- [CodeEditorStatus](#codeeditorstatus) + +| Field | Description | +| --- | --- | +| `name` _string_ | Name of the external volume. | +| `exists` _boolean_ | Indicates if the volume exists. | + + #### LaunchContainer @@ -133,6 +245,22 @@ _Appears in:_ | `container` _[Container](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.22/#container-v1-core)_ | Single container configuration for stateful set. | +#### OwnedDeploymentStatus + + + + + +_Appears in:_ +- [CodeEditorStatus](#codeeditorstatus) + +| Field | Description | +| --- | --- | +| `resource` _[OwnedResourceStatus](#ownedresourcestatus)_ | Generic status for any owned resource. | +| `status` _[DeploymentStatus](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.22/#deploymentstatus-v1-apps)_ | Status of the Deployment. | +| `containerStatuses` _[ContainerStatus](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.22/#containerstatus-v1-core) array_ | Container statuses. | + + #### OwnedPVCStatus @@ -140,6 +268,7 @@ _Appears in:_ _Appears in:_ +- [CodeEditorStatus](#codeeditorstatus) - [ROS2WorkloadStatus](#ros2workloadstatus) | Field | Description | @@ -155,7 +284,10 @@ _Appears in:_ Generic status for any owned resource. _Appears in:_ +- [CodeEditorStatus](#codeeditorstatus) +- [OwnedDeploymentStatus](#owneddeploymentstatus) - [OwnedPVCStatus](#ownedpvcstatus) +- [OwnedServiceStatus](#ownedservicestatus) - [OwnedStatefulSetStatus](#ownedstatefulsetstatus) - [ROS2BridgeInstanceStatus](#ros2bridgeinstancestatus) @@ -166,6 +298,21 @@ _Appears in:_ | `phase` _string_ | Phase of the owned resource. | +#### OwnedServiceStatus + + + + + +_Appears in:_ +- [CodeEditorStatus](#codeeditorstatus) + +| Field | Description | +| --- | --- | +| `resource` _[OwnedResourceStatus](#ownedresourcestatus)_ | Generic status for any owned resource. | +| `urls` _object (keys:string, values:string)_ | Connection URL. | + + #### OwnedStatefulSetStatus @@ -178,7 +325,7 @@ _Appears in:_ | Field | Description | | --- | --- | | `resource` _[OwnedResourceStatus](#ownedresourcestatus)_ | Generic status for any owned resource. | -| `status` _[StatefulSetStatus](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.22/#statefulsetstatus-v1-apps)_ | Status of the ROS2Bridge instance. | +| `status` _[StatefulSetStatus](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.22/#statefulsetstatus-v1-apps)_ | Status of the StatefulSet. | | `containerStatuses` _[ContainerStatus](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.22/#containerstatus-v1-core) array_ | Container statuses. | diff --git a/docs/reference_v1alpha2/reference-gen-config.yaml b/docs/reference_v1alpha2/reference-gen-config.yaml index 7d4821f0..c4043137 100644 --- a/docs/reference_v1alpha2/reference-gen-config.yaml +++ b/docs/reference_v1alpha2/reference-gen-config.yaml @@ -3,6 +3,8 @@ processor: - "List$" sortKinds: - "ROS2Workload" + - "CodeEditor" + - "EdgeProxy" - "ROS2Bridge" ignoreFields: - "TypeMeta$"