Comments (19)
oh, that's great! I'm keen to see your approach. Also feel free to open a "WIP" PR to start a discussion even if it's not ready to be merged...
from bonny.
@danhawkins We need to provide the CRD in its new format, including the spec yes. open_api_spex
is used for creating APIs, no? Can you elaborate in how this lib could help us? Also have a look at the discussions in #9.
@FreedomBen your last post sounded so promising! What happened?
from bonny.
yup. Closed yours ;)
Edit: as mine also addresses some other problems.
from bonny.
For people looking for a solution, the generated CRD should work now (since version 0.5.2), once you have added the following entry to your config.exs
:
config :bonny,
api_version: "apiextensions.k8s.io/v1"
from bonny.
Hey @FreedomBen, did you get amywhere with this?
from bonny.
@mruoss yes! My operator got re-prioritized for a couple of sprints due to unexpected important stuff, but I'm back on it as of yesterday. I've got most of the work done now, I'm just testing. Unless something unexpected happens, I think I'll have it ready for PR by the end of the week. If things went really well (which rarely happens to me in software lol) it might be ready for PR this evening (US timezone).
Do you need it now?
from bonny.
Getting very close 🤞
from bonny.
I'm currently stuck with this issue using later version of k8s, the manifest generated will not work, we need to provide the open api spec right? What about using something like https://github.com/open-api-spex/open_api_spex
from bonny.
Any updates here? I'm also stuck in my Operator :(
from bonny.
Hmm... it looks like Cory had already implemented something. Can anyone test this? What happens if you add this to your config.exs:
config :bonny,
api_version: "apiextensions.k8s.io/v1"
Edit: See #101
from bonny.
It would be nice ot there was a way to actually define the openapi schema...
from bonny.
When use this option generated file use api_version specified in configuration.
But without the proper schema we still can't apply the resources in kubernetes:
minikube start
😄 minikube v1.26.1 on Debian 11.0
✨ Using the docker driver based on existing profile
👍 Starting control plane node minikube in cluster minikube
🚜 Pulling base image ...
🔄 Restarting existing docker container for "minikube" ...
🐳 Preparing Kubernetes v1.24.3 on Docker 20.10.17 ...
🔎 Verifying Kubernetes components...
▪ Using image gcr.io/k8s-minikube/storage-provisioner:v5
🌟 Enabled addons: storage-provisioner, default-storageclass
❗ /usr/local/bin/kubectl is version 1.21.3, which may have incompatibilites with Kubernetes 1.24.3.
▪ Want kubectl v1.24.3? Try 'minikube kubectl -- get pods -A'
🏄 Done! kubectl is now configured to use "minikube" cluster and "default" namespace by default
sleipnir @ pop-os spawn main
└─ $ (k8s: minikube) 🚀 ▶ make apply-k8s-manifests
kubectl -n eigr-functions apply -f apps/operator/manifest.yaml
deployment.apps/eigr-functions configured
error: error validating "apps/operator/manifest.yaml": error validating data: [ValidationError(CustomResourceDefinition.spec.versions[0]): unknown field "scheme" in io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.CustomResourceDefinitionVersion, ValidationError(CustomResourceDefinition.spec.versions[0]): missing required field "served" in io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.CustomResourceDefinitionVersion, ValidationError(CustomResourceDefinition.spec.versions[0]): missing required field "storage" in io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.CustomResourceDefinitionVersion]; if you choose to ignore these errors, turn validation off with --validate=false
make: *** [Makefile:81: apply-k8s-manifests] Error 1
Yaml generated:
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
labels:
eigr_functions_protocol_major_version: '0'
eigr_functions_protocol_minor_version: '1'
proxy_name: spawn
k8s-app: eigr-functions-controller
name: actorsystems.spawn.eigr.io
spec:
group: spawn.eigr.io
names:
kind: ActorSystem
plural: actorsystems
shortNames:
- as
- actorsys
- actorsystem
- actorsystems
- system
singular: actorsystem
scope: Cluster
versions:
- name: v1
scheme:
openAPIV3Scheme:
additionalPrinterColumns:
- description: Storage type of the Actor System
jsonPath: .spec.storage.type
name: storage
type: string
- description: |-
CreationTimestamp is a timestamp representing the server time when this object was created. It is not guaranteed to be set in happens-before order across separate operations. Clients may not set this value. It is represented in RFC3339 form and is in UTC.
Populated by the system. Read-only. Null for lists. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
jsonPath: .metadata.creationTimestamp
name: Age
type: date
from bonny.
Oh boy... seems like typos in #101. What if you manually change
scheme
toschema
openAPIV3Scheme
toopenAPIV3Schema
No... still not... additionalPrinterColumns
should not be part of the schema... this looks all wrong (still)
from bonny.
Oh boy... seems like typos in #101. What if you manually change
* `scheme` to `schema` * `openAPIV3Scheme` to `openAPIV3Schema`
No... still not...
additionalPrinterColumns
should not be part of the schema... this looks all wrong (still)
from bonny.
These are the mistakes now:
Error from server (Invalid): error when creating "apps/operator/manifest.yaml": CustomResourceDefinition.apiextensions.k8s.io "activators.spawn.eigr.io" is invalid: [spec.versions: Invalid value: []apiextensions.CustomResourceDefinitionVersion{apiextensions.CustomResourceDefinitionVersion{Name:"v1", Served:false, Storage:false, Deprecated:false, DeprecationWarning:(*string)(nil), Schema:(*apiextensions.CustomResourceValidation)(nil), Subresources:(*apiextensions.CustomResourceSubresources)(nil), AdditionalPrinterColumns:[]apiextensions.CustomResourceColumnDefinition(nil)}}: must have exactly one version marked as storage version, spec.validation.openAPIV3Schema.type: Required value: must not be empty at the root, status.storedVersions: Invalid value: []string(nil): must have at least one stored version]
Error from server (Invalid): error when creating "apps/operator/manifest.yaml": CustomResourceDefinition.apiextensions.k8s.io "actornodes.spawn.eigr.io" is invalid: [spec.versions: Invalid value: []apiextensions.CustomResourceDefinitionVersion{apiextensions.CustomResourceDefinitionVersion{Name:"v1", Served:false, Storage:false, Deprecated:false, DeprecationWarning:(*string)(nil), Schema:(*apiextensions.CustomResourceValidation)(nil), Subresources:(*apiextensions.CustomResourceSubresources)(nil), AdditionalPrinterColumns:[]apiextensions.CustomResourceColumnDefinition(nil)}}: must have exactly one version marked as storage version, spec.validation.openAPIV3Schema.type: Required value: must not be empty at the root, status.storedVersions: Invalid value: []string(nil): must have at least one stored version]
Error from server (Invalid): error when creating "apps/operator/manifest.yaml": CustomResourceDefinition.apiextensions.k8s.io "actorsystems.spawn.eigr.io" is invalid: [spec.versions: Invalid value: []apiextensions.CustomResourceDefinitionVersion{apiextensions.CustomResourceDefinitionVersion{Name:"v1", Served:false, Storage:false, Deprecated:false, DeprecationWarning:(*string)(nil), Schema:(*apiextensions.CustomResourceValidation)(nil), Subresources:(*apiextensions.CustomResourceSubresources)(nil), AdditionalPrinterColumns:[]apiextensions.CustomResourceColumnDefinition(nil)}}: must have exactly one version marked as storage version, spec.validation.openAPIV3Schema.type: Required value: must not be empty at the root, status.storedVersions: Invalid value: []string(nil): must have at least one stored version]
from bonny.
Opened a pull request (#143) where I try to fix this. But we don't have integration tests here yet. Need to test that first.
from bonny.
I think we created a PR to fix the same thing :D #144
from bonny.
What do you mean exactly?
Ignore my previous comment. I had taken a test wrong
from bonny.
@mruoss The new version works accordingly. I think there's enough material to spawn a new version of bonny now wdyt?
sleipnir @ pop-os spawn main
└─ $ (k8s: minikube) 🚀 ▶ make apply-k8s-manifests
kubectl -n eigr-functions apply -f apps/operator/manifest.yaml --validate=false
deployment.apps/eigr-functions configured
customresourcedefinition.apiextensions.k8s.io/activators.spawn.eigr.io created
customresourcedefinition.apiextensions.k8s.io/actornodes.spawn.eigr.io created
customresourcedefinition.apiextensions.k8s.io/actorsystems.spawn.eigr.io created
clusterrole.rbac.authorization.k8s.io/eigr-functions unchanged
serviceaccount/eigr-functions unchanged
clusterrolebinding.rbac.authorization.k8s.io/eigr-functions unchanged
sleipnir @ pop-os spawn main
└─ $ (k8s: minikube) 🚀 ▶ make apply-k8s-manifests
kubectl -n eigr-functions apply -f apps/operator/manifest.yaml
deployment.apps/eigr-functions configured
customresourcedefinition.apiextensions.k8s.io/activators.spawn.eigr.io unchanged
customresourcedefinition.apiextensions.k8s.io/actornodes.spawn.eigr.io configured
customresourcedefinition.apiextensions.k8s.io/actorsystems.spawn.eigr.io unchanged
clusterrole.rbac.authorization.k8s.io/eigr-functions unchanged
serviceaccount/eigr-functions unchanged
clusterrolebinding.rbac.authorization.k8s.io/eigr-functions unchanged
sleipnir @ pop-os spawn main
└─ $ (k8s: minikube) 🚀 ▶ k get activators
No resources found
sleipnir @ pop-os spawn main
└─ $ (k8s: minikube) 🚀 ▶ k get actors
No resources found
sleipnir @ pop-os spawn main
└─ $ (k8s: minikube) 🚀 ▶ k get bla
error: the server doesn't have a resource type "bla"
sleipnir @ pop-os spawn main
└─ $ (k8s: minikube) 🚀 ▶
from bonny.
Related Issues (20)
- Operator does not create the resources HOT 12
- Reduce Code Generation HOT 2
- Error :cluster_not_registered HOT 1
- Error on create HPA resource HOT 7
- Missing priv folder in hex release 0.5.0 HOT 1
- cluster_name/0 is undefined HOT 4
- mix bonny.gen.manifest add an override callback
- Implement observedGeneration
- Multiple controllers handling same descendant kind HOT 7
- Initial test setup errors on application start. HOT 5
- An error is being thrown for deployments but not hpas. HOT 4
- Use strategic merge patch to add finalizers HOT 1
- Add multiple different resources with the same name in the pipeline for register_descendants
- Reconciled deletes don't seem to happen easily HOT 3
- Leader Election HOT 5
- Bonny Events throw without :operator_name in prod HOT 2
- Error with dependent resources HOT 7
- LeaderElector error on leader change HOT 2
- FIPS mode HOT 22
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 bonny.