-
Notifications
You must be signed in to change notification settings - Fork 8
🎄🎅 A kubectl-gs deploy Christmas Carol
#1796
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
base: main
Are you sure you want to change the base?
Conversation
|
Theo and I talked about this PR. I would prefer if the functionality added in this PR would become a separate CLI tool, for two main reasons: Once we recommend HelmRelase and OCIRepository (instead of App CR etc.) as a deployment method to customers, we would like to offer a command for deploying apps that serve customer's needs first and foremost., as a replacement for The current implementation is targeting Giant Swarm staff. The use case is quite specific: deploying an alternative (dev) version of an application to a management cluster (what |
|
Any recommendation for a good CLI name for this ? |
I reckon we already have a CLI tool for GS-specific actions, right? Although it's supposed to be deprecated |
|
What about kubectl gs deploy apps|helmrelease? That should give us enough leeway for the future? |
deploy |
|
Are we looking for a name for a tool that does only the deploy thing, or for something that could become a giantswarm staff swiss army CLI? |
|
I think the idea here is to have a specific tool for deployment. I think we are not too keen on having another swiss army CLI like opsctl. |
🎄 A kubectl-gs Christmas Carol 🎄
⭐ The Tale of the Deploy Command ⭐
'Twas the night before release, and all through the cluster, 🌙
Not a pod was deploying—the team in a fluster. 😰
The manifests were scattered in Git with despair, 📜
In hopes that a solution would soon appear there. ✨
Young Dev sat at her terminal, coffee grown cold, ☕
Wrestling with Flux reconciliation, growing quite old. 👵
"I just want to test this app version!" she cried, 😭
"But Flux keeps reverting—my hands are all tied!" 🤝
When out from the kubectl there arose such a clatter, 🔊
She ran
kubectl gs --helpto see what was the matter. 🤔And what to her wondering eyes did appear, 👀
But a new
deploycommand—oh, Christmas cheer! 🎅🎉👻 Chapter 1: The Ghost of Deployments Past 🕰️
"Listen well," spoke the command in its help text so bright, 💡
"I'll show you the magic of deployment done right!" ✨🪄
"With just this one line, I'll suspend Flux's hold, ⏸️
Deploy your test version—be daring, be bold! 🦁
No more editing YAMLs in thirty-two places, 📝
No more kubectl patches with syntax disgraces!" 🙈
Dev's eyes lit up brightly, her heart filled with glee, 🤩
"But what of config repos?" asked she curiously. 🤷♀️
🎁 Chapter 2: The Ghost of Configuration Present 🎀
The deploy command smiled, its flags all aglow: 🚩✨
"Config repos too! Switch branches with ease, 🌿
Test your configurations, do as you please! 😌
I'll patch your GitRepository, set the branch right, ⚙️
Suspend reconciliation—it's a wonderful sight!" 🌟
"But wait!" Dev exclaimed, "What if things go awry? 😱
What if my test fails and I need to say goodbye?" 👋
🔮 Chapter 3: The Ghost of Deployments Future 🚀
"Fear not!" said the command, with a wink of its flag: 😉🚩
"I'll wait till your app is all Ready and true, ✅
Then stand guard and watch over your testing for you. 💂
When you're done with your work and you signal goodbye, 👋
I'll restore what once was—like magic, I fly! 🪄✨
Your cluster pristine, as if nothing occurred, 🧹
Not a trace of the test—on my honor, my word!" 🤞
"And there's more!" it continued with holiday cheer: 🎊
kubectl gs deploy -d -i # Or for configs: kubectl gs deploy -d -i -t config"Interactive mode! A TUI so neat! 🖥️
Browse apps, configs, and versions—take a seat! 🪑
For apps or configs, I work just the same, 🎯
Select what you need with a fuzzy-search game!" 🎮
⏰ Chapter 4: The Magic of Patience ⌛
Dev leaned in closer, "But how do you know? 🧐
When pods are all ready, when flux has let go?" 🤔
The command just smiled with a knowing delight: 😊
"I trigger Flux reconciliation, watch till it's through, 👁️
Then show you the status—all tailored for you! 🎨
No more
kubectl waitor anxious refresh, 😓I'll handle the watching while you stay fresh. 🌿
When everything's ready, I'll let you know, 📢
Then guard your deployment till you're ready to go!" 🚦
🎅 Chapter 5: The List Before Christmas 📝
"How do I know what's deployed?" Dev inquired with grace, 💁♀️
"What apps are suspended? What's the cluster's current state?" 🤷♀️
"I'll show you it all!" the command did declare, 📣
"What's ready, what's not, what needs your care! 🩺
Apps from the catalog, versions galore, 📚
Config PRs from GitHub—and so much more! 🎁
With
ghCLI magic, I'll fetch every PR, 🪄Show branches and titles—both near and far!" 🌍
🎶 Chapter 6: The Undeploy Carol 🔄
"And when you are finished," the command sang out: 🎵
"Just undeploy! I'll remove my annotation hold, 🏷️
Let Flux take back over, as the story is told. 📖
Your cluster returns to its GitOps-managed state, ♻️
No manual cleanup—isn't that great?" 🎉
🌅 Epilogue: Christmas Morning ☀️
Dev sat back in wonder, her coffee now warm, ☕✨
She'd mastered deployment through snow, sleet, and storm. ❄️⛈️
No more YAML wrestling, no more Git commit strife, 🤼
The deploy command brought joy to her DevOps life! 😊💖
She deployed with
-d, she undeployed with-u, 🔄She listed with
-lall the apps that she knew. 📋She went interactive when the names wouldn't come, 🎮
And tested her configs with branches—how fun! 🎢
The command would wait till her apps were all Ready, ⏰✅
Then guard her deployments so patient and steady. 🛡️
When testing was done with a Ctrl+C press, ⌨️
It cleaned up behind her—no trace, no mess! 🧽✨
"Happy deploying to all!" she exclaimed with delight, 🎊
"And to all my dear colleagues—ship code left and right!" 🚢💻
🎁 The Moral of the Story 🎁
The
kubectl gs deploycommand brings you: 🎉🎄 Easy app deployments - Deploy any version from your catalog 📦
🎁 Config repo switching - Test different branches/PRs without GitOps fights 🥊
⭐ Interactive mode - Select apps, configs, and versions with a beautiful TUI 🖥️
🔔 Automatic cleanup - Press Ctrl+C and everything's restored 🧹
🎅 Patient waiting - Watches reconciliation so you don't have to ⏰
❄️ Status checking - See what's deployed and what's suspended 🔍
🤶 List everything - Apps, versions, configs, catalogs, and GitHub PRs 📋
May your deployments be merry and your rollbacks be few! 🎊🎉
🧦 Quick Reference Card (Stuff Your Stocking!) 🎁
The End 🎄✨🎅🎁⭐
A little word from the human.
It all started with a
deploy.shthat I have been using in order to have a simple way to deploy changes for testing purposes. I mainly needed to deploy app or config (ccr repos) changes. This implied a sophisticated dance of labeling resources, changing versions, catalog, and the same but slightly different process for config repos. I also wanted a one line to restore the state once I am done with my testing. This command does all of that in one go.Yes it's a very large PR and was 99% vibe coded, and well I got carried away, but yet I think it's a useful tool to have.
Screenshots 📷