Skip to content
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

pre_delete_hook.yaml should support release namespace #2342

Merged
merged 4 commits into from
Oct 29, 2021

Conversation

rayterrill
Copy link
Contributor

@rayterrill rayterrill commented Oct 26, 2021

What type of PR is this?

Uncomment only one /kind <> line, press enter to put that in a new line, and remove leading whitespace from that line:

/kind breaking

/kind bug

/kind cleanup
/kind documentation
/kind feature
/kind hotfix

What this PR does / Why we need it:
The helm cleanup hook currently doesnt support installation namespace, so it goes into the default namespace.

Which issue(s) this PR fixes:

Closes #

Special notes for your reviewer:

@google-cla
Copy link

google-cla bot commented Oct 26, 2021

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@google-cla
Copy link

google-cla bot commented Oct 26, 2021

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: 017fac43-d33e-437b-b255-c1ea9d0814d4

The following development artifacts have been built, and will exist for the next 30 days:

A preview of the website (the last 30 builds are retained):

To install this version:

  • git fetch https://github.com/googleforgames/agones.git pull/2342/head:pr_2342 && git checkout pr_2342
  • helm install ./install/helm/agones --namespace agones-system --name agones --set agones.image.tag=1.19.0-1e0c6fd

@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: 1dc44ace-937c-4d0e-9f5a-f3dfae38d271

The following development artifacts have been built, and will exist for the next 30 days:

A preview of the website (the last 30 builds are retained):

To install this version:

  • git fetch https://github.com/googleforgames/agones.git pull/2342/head:pr_2342 && git checkout pr_2342
  • helm install ./install/helm/agones --namespace agones-system --name agones --set agones.image.tag=1.19.0-35f637b

@roberthbailey
Copy link
Member

@rayterrill - can you please sign the CLA?

@rayterrill
Copy link
Contributor Author

@googlebot I signed it!

@google-cla google-cla bot added cla: yes and removed cla: no labels Oct 27, 2021
@markmandel
Copy link
Member

LGTM. Any issues on your end @roberthbailey ?

@roberthbailey
Copy link
Member

I'm not sure what this configmap / job do.

Are they meant to clean up any running game servers when you uninstall? If so, shouldn't the be configured to run in gameservers.namespaces (using a loop) instead of the release namespace (generally agones-system)? I would expect there not to be any game servers running in the same namespace as the system components.

Or do they clean up the agones system components? In which case putting them into the release namespace does make sense.

@markmandel
Copy link
Member

That is actually a really good point. I thought it deleted Agones components, but it actually deletes all GameServer and related.

You can see the script it runs here:
https://github.com/googleforgames/agones/blob/main/install/helm/agones/scripts/delete_agones_resources.sh

So there are actually a few problems we should solve:

Moving this into the release namespace is likely going to mean it's not going to delete anything, since it won't find any of the GameServers in the release namespace (I'm assuming that is where it will run).

So, we should either:

  1. Have an instance of this in each namespace there might be gameservers
  2. Edit the script to find and delete all GameServers across --all-namespaces (in which case running it under the .Release.Namespace is nicer because it's in the namespace, and it works as intended.

Thoughts?

@roberthbailey
Copy link
Member

Looking lower in the helm template (hidden by default in the diff) it looks like we pass the gameservers.namespaces to the script, and the script iterates over the passed in namespaces and deletes resources in all of them. This actually seems a bit better than using --all-namespaces since it will only delete things in the namespaces configured in helm (providing more control / flexibility).

So this change will implement your second suggestion - moving the job and configmap into the agones-system namespace - which seems like a great improvement.

@google-oss-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: rayterrill, roberthbailey

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@google-oss-robot
Copy link

New changes are detected. LGTM label has been removed.

@roberthbailey
Copy link
Member

As an aside I did also verify that kubectl delete gs --all --all-namespaces works to delete the game servers in multiple namespaces, so we could change the script to do that if we'd prefer. Either way, we should move both of these resources into the agones-system namespace.

@agones-bot
Copy link
Collaborator

Build Failed 😱

Build Id: fc1d9917-3824-44ec-8c2e-f6394a2dc2db

To get permission to view the Cloud Build view, join the agones-discuss Google Group.

@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: 3a44d172-4a84-42b9-a726-2773ac8ff905

The following development artifacts have been built, and will exist for the next 30 days:

A preview of the website (the last 30 builds are retained):

To install this version:

  • git fetch https://github.com/googleforgames/agones.git pull/2342/head:pr_2342 && git checkout pr_2342
  • helm install ./install/helm/agones --namespace agones-system --name agones --set agones.image.tag=1.19.0-d69cb8a

@roberthbailey roberthbailey merged commit 2e78375 into googleforgames:main Oct 29, 2021
@roberthbailey roberthbailey added this to the 1.19.0 milestone Nov 1, 2021
@SaitejaTamma SaitejaTamma added kind/bug These are bugs. kind/feature New features for Agones and removed kind/feature New features for Agones labels Nov 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants