-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add kubernetes-based backend #250
Conversation
3b48776
to
9e015ec
Compare
Codecov Report
@@ Coverage Diff @@
## main #250 +/- ##
====================================
- Coverage 39% 37% -2%
====================================
Files 37 41 +4
Lines 2424 3007 +583
====================================
+ Hits 948 1133 +185
- Misses 1413 1784 +371
- Partials 63 90 +27
Continue to review full report at Codecov.
|
9e015ec
to
7ac0299
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good. Had a few questions and suggestions.
867dc93
to
4282254
Compare
@micahhausler can we wait until tinkerbell/tink#258 is merged to get this in? I'd be a ok with doing the actual rebase and handling the changes necessary. Having to rebase tinkerbell/tink#258 is quite the pain. |
Sure, thats fine with me. I'd like to get this in soon though, maybe by Friday this week? |
I'm here to make good on my promise @micahhausler want me to rebase and fixup? |
@mmlb I'm good to do it, thanks though! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks @micahhausler , just two small requests
oh, also would you be able to provide some really basic instructions for use? maybe just how (or that its needed) to generate the crds from the tink repo and apply them to a cluster? or a link maybe to a guide for deploying Tink server/controller? |
cmd/boots/main.go
Outdated
@@ -220,15 +225,17 @@ func main() { | |||
} | |||
} | |||
|
|||
// getWorkflowFinder returns a no-op workflow finder if tinkerbell is not the backend | |||
func getWorkflowFinder() (client.WorkflowFinder, error) { | |||
// getWorkflowFinder returns a no-op workflow finder if tinkerbell or kubernetes is not the backend |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm I think standalone should be allowed too right @jacobweinstock ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah yes. seems like standalone should be in there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How does that apply? Standalone doesn't have a Tinkerbell backend right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
standalone only applies to the hardware fetcher, workflows can still happen with standalone.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With which Tinkerbell data model? Tink on K8s or Tink on postgres?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For backwards compatibility, I'll use Tink on Postgres. We'll have to figure how to transition this later
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if standalone should also imply workflows from json too 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jacobweinstock I take it you use standalone w/ workflows, thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i use standalone mainly for testing, this seems fine regardless.
I'm going to hold of on E2E instructions for now, and do comprehensive documentation for all the components once the Hegel changes get in |
Looks like a rebase of main is needed. |
d490b4a
to
8002dce
Compare
var wf client.WorkflowFinder = &client.NoOpWorkflowFinder{} | ||
var err error | ||
|
||
switch os.Getenv("DATA_MODEL_VERSION") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have we a 'todo' somewhere, or on someones list, to figure out wiring of configuration in Boots generally?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Created tinkerbell/boots#618
@@ -351,6 +370,8 @@ func newCLI(cfg *config, fs *flag.FlagSet) *ffcli.Command { | |||
fs.StringVar(&cfg.dhcpAddr, "dhcp-addr", conf.BOOTPBind, "IP and port to listen on for DHCP.") | |||
fs.StringVar(&cfg.syslogAddr, "syslog-addr", conf.SyslogBind, "IP and port to listen on for syslog messages.") | |||
fs.StringVar(&cfg.extraKernelArgs, "extra-kernel-args", "", "Extra set of kernel args (k=v k=v) that are appended to the kernel cmdline when booting via iPXE.") | |||
fs.StringVar(&cfg.kubeconfig, "kubeconfig", "", "The Kubernetes config file location. Only applies if DATA_MODEL_VERSION=kubernetes.") | |||
fs.StringVar(&cfg.kubeAPI, "kubernetes", "", "The Kubernetes API URL, used for in-cluster client construction. Only applies if DATA_MODEL_VERSION=kubernetes.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is different to Tink and Hegel. I think Tink and Hegel use --kubernetes-api
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I'll update tink to use --kubernetes
to match the upstream argument names
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gotcha. I'll do the same on Hegel.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated tinkerbell/tink#619 with reasons
lgtm |
client/kubernetes/cluster.go
Outdated
func init() { | ||
_ = clientgoscheme.AddToScheme(runtimescheme) | ||
_ = v1alpha1.AddToScheme(runtimescheme) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we're trying to minimize init()s
can this be done some other way? sync.Once.Do() in NewCluster maybe?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Signed-off-by: Micah Hausler <mhausler@amazon.com>
4d162dd
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉
Signed-off-by: Micah Hausler mhausler@amazon.com
Description
The new backend uses the Kubernetes CRD types in Tinkerbell core. Boots could use a bit of a refactor/organization in how the backends work, but for now I've tried to fit in to the existing structure.
Why is this needed
This is the boots side of work for tinkerbell/proposals#46
Fixes: #
How Has This Been Tested?
Tested with real bare metal workers using an image built from this branch. I will add E2E tests in a follow up PR, or can add to this branch
How are existing users impacted? What migration steps/scripts do we need?
No impact to existing users
Checklist:
I have: