-
Notifications
You must be signed in to change notification settings - Fork 43
Use a single namespace via kube-namespace flag #56
base: master
Are you sure you want to change the base?
Conversation
@metalmatze One point I would like to throw in here is that owner reference could be used for the cleanup. https://kubernetes.io/docs/concepts/workloads/controllers/garbage-collection/ Though not 100% sure if this makes sense to use here. 🙂 |
@galexrt, this makes a lot of sense and most of the things should be cleaned up automatically. But I agree that we should make sure it actually happens and the owner reference is perfect for that! 👍 In the last few weeks I've given this quite a lot of thought. Especially for services that have the same name. Let's say you want to start a Postgres Pod to use as a Drone service in your pipeline and want to reference that from your integration tests. It might happen that there are 2 (or more) concurrent pipelines for the same repository running and they both reference |
spec.Metadata.Namespace, | ||
&metav1.DeleteOptions{}, | ||
) | ||
if e.namespace == "" { |
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.
!=
?
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.
Ok, nvm. The code should be more more self-decriptive or documented in my opinion. Consider adding a bool useSignleNamespace = e.namespace != ""
and rely on it in the checks.
Is it possible to just use sub domains with the cluster DNS and define a different search domain for the involved pods? |
@tboerger Mhh haven't tried that but that may work https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/#pod-s-dns-config (the search domain part at least). That may cause K8S minimum version to be something around 1.10+ or so. |
So far I like where this is going. Using GC and owner references sounds like a great idea. |
Please take a look at #53 - I think I found a solution to the name resolution issue. |
@MOZGIII I think your conclusion is right. There is even an example here: https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/#pod-s-hostname-and-subdomain-fields
|
This PR is still missing:
/cc @bradrydzewski @MOZGIII