Giter VIP home page Giter VIP logo

helm-project-operator's Introduction

helm-project-operator

The Helm Project Operator is a generic design for a Kubernetes Operator that acts on ProjectHelmChart CRs.

Note: this project is not intended for standalone use.

It is intended to be implemented by a Project Operator (e.g. rancher/prometheus-federator) but provides a common definition for all Project Operators to use in order to support deploy specific, pre-bundled Helm charts (tied to a unique registered spec.helmApiVersion associated with the operator) across all project namespaces detected by this operator.

Getting Started

For more information, see the Getting Started guide.

Developing

Which branch do I make changes on?

Helm Project Operator is built and released off the contents of the main branch. To make a contribution, open up a PR to the main branch.

For more information, see the Developing guide.

Design

Helm Project Operator is built on top of k3s-io/helm-controller and rancher/helm-locker. For more information on the design of the underlying components, please see the README.md on their respective repositories.

For an example of how Helm Project Operator can be implemented, please see rancher/prometheus-federator.

For more information in general, please see docs/design.md.

Building

make

Running

./bin/helm-project-operator

License

Copyright (c) 2020 Rancher Labs, Inc.

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.

helm-project-operator's People

Contributors

aiyengar2 avatar geethub97 avatar github-actions[bot] avatar macedogm avatar renovate-rancher[bot] avatar superseb avatar

Stargazers

 avatar  avatar  avatar

Watchers

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

helm-project-operator's Issues

More information on the status of the underlying HelmCharts and HelmReleases should be accessible by Project Owners

Is your feature request related to a problem? Please describe.

Currently, if there's an issue with a HelmChart or HelmRelease, a user will generally have to engage a Cluster Admin who has permissions to be able to ascertain what the issue with the underlying Helm release might be. However, it would be useful if the status of the Helm Release (including / specifically the Helm Job's logs, which would show what the error is) are accessible by a Project Owner or Project Member as well.

Describe the solution you'd like

Unclear; would love user feedback on this issue with examples of use cases and suggestions!

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Can't scale up Operator

I installed Helm Project Operator with the provided Helm chart. With handle 20-30+ projects the Operator needs many recources, died with Oomkilled, and has not the right performance. The idea was to scale up the deployment, but the replicaset is hard coded to 1. This should be configurable, also to get more availability.

cattle-helm-system namespace job gets created in a loop

Note: cross-posted from https://github.com/aiyengar2/helm-project-operator/issues/2 on behalf of @ronhorton


this is in an rke2 ec2 downstream cluster

a. Click magnifying glass (search) in top menu

b. enter 'helm' in search field
c. select 'ProjectHemlCharts'
d. click Create from YAML
e. add name: demo
f. add namespace: cattle-project-p-ID from test-project namespace
g. add spec.helmapiversion: dummy.cattle.io/v1alpha1
h. click Create
i. Navigate to Workload > Jobs

expected: one job runs

actual result: job keeps getting created and added to the cattle-helm-namespace
Screen Shot 2022-04-21 at 3 41 32 PM

Controller that creates registration namespaces should be capable of being disabled and deployed standalone

Is your feature request related to a problem? Please describe.

Currently, every Helm Project Operator is forced to deploy both the controller that manages ProjectHelmCharts and the controller that manages hardening namespaces + creating project registration namespace all at once.

However, for users who want to configure multiple Helm Project Operators, they may want the definition of how Project Registration Namespaces are created and managed (i.e. hardenedNamespace.*, otherSystemProjectLabelValues, global.cattle.systemProjectId, global.cattle.projectLabel) to be managed independently of the configuration of the actual Helm Project Operator (e.g. valuesOverride, releaseRoleBindings.*, projectReleaseNamespaces.labelValues) to avoid multiple operators from trying to apply conflicting configurations.

Describe the solution you'd like

There should be a logical separation of controllers that are deployed such that they attempt to acquire locks independently and can be deployed standalone of each other.

Describe alternatives you've considered

Additional context

This would probably require a minor release since it's a major change in the way that the controllers are currently constructed that might require more rigorous QA and better understanding of how this would affect the user experience.

NetworkPolicies should be created in Project Release Namespaces targeting Project Namespaces

Is your feature request related to a problem? Please describe.

Currently, Helm Project Operator assumes that it is deployed into a Rancher environment and assumes that the Project Release Namespaces are all in the System Project, which ensures that if Project Network Isolation is turned on (and Network Policies are used) that the Release Namespace is already configured to allow Pods to reach out into all namespaces (not just Project namespaces) since that's how all system project namespaces are configured.

However, in case a Rancher user would like to place the Project Release Namespaces outside the System project (e.g. to be able to set resource quotas across a dedicated release project) and is in this type of setup, since the Project Release namespaces are deployed with a default network policy allowing no ingress or egress, any action that requires reaching across to project namespaces (e.g. scraping custom metric workloads) will not be allowed.

Describe the solution you'd like

The Helm Chart should automatically create Network Policies allowing pods in the Project Release Namespace to reach out to all pods in any Project Namespace; these network policies should be configurable on a chart level.

Describe alternatives you've considered

Additional context

Network Policies should be created in Project Release Namespaces to allow access to pods in Project Namespaces

Is your feature request related to a problem? Please describe.

Currently, Helm Project Operator assumes that it is deployed into a Rancher environment and assumes that the Project Release Namespaces are all in the System Project, which ensures that if Project Network Isolation is turned on (and Network Policies are used) that the Release Namespace is already configured to allow Pods to reach out into all namespaces (not just Project namespaces) since that's how all system project namespaces are configured.

However, in case a Rancher user would like to place the Project Release Namespaces outside the System project (e.g. to be able to set resource quotas across a dedicated release project) and is in this type of setup, since the Project Release namespaces are deployed with a default network policy allowing no ingress or egress, any action that requires reaching across to project namespaces (e.g. scraping custom metric workloads) will not be allowed.

Describe the solution you'd like

The Helm Chart should automatically create Network Policies allowing pods in the Project Release Namespace to reach out to all pods in any Project Namespace; these network policies should be configurable on a chart level.

Describe alternatives you've considered

Additional context

Add support for Windows builds to repository and Helm chart

Should modify drone builds and Helm chart to be able to support deploying the locker on Windows nodes to avoid the Linux-only requirement; should be easily possible since it just involves packaging a Go binary in an image.

Note: this does not have a high ROI since Windows clusters generally have Linux nodes that can run these controllers on them, but it would be nice to have if possible

Adding an entry to otherSystemProjectLabelValues in the Helm chart does not modify the status of the ProjectHelmChart left behind in that project's registration namespace

Describe the bug

If a project ID is added to otherSystemProjectLabelValues during a Helm upgrade, any ProjectHelmChart that is already deployed in that project's registration namespace will be left with a status of "Deployed" even though the underlying HelmChart and HelmRelease will be cleaned up.

To Reproduce

  1. Deploy Helm Project Operator (ensure that both project-label and system-project-label-value are provided; if using a Rancher 2.6.5+ setup, this should already be the case)
  2. Add a ProjectHelmChart to the registration namespace of a Project that you plan to ignore, e.g. one named DoNotMonitorMe
  3. Upgrade the Helm Project Operator chart to add the project ID of the project that you plan to ignore (e.g. p-XXXX) to the list of .Values.otherSystemProjectLabelValues

Result
HelmChart and HelmRelease tied to that ProjectHelmChart will be cleaned up, but the status will not be changed.

Expected Result

ProjectHelmChart status should either become empty, take on a newly defined status like CannotDeployInSystemProject, or take on the existing status of UnableToCreateHelmRelease on being targeted within a system project.

Screenshots

Additional context

Allow multiple Helm Project Operators targeting the same ProjectHelmChart

Follow the changes added in rancher/helm-locker@34be7c6 in order to introduce a managedBy annotation that will allow Helm Project Operators to claim ProjectHelmCharts that they are managing based on the Helm chart's release name.

This will allow a single Project Operator (e.g. prometheus-federator) to be deployed multiple times in the same cluster under different names (e.g. org-a-federator, org-b-federator, etc.) instead of forcing a single Project Operator to manage all Projects in the cluster.

This should be done alongside adding support for specifying an allow-list of Project IDs, which would allow the operators to configure a logical separation of which namespaces they operate on.

Helm Job Image should still be overridden if Helm Controller is disabled

- --helm-job-image={{ template "system_default_registry" . }}{{ .Values.helmController.job.image.repository }}:{{ .Values.helmController.job.image.tag }}

Even if the embedded helm controller is disabled, the Helm Job Image should still be overridden to ensure that the image deployed into the HelmChart CR by a Helm Project Operator contains private registry details.

Currently, this means that an airgapped RKE2 cluster will not have this image overridden on deployment by the operator

`Values.global.imagePullSecrets` is broken

Supplying .Values.global.imagePullSecrets is broken since arbitrary keys being added after imagePullSecrets are defined:

arvindiyengar: ~/Rancher/helm-project-operator/src/github.com/aiyengar2/helm-project-operator 
$ helm template --set 'global.imagePullSecrets[0].name=mySecret' helm-project-operator charts/helm-project-operator | kubeconform --strict
stdin - ServiceAccount helm-project-operator is invalid: For field imagePullSecrets.0: Additional property chart is not allowed - For field imagePullSecrets.0: Additional property heritage is not allowed - For field imagePullSecrets.0: Additional property release is not allowed - For field imagePullSecrets.0: Additional property app.kubernetes.io/instance is not allowed - For field imagePullSecrets.0: Additional property app.kubernetes.io/managed-by is not allowed - For field imagePullSecrets.0: Additional property app.kubernetes.io/part-of is not allowed - For field imagePullSecrets.0: Additional property app.kubernetes.io/version is not allowed

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.