Giter Club home page Giter Club logo

yurt-edgex-manager's Introduction

Yurt-edgex-manager

IMPORTANT: yurt-edgex-manager has been merged into the openyurt repo, so project is no longer being actively maintained and has been archived.

Archived Project

This project has been archived and is no longer being actively maintained. This means you can view and copy the code, but cannot make changes or propose pull requests.

While you're here, feel free to review the code and learn from it. If you wish to use the code or revive the project, you can fork it to your own GitHub account.


Version License Go Report Card codecov

✨ What is yurt-edgex-manager

Yurt-edgex-manager is an OpenYurt component for EdgeX management. User now can install, upgrade, delete EdgeX in OpenYurt cluster by just manipulating EdgeX CR.

EdgeX

Overview

For details of the design, please see the device-management and edgex-integration

📣 Getting Started

The yurt-edgex-manager is design to work with yurt-device-controller, the whole documentation can be found there OpenYurt Tutorials

For people who want to develop and test yurt-edgex-manager alone can check Getting start.

🛩️ Contributing

Contributions are welcome, whether by creating new issues or pull requests. See our contributing document to get started.

✉️ Contact

📃 License

Yurt-edgex-manager is under the Apache 2.0 license. See the LICENSE file for details.

yurt-edgex-manager's People

Contributors

beiwei30 avatar gnunu avatar huiwq1990 avatar lavenderqaq avatar lindayu17 avatar lwmqwer avatar openyurt-bot avatar rambohe-ch avatar rui-gan avatar wangxye avatar xavier-hou avatar yangbobo6 avatar yixingjia avatar ytghost avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

yurt-edgex-manager's Issues

[Design] New edgex API

\kind design
The edge additional components config is too complex.
Propose replace with below API and set defaults for users as much as possible

apiVersion: device.openyurt.io/v1alpha1
kind: EdgeX
metadata:
  name: edgex-sample-beijing
  namespace: "beijing"
spec:
  version: jakarta
  poolname: beijing
  componets:
  - name: edgex-core-consul
     labels:
     - core: True
     - database: true
    image: openyurt/consul:1.10.3
    port: 8500
    mountPath: 
     - "/consul/config"
     - "/consul/data"
  - name: edgex-core-data
    image:  openyurt/core-data:2.1.0

multi edgex instance support

1)If I want to deploy multi edgex instaces in same namespace, yurt-edgex-manager generate solid uniteddeployments, like edgex-core-consul. Could we generate uniteddeployments with nodepool name as prefix?
2) Config crd edgex is too complex , if I want add a ui component, I need write complex yamls. As a demo below:

apiVersion: device.openyurt.io/v1alpha1
kind: EdgeX
metadata:
  name: edgex-sample-$WORKER_NODEPOOL
spec:
  version: hanoi
  poolname: $WORKER_NODEPOOL
  additinalservices:
  - metadata:
      name: edgex-device-virtual
    spec:
      type: NodePort
      selector:
        app: edgex-device-virtual
      ports:
      - name: http
        port: 49990
        protocol: TCP
        targetPort: 49990
        nodePort: 30090
  - metadata:
      name: edgex-device-rest
    spec:
      type: NodePort
      selector:
        app: edgex-device-rest
      ports:
      - name: http
        port: 49986
        protocol: TCP
        targetPort: 49986
  1. yurt-edgex-manager use EdgeXConfig as template, if deploy multi instances, error occur as below:
  Version:        jakarta
Status:
  Conditions:
    Last Transition Time:  2022-03-10T08:59:37Z
    Message:               Service "edgex-core-consul" is invalid: spec.ports[0].nodePort: Invalid value: 30850: provided port is already allocated
    Reason:                ServiceProvisioningFailed
    Severity:              Warning
    Status:                False
    Type:                  Ready
    Last Transition Time:  2022-03-10T08:59:37Z
    Status:                True
    Type:                  ConfigmapAvailable
    Last Transition Time:  2022-03-10T08:59:37Z
    Message:               Service "edgex-core-consul" is invalid: spec.ports[0].nodePort: Invalid value: 30850: provided port is already allocated
    Reason:                ServiceProvisioningFailed
    Severity:              Warning
    Status:                False
    Type:                  ServiceAvailable
  Initialized:             true

Could we use helm as template render, and user can custom select deploy which component and set component values.

Update the getting start document of yurt-edgex-manager

What would you like to be added:
Correctly deploy yurt-edgex-manager and modify the getting start document.

Why is this needed:
Some of the steps in the getting start documentation are currently unavailable. I have fixed kustomize in this issue #54 , but there will be some minor changes in usage. So we need to update our documentation and upgrade the yaml of yurt-edgex-manager.
By the way, please upgrade the yurt-app-manager in the documentation to v0.6.0

Separate the auto-collector into a separate repo

What would you like to be added:
We separated the auto-collector into a separate repo, but it still supports our work in another form.

Why is this needed:
It is more of a standalone tool than part of edgex-manager.

others
/kind enhancement

[feature request] enable local debugging

What would you like to be added:
start webhooks when starting the controller locally.

Why is this needed:
After v1alpha2 version is launched, conversion webhook will be started, but webhook is not enabled by default in the local debug code, which may be inconvenient for development. @Rui-Gan talked to me about this during development, because she is debugging our conversion webhook. When deployed internally in k8s, we would start job-patch to solve the certificate problem, which cannot be done locally. I feel it should be solved in makefile.

others
/kind feature

[feature request] Provide users with the ability to customize the edgex framework

What would you like to be added:
Now that we are able to support the latest version of edgex, we need to export the current configuration to configmap so that users can customize the framework according to their requirements.

Why is this needed:
Give advanced users the ability to DIY their own framework.

others
/kind feature

[EdgeX Auto-Collector] Upgrade apiVersion and deprecate additionalServices and additionalDeployments in new version

What would you like to be added:
We will modify the spec of yurt-edgex-manager at this stage. The previous additionalServices and additionalDeployments fields are not user-friendly. We need to change them to the components field and in the next step give the user an easier way to configure them.
We need to upgrade api version to v1alpha2

Why is this needed:
Refer to EdgeX Auto-colllector Proposal

others
/kind feature

[Feature] Edgex Field Camel Case

I think edgex field should named Camel Case.

type EdgeXStatus struct {

// EdgeXStatus defines the observed state of EdgeX
type EdgeXStatus struct {
	// +optional
	Ready bool `json:"ready,omitempty"`
	// +optional
	Initialized bool `json:"initialized,omitempty"`
	// +optional
	ServiceReplicas int32 `json:"servicereplicas,omitempty"`
	// +optional
	ServiceReadyReplicas int32 `json:"servicereadyreplicas,omitempty"`
	// +optional
	DeploymentReplicas int32 `json:"deploymentreplicas,omitempty"`
	// +optional
	DeploymentReadyReplicas int32 `json:"deploymentreadyreplicas,omitempty"`

	// Current Edgex state
	// +optional
	Conditions clusterv1.Conditions `json:"conditions,omitempty"`
}

[EdgeX Auto-Collector] Modify CRD to give users the option to deploy a secure or insecure version of edgex

What would you like to be added:
The crd needs to be modified so that the user has a field to choose which edgex to deploy. The function of identifying the component responsible for the security module is #66, so this issue will have to wait for that issue to complete. Note that changes to the crd require corresponding changes to the controller section of the code. So this issue also need to wait for #62.

Why is this needed:
Refer to EdgeX Auto-colllector Proposal

others
/kind feature

[BUG]yurt-hub container can't start when rejoin yurt cluster.

What happened:
yurt-hub container report follow error:
iptables v1.8.7 (legacy): Couldn't load target `NOTRACK':No such file or directory
when rejoin yurt cluster.

What you expected to happen:
yurt-hub container start successed.

How to reproduce it (as minimally and precisely as possible):
rejoin cluster, manual install Yurthub.

Anything else we need to know?:
hardware is arm64.

Environment:

  • OpenYurt version:
  • Kubernetes version (use kubectl version): v1.19.8
  • OS (e.g: cat /etc/os-release): Ubuntu 18.04.6 LTS (Bionic Beaver)
  • Kernel (e.g. uname -a):4.9.140-tegra
  • Install tools:
  • Others:

others

/kind bug

[EdgeX Auto-Collector] Optimize shell script for image synchronization

What would you like to be added:
Faster image synchronization scripts

Why is this needed:
Currently, the collector executes the script for synchronizing images in serial format, and does not perform tag check on the remote repo. In pr #76, I found that the script was running slowly because edgex required too many images. I tried to optimize a multi-process version for shell script myself, and ensure that the old tag is not pulled again.

others
/kind enhancement

[feature request] Write the v1alpha2 webhook and enable it

What would you like to be added:
Currently our edgex crd already supports v1alpha2 version, we need to enable v1alpha2 webhook.

  • Continue most of the functionality of the v1alpha1 webhook
  • v1alpha1 webhooks check edgex versions, but only hanoi and jakarta are supported, after we upgrade the version, the version currently supported by edgex will be stored in config.json. webhook needs to read all supported versions and determine if the version deployed by the user is supported by us.
  • Enable the new version of webhook in the main function and close the old version of webhook.

Why is this needed:
Ensure that the v1alpha2 information passed to controller is correct.

others
/kind feature

[feature request] support other IoT platforms similar to EdgeX

What would you like to be added:

yurt-iot-manager now supports only EdgeX Foundry, I wonder if we can add a concept of platform to indicate an IoT device management solutions like EdgeX Foundry and add some functionalities to help other IoT device management solutions to be integrated to OpenYurt

Why is this needed:
users can manage devices and process data generated by those devices in different IoT device management solutions through OpenYurt declarative device api.

others
Design proposal needed

/kind feature

Kubebuilder could not deploy yurt-edgex-manager with webhook

What happened:
After starting webhook, make deploy cannot be used correctly, causing a lot of inconvenience to development.

What you expected to happen:
As before, use make docker-build, make deploy and make undeploy to debug the program. Developers no longer need any environment variables.

How to reproduce it (as minimally and precisely as possible):
Helm uses hook to call oamdev/kube-webhook-certgen before manager starts. This job generates the certificate required by webhook and puts it in secret. We need to use kustomize to do this.

Other note:
I will try to solve the problem next week. In addition, since many developers currently use kind for local debugging, I will add a separate command make kind-deploy into the Makefile.

/kind bug

[BUG] Edgex READYDEPLOYMENT quantity in the case of multiple Edgex instance has a cascading effect

What happened:
all Edgex instance READYDEPLOYMENT quantity changed ,when new Edgex instance deploying:
image

What you expected to happen:

How to reproduce it (as minimally and precisely as possible):

Anything else we need to know?:

Environment:

  • OpenYurt version:
  • Kubernetes version (use kubectl version):
  • OS (e.g: cat /etc/os-release):
  • Kernel (e.g. uname -a):
  • Install tools:
  • Others:

others

/kind bug

[Feature Request]provide minimal set of components by default to reduce resource consumption

EdgeX Foundry has include several micro-services, some of which are not necessary by default. Since thelevski version, the inter-communication method changed from REST to message bus which lead to some more unnecessary components.

We hope that Iot-Manager could deploy a minimal set of necessary components by default to reduce resources consumption. Meanwhile, could allow users to customize add more optional components.

[EdgeX Auto-Collector] Identify the components responsible for security

What would you like to be added:
By looking at the structure of edgex-compose, we can find that each edgex version above hanoi is divided into safe and unsafe versions. The insecure version of edgex is a subset of the secure version. In other words, the secure version of edgex will add some components and configurations on the basis of the insecure version. For the added components, we can scan the component information by grabbing the docker-compose-<version>-no-secty.yml file to see which components are secure. For the added configuration, since the added environment variables do not have any effect on the running of the insecure version, we can ignore them.
Write the result to the IsSecurity field in Component

type Component struct {
	Name         string            `yaml:"name"`
	Image        string            `yaml:"image"`
	Volumes      []string          `yaml:"volumns,omitempty"`
	ComponentEnv map[string]string `yaml:"componentEnv,omitempty"`
	// TODO: We need to collect another no-security file and mark which components are not secure
	IsSecurity bool `yaml:"isSecurity"`
	// A pointer to the Env of the previous level
	envRef *map[string]string
}

Refer to Add a security switch

Why is this needed:
Refer to EdgeX Auto-colllector Proposal

others
/kind feature

[feature request] support edgex-foundry security components

need yurt-edgex support the following requirements:

  1. Vault:Secret creation, store and retrieve (password, cert, access key etc.)
  2. Kong:API gateway for other existing EdgeX microservice REST APIs
  3. Secure Consul:Enable ACL system by generating the Consul token via the integration of secret store management system Vault with Consul via Vault's Consul Secrets Engine APIs.

[BUG] Error occurs when deleting edgex in reconcileDelete function

What happened:
When the edgex object is deleted, the reconcileDelete function displays the following error:

1.6638252595946293e+09  ERROR   reconcile failed        {"controller": "edgex", "controllerGroup": "device.openyurt.io", "controllerKind": "EdgeX", "edgeX": {"name":"edgex-sample-beijing","namespace":"default"}, "namespace": "default", "name": "edgex-sample-beijing", "reconcileID": "aef8ad82-7670-4e01-894e-276cfb7a92c0", "edgex": "default/edgex-sample-beijing", "error": "edgexes.device.openyurt.io \"edgex-sample-beijing\" not found", "errorCauses": [{"error": "edgexes.device.openyurt.io \"edgex-sample-beijing\" not found", "errorCauses": [{"error": "edgexes.device.openyurt.io \"edgex-sample-beijing\" not found"}]}]}
github.com/openyurtio/yurt-edgex-manager/controllers.(*EdgeXReconciler).Reconcile
        /home/hanqi/yurt-edgex-manager/controllers/edgex_controller.go:129
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Reconcile
        /home/hanqi/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:121
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler
        /home/hanqi/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:320
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem
        /home/hanqi/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:273
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2.2

However, all pods can exit normally, and the functions of yurt-edgex-manager are not affected.

edgex-app-rules-engine-beijing-8kftr-745cd6d4ff-7mrq4        1/1     Terminating   0          19s
edgex-core-command-beijing-qrtzs-74dd6c4c75-rzwgb            1/1     Terminating   0          19s
edgex-core-data-beijing-r4ktw-6cf9645695-cqmr9               1/1     Terminating   0          19s
edgex-core-metadata-beijing-c2v5r-8497fc664-tmdw2            1/1     Terminating   0          18s
edgex-support-notifications-beijing-rm826-547b7c9774-kpqhg   1/1     Terminating   0          18s
edgex-support-scheduler-beijing-srdr2-84bfff55c9-84f4g       1/1     Terminating   0          19s
yurt-app-manager-789c97b55d-dw6qh                            1/1     Running       0          162m
yurt-app-manager-admission-create-4wdv6                      0/1     Completed     0          162m
yurt-app-manager-admission-patch-zl4q4                       0/1     Completed     1          162m

How to reproduce it (as minimally and precisely as possible):
Install the CRD and fire the Delete event.

Anything else we need to know?:
It is possible that this code triggered the error, but it is strange that the edgex object can only be not found after remove Finalizer.

func (r *EdgeXReconciler) reconcileDelete(ctx context.Context, edgex *devicev1alpha1.EdgeX) (ctrl.Result, error) {

	ud := &unitv1alpha1.YurtAppSet{}
	desiredeployments := append(CoreDeployment[edgex.Spec.Version], edgex.Spec.AdditionalDeployment...)
	for _, dd := range desiredeployments {

		if err := r.Get(
			ctx,
			types.NamespacedName{Namespace: edgex.Namespace, Name: dd.Name},
			ud); err != nil {
			continue
		}

		for i, pool := range ud.Spec.Topology.Pools {
			if pool.Name == edgex.Spec.PoolName {
				ud.Spec.Topology.Pools[i] = ud.Spec.Topology.Pools[len(ud.Spec.Topology.Pools)-1]
				ud.Spec.Topology.Pools = ud.Spec.Topology.Pools[:len(ud.Spec.Topology.Pools)-1]
			}
		}
		if err := r.Update(ctx, ud); err != nil {
			return ctrl.Result{}, err
		}
	}

	controllerutil.RemoveFinalizer(edgex, devicev1alpha1.EdgexFinalizer)

	return ctrl.Result{}, nil
}

Environment:

  • OpenYurt version: yurt-app-managerv0.6.0
  • Kubernetes version (use kubectl version): v1.23.11
  • OS (e.g: cat /etc/os-release): Ubuntu 20.04.4 LTS
  • Kernel (e.g. uname -a): 5.4.0-113-generic

others

/kind bug

[EdgeX Auto-Collector] EdgeX Auto-Collector verifying test

What would you like to be added:
Because the collection of edgex configuration information is automated, we need a process to verify its reliability. This program behaves like a simple e2e test. By launching this simple test we can ensure that the user is using the correct edgex configuration.
Refer to verifying test
This issue needs to be completed after #62 and #63

Why is this needed:
Refer to EdgeX Auto-colllector Proposal

others
/kind feature

[feature request] refactor yurt-edgex-manager to yurt-iot-manager

What would you like to be added:

  1. rename yurt-edgex-manager to yurt-iot-manager
  2. yurt-iot-manager will responsible for the deployment of yurt-device-controller

Why is this needed:

  1. yurt-iot-manager will responsible for the lifecycle of all the components within the IoT sig
  2. support more platforms like EdgeX Foundry in the near future

others
/kind feature

[EdgeX Auto-Collector] Synchronize the images of edgex to openyurt

What would you like to be added:
When we collect the edgex configuration, we need to pull the image according to the image field of each component and push it to the repo of openyurt.
All of the images have been collected in the Image field of Component. You may want to add a image synchronization feature to Version or Component and call it when appropriate.

Why is this needed:
Refer to EdgeX Auto-colllector Proposal

others
/kind feature

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.