r/kubernetes • • Oct 18 '25

It's GitOps or Git + Operations

Post image
1.1k Upvotes

98 comments sorted by

377

u/theelderbeever Oct 18 '25 edited Oct 18 '25

Edit in prod while you wait for the PR to get approved. Sometimes you just gotta put the fire out.

43

u/senaint Oct 18 '25

But then you gotta suspend drift detection, then re-enable it after the PR merge, there's just no clean win.

34

u/rlnrlnrln Oct 18 '25 edited Oct 18 '25

That's assuming you've actually been given access to do stuff in the GitOps platform.

/someone who faced this exact scenario last week, and saw 8h of downtime in Git because the only person with access was out, and ArgoCD was resetting my kubectl edits.

18

u/theelderbeever Oct 18 '25

Only one person with access to Argo? That's brutal... Pretty much everyone at our company has access... But we also don't have junior engineers.

Normally I just switch the Argo app to my fix branch but that still doesn't work in your case...

3

u/rlnrlnrln Oct 18 '25

More people have access, but this is the only guy in our team (we're going to get it, buut, it takes a long time for some reason).

Our git software is still in evaluation, so it's not that big of a deal, but I'm sure this could happen in prod. This organization is.... not very modern.

2

u/theelderbeever Oct 18 '25

I have definitely worked at those kinds of companies... My current one is trying to grow out of it's cowboy era...

1

u/snorktacular Oct 18 '25

Sounds like they're trying to hit a quota for downtime or something. Well if anyone gives you shit, just point to the postmortem where you have this access problem highlighted, bolded, and in all caps lol.

1

u/rlnrlnrln Oct 18 '25

I wish we did post mortems...

2

u/snorktacular Oct 18 '25

You can always start

7

u/bonesnapper k8s operator Oct 19 '25

If you have access to the k8s cluster with ArgoCd and you have cluster admin privileges, you can k edit the ArgoCd application object itself to stop auto sync; remove syncPolicy.automated. Then your k edit on the deployment won't get drift reconciled.

1

u/tsyklon_ k8s operator Nov 02 '25

Not quite, if the repo has a push webhook any stateful change will get overwritten the moment an event triggers.

2

u/[deleted] Oct 19 '25

Ah yes  the head architect-admin-onemanarmy-chief technical engineer who is the only one with prod access.

3

u/JPJackPott Oct 18 '25

kubectl -n delete deployment argocd-server

She’ll be right

4

u/vonhimmel Oct 18 '25

Scala it down and it should be fine.

1

u/Legal-Butterscotch-2 Oct 19 '25

if you have access to the cluster you can edit the application manifest and change the autosync with kubectl, but if you are capped, just cry

2

u/rlnrlnrln Oct 19 '25

just cry

I am. Publicly.

1

u/[deleted] Oct 19 '25

[removed] — view removed comment

6

u/Digging_Graves Oct 18 '25

Waiting for a pr to get approved at 2 am?

5

u/theelderbeever Oct 18 '25

Yes. To fix issues with the deployment via git ops.

1

u/tsyklon_ k8s operator Nov 02 '25

That's peak time for SRE activity as far I am concerned.

3

u/BloodyIron Oct 18 '25

There's a reason for processes. At 2am you're not the person to calculate the risk mitigations that were agreed upon as part of DR planning. You could cause a lot more problems with this attitude than just following the process.

6

u/theelderbeever Oct 18 '25

Sometimes I am the person to calculate that risk. And there aren't always processes that you can shift blame to. Reality doesn't always reflect the ideal

3

u/SilentLennie Oct 19 '25

Then the process needs a break glass solution so you can allow the deployment.

1

u/theelderbeever Oct 19 '25

You mean like editing the manifest or as in one of my other comments I mentioned pointing the Argo application at the PR branch?

1

u/SilentLennie Oct 19 '25

Personally, I would say: not have only a junior to night work and/or allow to do gitops without second approval.

But still keep going through git, not logging into any systems directly or making changes in Kubernetes directly.

And if really needed have some account locked away which can only be used in certain extreme situations.

1

u/tsyklon_ k8s operator Nov 02 '25

"The risk I took was calculated but man I am bad at math"

If you at the same time implemented a new process and didn't create an emergency lever in case this might have happened then you did not calculate risk sufficiently enough. This should be a postmortem.

2

u/Legal-Butterscotch-2 Oct 19 '25

that's the answer, I have some guys in my team (Seniors), that just wait for the git process while the sh1t is on fire and I say to them:

"Jesus, just solve the fire at the same time the pipeline is running, do the same fix direct in the deployment"

"But there is a process and the argo will remove my update"

"Just disable the fkng auto sync for a while and there is no IT process that is above a possible bankrupt"

(in my mind I'm saying: "what a dumbass")

1

u/HeadlessChild Oct 18 '25

And sometimes not?

1

u/CarIcy6146 Oct 19 '25

This is the way

1

u/pixel-pusher-coder Jan 14 '26

Edit on prod only to have argo undo all your changes. The choice is an illusion, there is only one button.

-5

u/_SDR Oct 18 '25

If you have direct access to prod you are doing it wrong.

8

u/theelderbeever Oct 18 '25

Or you have a very small team that hasn't had time to build in robust processes or have the staffing to have multiple people on call at the same time. 

Also not everything can be fixed without direct access. I had to manually delete database index files from a Scylla cluster and then restart it just to get the server live. Couldn't have done that without direct access. 

125

u/CeeMX Oct 18 '25

With Argocd set up to autoheal you can edit manually as often as you want, it will always go back

81

u/deejeycris Oct 18 '25

can you imagine if a junior, at 2am, didn't know that and kept wondering why changes would not apply lol, how to have a mental breakdown 101

23

u/Accurate-Sundae1744 Oct 18 '25

Who gives junior prod access and expect them to fix shit at 2am...

14

u/deejeycris Oct 18 '25

More companies than you imagine lol though probably not at 2am.

13

u/MaintenanceOwn5925 Oct 18 '25

Happened to the best of us fr

3

u/[deleted] Oct 18 '25

we have Flux in our clusters at work and I was experiencing this exact issue before learning how k8s actually works lmao

2

u/Go_Fast_1993 k8s operator Oct 18 '25

Especially bc the default latency is 3m. So you'd be able to see your kubectl changes deploy just to have alerts scream at you 3 minutes later.

0

u/[deleted] Oct 19 '25

[deleted]

1

u/Go_Fast_1993 k8s operator Oct 19 '25

You're right. I was thinking of the normal sync. My bad, been a minute since I configured an ArgoCD app.

0

u/[deleted] Oct 19 '25

[deleted]

1

u/deejeycris Oct 19 '25

^ way more scalable approach, but a bit more complex if you got server behind a proxy/vpn/whatever, so starting out with polling is also ok imo

1

u/BloodyIron Oct 18 '25

working as intended

1

u/mirisbowring Oct 19 '25

Lets ask chatgpt 1000x times and dont get a solution 🤣

6

u/buckypimpin Oct 18 '25

yea, i didnt get op's meme

do u really have gitops if anyone can just run kubectl edit

7

u/Namarot Oct 18 '25

Switch manual kubectl edit to patching on the argocd gui in this case.

3

u/CeeMX Oct 18 '25

Sure, but it will break again when turned back on

1

u/Sindef Oct 18 '25

Unless your application (or appset .etc) CR is Git managed too

-28

u/bigdickbenzema Oct 18 '25

argocd users are incessant walking ads

3

u/MichaelMach Oct 18 '25

It doesn't cost a dime.

2

u/CeeMX Oct 18 '25

Excuse me?

7

u/Nelmers Oct 18 '25

He’s not part of the cult yet. Give them time to see the light.

-6

u/rThoro Oct 18 '25

not true - argo is the worst in detecting manual changes

it's a decision from their side, but the annotation is used as the last applied state, even if the resource was changed!

41

u/[deleted] Oct 18 '25

as a principal SRE... if your junior SRE has access to kubectl in prod at 2am, that's what we'd call a process failure :)

kubectl access for prod should require a breakglass account. not something that's onerous to gain access to, but something that's monitored, has logging in place and requires a post-mortem after use.

that way you're going to think real hard about using it/can't do it out of naivete by accident, but still have easy access in case your system is FUBAR and you need kubectl to resolve instead of waiting on PR approvals.

14

u/guesswhochickenpoo Oct 18 '25 edited Oct 18 '25

Personally I think the process fails even way before the access stage. If the junior is even aware this is happening at 2 AM there is a massive breakdown in process. Only our senior engineers or sys admins are even notified outside of business hours. There is no communication chain that would ever reach the junior outside of work hours. DCO -> primary on call senior engineer or sys admin -> secondary or tertiary seniors.

23

u/[deleted] Oct 18 '25

I'm not sure if I agree or I don't, I don't think juniors should be immune from participating in IR, but you're right that if they are being paged at 2am I would expect them to be being paged at 2am alongside a senior mentor that they can learn from

(though on the other hand, 2am incident response is not exactly a peak learning opportunity)

7

u/guesswhochickenpoo Oct 18 '25 edited Oct 18 '25

Agreed on the learning part. I’m not saying juniors shouldn’t be involved at all but rather there’s no reason they should be directly contacted in the IR chain and in the kind of position this meme shows.

As you elude to a post mortem during normal business hours is a much better time to learn.

Edit. Strange to get downvotes. Are people seriously calling out directly to their junior's admins at 2 am without a senior in the chain?

1

u/jerslan Oct 20 '25

I think including the junior's in the IR call at 2AM is a good way for them to learn how those calls typically work, what happens in them (live, not after-action report), and even be able to provide input (a good mentor might ask them if they see the problem before telling them what it is).

2

u/[deleted] Oct 19 '25

Its best opportunity. Reliablity Engineering is not sunshine and bunnies.

3

u/therealkevinard Oct 18 '25 edited Oct 18 '25

I always put juniors in the room with support roles like Comms Lead. After a few, they start getting assigned Commander.

IR is the most valuable learning opportunity, and tbf i’d say it’s bad leadership to deprive them.

As CL, they’re obligated to pay attention to the discussions. This is where they learn the nuances of how components interact and the significance of dials and knobs after day one.
Without an IR, would you even know the implications of sql connection pool configs at horizontal scale? You’d see it in the docs and just keep moving to something interesting.

As IC, they learn how to have technical discussions from the Sr/Staff engs playing Tech Lead presenting the case for their decisions.
And the authority is good for morale/encouragement.

You can absolutely tell when a Mid has done this. They present clear architectural decisions and are confident defending those decisions to C-Suite if the CTO drops in a slack thread.

ETA: this is for formal incidents. On-call’s first ping is a Staff+, and there’s usually a mitigation. If at all possible, IR picks up in the morning during human hours.

2

u/guesswhochickenpoo Oct 18 '25

Poor wording on my part (see other comment that clarifies). My main point is that juniors shouldn't be the primary person in the IR chain and the one sweating over a keyboard like this. At least not without someone right next who's knows what they're doing.

1

u/therealkevinard Oct 18 '25

Oh yeah- that’s fair. No Solo.

2

u/matjam Oct 18 '25

We give people all the weapons but give them guidance on when to use them. And phone numbers to wake up people when not 100% sure.

https://youtu.be/cpFN2-xdCAo

Especially the part about trust.

1

u/cloudtransplant Oct 18 '25

Not for everything surely? That’s super restrictive if I can’t delete pods in prod without a postmortem. For doing heavier manual operations I agree

1

u/[deleted] Oct 18 '25 edited Oct 18 '25

We treat prod as (edit: generally) immutable. You need a breakglass account to go into prod. Otherwise everything goes through staging and is auto-promoted to prod and then reconciled.

all a breakglass account is, is a separate role in AWS that you can assume when logging into it (we use EKS). You have to specifically type `aws sso login` and then click the breakglass role.

3

u/cloudtransplant Oct 18 '25

I know what a breakglass role is. I’m not using that to delete a pod though. And deleting a pod does not make prod mutable. Pods can be deleted. Pods are ephemeral.

0

u/[deleted] Oct 18 '25

An administrator being able to mutate pods in prod makes prod mutable. We don't want prod to be mutable unless you explicitly opt into it, hence the breakglass.

There is a big difference between pods being reaped as part of a deployment/statefulset/whatever by K8s and a pod being modified by a human. We guard against the latter, not the former, in prod.

The difference between your normal role and the breakglass is one click of a different radio button in AWS. It's not super restrictive, and very easy to deal with. If that's too much for you, perhaps you should not be a K8s administrator at our organization. We would prefer people have to go out of their way with one click to modify things than accidentally do it.

To say nothing of the security benefits this isolation gains.

1

u/cloudtransplant Oct 18 '25

I’m bumping up against you saying that elevating your role to do something simple like do a manual rollout restart of a deployment requires a postmortem…. Not necessarily that it requires the elevation. It sounds overly restrictive to me, but I’d be curious the nature of your business. I feel like own company is pretty restrictive and even we have the ability to delete a pod. Certainly we can’t edit a deployment to change the hash or something.

2

u/[deleted] Oct 19 '25

[removed] — view removed comment

2

u/cloudtransplant Oct 19 '25

It sounds like a place where you have to be on call and yet have the most irritating blockades to ensure your incident response is as slow as possible. Compounded by people who couch that as being “secure” when it’s just a lack of trust in your on-call engineers

11

u/Vegetable-Put2432 Oct 18 '25

What's GitOps?

10

u/Sea_Mechanic815 Oct 18 '25

it is git+ operation which means the git ci will build the docker image and push to registory and here we will update the image using argocd or datatree which it will fetch autmatically without manually push or update. Mainly its focus on argocd which have plenty of positive.
https://argo-cd.readthedocs.io/en/stable read this docs.

9

u/nekokattt Oct 18 '25

it is just regular CI/CD but also putting your config in a git repo and having something either repeatedly poll it for changes or wait for you to ask it to apply (like flux, argocd, etc)

2

u/rusty735 Oct 18 '25

Yeah I feel like its 90% of a normal cicd pipeline, the upstream stuff.

Than instead of a declarative push to "prod" you publish your artifacts and or charts and the gitops polling picks it up and deploys it.

1

u/nekokattt Oct 18 '25

pretty much.

1

u/kkapelon Oct 20 '25

Disclaimer: I am a member of the Argo Team

GitOps is described here https://opengitops.dev/

What you describe is just half the story (the git -> cluster direction)

You are missing the automatic reconciliation (the self-heal flag in Argo CD). This capability is not part of regular CI/CD and it solves configuration drift once and for all.

1

u/baronas15 Oct 18 '25

When your ops are done through git+ci

2

u/maziarczykk Oct 18 '25

"Junior SRE", good one.

2

u/zerocoldx911 Oct 18 '25

You guys actually wake up? Lol

2

u/Appropriate_Spring81 Oct 19 '25

Mitigate first, troubleshoot/fix later. So edit the yaml

1

u/Ranji-reddit Oct 18 '25

Time to wakeup

1

u/Dear-Reading5139 Oct 18 '25

you can use argocd... is it considered GitOps?

if a junior is going with kubectl, then where are your seniors, and why didnt they developed a solution with such urgent cases?

sorry i am transitioning from junior to mid and i have stuff to talk about 😤😤

1

u/BloodyIron Oct 18 '25

"Junior" SRE... uhhhh....

1

u/Federal-Discussion39 Oct 18 '25

Always kubectl edit

1

u/rashmirathi_ Oct 19 '25

Kubernetes newbie here. If you only edit the deployment for a custom resource, would the deployment controller reconcile it anyway as per the CRD?

1

u/derangement_syndrome Oct 19 '25

Senior engineer during business hours more like it

1

u/Xean123456789 Oct 19 '25

What is the advantage of Git Ops over having your CI pipeline push your changes?

1

u/[deleted] Oct 20 '25

At 2am only exists kubectl cli for every level

0

u/nullset_2 Oct 18 '25

gitops sucks, it's so complicated that I'm convinced that nobody does it in practice

2

u/VertigoOne1 Oct 18 '25

No no, you kubectl down the argo containers and then you kubectl the objects, and then you forget about it and monday everything is burning again

3

u/[deleted] Oct 18 '25

[removed] — view removed comment

3

u/[deleted] Oct 19 '25

That and also just the common operational issues at 2am. Imagine pushing fix to the usual cicd- dev, then tests that take time, then push to test, usually some approval, more tests, pre, more approval by someone else, finally prod.