I'm here to ask for a help. I want to create a custom controller for my custom resource and literally I have no idea how and from where to start, like from where golang script will run for controller and how my custom resource will be useful.
So, I need some help with how I can start and from where I should start.
Thanks in advance
Deepak
When using Go, the kubebuilder is a good start for creating Kubernetes controller and custom resource. The Kubebuilder online book is a good tutorial to follow, to learn the components of the controller and the kubebuilder SDK.
As Jonas suggested you can go for Kubebuilder or Operator SDK is also a good option.
i won't suggest writing the custom controller until it's not required as you have now to manage the code, versions etc.
Instead you checkout the existing controller or application like the Kubewatch, which also do the same job for you.
Kubewatch check the K8s events and based on that send the slack message.
Checkout my article : https://medium.com/#harsh.manvar111/kubernetes-event-notifications-1b2fb12a30ce
If you have a requirement to write custom code you can simple make own Deployment with client library, which will look for the event of K8s
Check out my Github repo : https://github.com/harsh4870/Slack-Post-On-POD-Ready-State
Which checks for the POD ready statement and sends the slack notification, you can re-write that python code to Go as per need.
Related
I am working on a GRANDstack (GraphQL-React-Apollo-Neo4jDatabase) project and got told that it now needs an additional REST-API without making huge changes to the existing backend and GraphQL-API. And of course we have to be quick about it.
We found this (Apollo Gateway): https://medium.com/tkssharma/an-api-gateway-is-a-microservice-pattern-where-a-separate-service-is-built-to-sit-in-front-of-your-be4b16861d40
We plan on using this to set that new REST-API on top because we know we will need microservices soon enough as well. So I guess, this can be set up in some form with the already included Apollo. But I have yet to fully understand it.
Does anyone have some experience with this? Or does anyone know a project that implements this and can be checked out? I'd like more material about this that contains actual code. Especially about setting up such a gateway to put a REST-API on top.
If there is something easier and better documented than this Apollo gateway, please let me know! Open to ideas, but not complete overkills (Though we are not allowed to just put REST directly into our backend, it has to stay quite untouched).
Thank you very much!
In short: Our current backend offers GraphQL-API which works just fine. But one of our customers (in this picture "client") needs a REST-API. So we hope on using a gateway (?) which should be placed before/upon our backend in a separate docker container probably, takes in HTTP-requests from the user and then asks our backend in graphQL for the needed data.
If anyone ever stumbles upon this, we decided to do the following:
Since we have to be quick about it, we will set up another docker container, that contains a small server, which accepts data via a REST-API. Depending on the received data, it calls specific GraphQL-Queries/Mutations on our backend. Easy. No additional 3rd-party software. Simple just wins.
Have a good one!
I am new to openbmc and trying to understand the basic details.
As I am checking docs, I found two docs, REST-cheatsheet.md & REDFISH-cheatsheet.md
They both are using the curl to get and set the entries in openbmc.
But, the path used is different.
REST-cheetsheet.md uses, xyz/openbmc_project as path but REDFISH-cheatsheet.md uses redfish/v1/ as path to get details.
If we get same details with both what exactly is the difference??
ALso I need to populate the /redfish/v1 details, how to do that??
Thank you in advance.
When OpenBMC first started, Redfish had fairly minimal industry buy-in so OpenBMC made a dection to make a custom REST API to manage itself. This is the "REST-cheatsheet". After a few years, Redfish via the DMTF began to mature and get a lot more industry buy-in. The decision was made within the OpenBMC community to deprecate the REST interfaces and move to being a Redfish managed system.
There's actually a commit up for review that would disable the REST based interface by default (https://gerrit.openbmc-project.xyz/c/openbmc/bmcweb/+/29344).
Try and utilize Redfish for any work you're doing, it's the direction of OpenBMC from an out of band management perspective.
Redfish is defined and secure.
The REST API is deprecated, mostly; just go with the future and that is Redfish.
I am new to web development, and the react/next/amplify ecosystem, but I have been playing around with it and it seems great. I am just having difficulties deploying my app. It seems to be an order of operations thing I might be doing wrong with the initial configuration, I am not sure.
So I followed the 5-minute tutorial on how to set Next.js up with aws-amplify using the git based deployment (so no amplify init), I then started to follow along with the todo tutorial for aws-amplify that I had previously completed, which included the aws-exports.js file. I could not deploy it because I was getting an import error for not being able to resolve ./aws-exports, which made sense because it wasn't there. I eventually performed a amplify init and had a copy, but found this is in the .gitignore file so it still failed when I tried to deploy. I took it out of my .gitignore just to see and voila a successful build.
This seemed wrong to me because why would it be in the .gitignore if it wasn't supposed to be?
I found this post that says the info is sensitive, but the documentation says otherwise.
This file is consumed by the Amplify JavaScript library for
configuration. It contains information which is non-sensitive and only
required for external, unauthenticated actions from clients (such as
user registration or sign-in flows in the case of Auth) or for
constructing appropriate endpoint URLs after authorization has taken
place.
So, can I leave this file out of the .gitignore? Is there a better way to do this? I experienced the same issue and solved it the same way deploying to Vercel, which may be my preferred deployment method bc of the easy lambda function integration (if that matters to the answer).
Thanks for any input.
Sorry for late to the party, I don't disagree with the doc which stated that aws-exports.js is non-sensitive, if you look into that file, it just bunch endpoints and nothing really enable you to "hack" into the system, unless you didn't config your #auth directive correctly. But I understand your concerns, and I don't like the style that endpoints are being exposed to clients in a single file, but they eventually will expose to user, either from the network tab or your code where you reference the endpoint.
A good reason that you should include aws-exports.js in your .gitignore is that you don't want to deal with conflicts in git, since this file will be auto-generated during build time.
If you using server-side rendering, seems like you are by using next.js, you can easily acchive only expose what is needed for client, I won't get into it as that's another topic.
I am looking for a way to discover a USB zstick "/dev/ttyACM0" using OpenHab command line interface as I am not going to be using a GUI and I need to create a script to automate few things.
In their website here and here OpenHab have some documentation, and that's what I found for discovery:
GET /discovery
POST /discovery/bindings/{bindingId}/scan
however I was unable to make that into a useful curl command. any idea on where to start?
I would suggest to try out the REST Documentation, for finding the right endpoint/expression.
You can install it through paper ui:
It will then be available through <YOUR_OH_IP>:<PORT>/doc/index.html.
It provides some ui with explanations and examples for the endpoints and you can test them live through it.
This should help you find the correct rest call to use with curl afterwards.
I don't know if adding devies through REST is possible. If so you can find it in the REST Documentation.
If it doesn't work though the REST API you might want to write a small bash script which adds the things you want. Then you can call your script with
executeCommandLine in a rule
I am developing a java web application to manage Alfresco users and tasks (create and assign tasks to users ..) using rest api , i couldn't add tasks with POST method as shown in this picture :
Can anyone please suggest how to handle this.
Thanks.
You're not calling the right method, this url only accepts GET.
You can use all theses methods : https://api-explorer.alfresco.com/api-explorer/#/tasks, but I don't see one permitting to create a task.
I think this is because creating a task is not logic.
Maybe what you want to do is to create a process : https://api-explorer.alfresco.com/api-explorer/#!/processes/createProcess
If you don't find what you need, you still have the option to create your own webscript https://docs.alfresco.com/5.2/tasks/ws-tutorials.html.
As #Akah said, it's not the right service, also, you can find all deployed services in your Alfresco instance with there descriptions on http://localhost:8081/alfresco/service/index/all