Comments (5)
A PR would be greatly appreciated; I have no knowledge of how to upgrade scaffolding created from an older version of the Operator SDK.
from helm-app-operator-kit.
@joelanford We might tweak the templates and the CLI slightly in the coming days but you should be able to use it to scaffold a new controller-runtime based project.
Since we don't have a migration strategy figured out right now I would suggest doing a clean start.
$ mv helm-app-operator helm-app-operator-old
$ operator-sdk new helm-app-operator
$ operator-sdk add api --api-version=app.example.com/v1alpha1 --kind=HelmApp
$ operator-sdk add controller --api-version=app.example.com/v1alpha1 --kind=HelmApp
However that would only get you started with a typical controller that watches and reconciles for that exact APIVersion and Kind resource.
I have to take a closer look at how the helm-app-operator works but I think it's significantly different.
The sdk.Watch() can dynamically watch for any apiversion and kind as the helm-operator currently does:
resource := os.Getenv(APIVersionEnvVar)
kind := os.Getenv(KindEnvVar)
sdk.Watch(resource, kind, namespace, resyncPeriod)
However the default controller generated above would watch for that specific kind:
err = c.Watch(&source.Kind{Type: &appv1alpha1.HelmApp{}}, &handler.EnqueueRequestForObject{})
if err != nil {
return err
}
I haven't tried it out myself yet but I think the controller runtime should support watching a type dynamically using Unstructured objects controller-runtime #101:
helmApp := &unstructured.Unstructured{}
helmApp.SetGroupVersionKind(schema.GroupVersionKind{
Group: <group from APIVersion env var>,
Version: <version from APIVersion env var>,
Kind: <kind from Kind env var>,
})
err = c.Watch(&source.Kind{Type: helmApp}, &handler.EnqueueRequestForObject{})
if err != nil {
return err
}
And then the reconcile for the controller would be the same as the ansible-operator where you'd lookup the correct unstructured object(by setting its gvk) from the cache.
https://github.com/operator-framework/operator-sdk/blob/master/pkg/ansible/controller/reconcile.go#L47-L49
Of course this will affect #41 as well. I'll need to take a closer look at the helm-operator to give this some more thought.
from helm-app-operator-kit.
That makes sense to me and is the path I'm going down. I've got an initial version working that also covers #41. As it turns out, it may just be easier to fold those together into the same PR, which should be coming this afternoon.
I anticipate there will be more changes and tweaks, but I figured it would be easier if we have something concrete to discuss.
from helm-app-operator-kit.
I've fixed a few minor issues in PR #43. I believe it is now ready for review.
I attempted to organize the pkg/helm
package similarly to the pkg/ansible
package in operator-sdk
to make it easy to pull into operator-sdk
when we're ready. As a result, I think the PR is bigger than it necessarily has to be. If it makes more sense, I can reorganize with a focus on minimizing changes.
from helm-app-operator-kit.
This issue is closed by PRs #45, #46, and #47
from helm-app-operator-kit.
Related Issues (20)
- Error when using a local Helm chart directory
- Operator pod error when new cr created. HOT 1
- Helm install failed. Forbidden: User system:serviceaccount:ndn-base:default HOT 2
- How to override the values in the chart ? HOT 3
- Chart with multiple dependencies with `requirements.yaml` not deploying all the pods HOT 9
- "chart metadata (Chart.yaml) missing" when deploying custom resource HOT 2
- Read config file to support multiple charts simultaneously HOT 1
- Ensure logging is consistent with operator-sdk
- Release name lacks sufficient uniqueness HOT 1
- Add e2e tests for helm operator HOT 1
- Log what resources are created in K8s HOT 6
- Need to add license headers to the helm-app-operator files. HOT 1
- Need to update log and error message casing to conform to SDK standard. HOT 1
- Publish a Docker Image to Public Registry HOT 2
- Operator only sets status when the reconciler succeeds. HOT 6
- OwnerRefEngine output is non-deterministic HOT 1
- How to raise logs level of operator HOT 1
- Charts with randomly generated fields that are part of pod annotations fail to be installed (e.g. stable/redis) HOT 2
- seperate chart data from generic operator HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from helm-app-operator-kit.