Kubeconfig per invocation

Aperta
#586 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
35/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
kubernetes, ruby
Ambito
cli, devops

Direzione di ricerca

Start by tracing how krane invokes kubectl and selects the kubeconfig context; the issue specifically discusses repeated kubectl get loads and per-invocation kubeconfig data. Confirm the behavior and performance impact, then define completion as each invocation using only its required cluster, context, and user without changing deployment behavior.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Idea

It's necessarily true that each invocation of our tool only needs one of the clusters/contexts/users in the kubeconfig. If we constructed a tempfile containing only the information we actually need we could eliminate the sharing of this dependency between invocations (which is aesthetically nice--we don't mutate it of course!), guarantee we could only be using the right context, and reduce the size of the file kubectl repeatedly loads (see below).

For performance?

tl;dr Unlikely to help Shopify, unsure if it would help others

Last year, I did a bit of performance work on this gem using a watch command I didn't end up merging. One thing I found out was that kubectl get itself was a major contributor to sync cycle slowness at the time. I also discovered that kubectl versions < 1.14 have a bug where the kubeconfig is loaded repeatedly, which reported has severe performance implications if the file is large and/or the cluster has large numbers of resources. The maintainers refused to backport the fix. The number of times it is reloaded apparently scales up with the number of resources being retrieved, which we can't do much about. However, reducing the file size also helps, according the the bug report, and we do have control over that.

I believe I confirmed that we were affected at the time, but it was a long time ago and fell off my mental radar until recently. Today, on a Shipit instance (because a comment on the bug report suggests it may only affect linux), I did a get pods targeting one of our most populated clusters, and it only loaded the kubeconfig 4 times. So no quick win for us after all. It might still help others though.

Lingua principale
Ruby
Stelle
1.4k
Fork
119
Merge medio
1h 7m
PR unite (30g)
1

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di Shopify/krane

Tutte le issue di Shopify/krane

Issue simili

Altre issue su Ruby

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.