Set ownerReferences on created pods
This would allow argocd, and kubernetes itself and others to understand the relationship between the created pods and the runner. This is needed for things that refuse to act on pods that arent owned by a controller.
For reference:
apiVersion: v1
kind: Pod
metadata:
creationTimestamp: '2023-10-02T11:43:05Z'
labels:
run: tmp-shell-vbtkqmnq7c
name: tmp-shell-vbtkqmnq7c
namespace: gitlab-runner
ownerReferences:
- apiVersion: apps/v1
blockOwnerDeletion: true
controller: true
kind: Pod
name: gitlab-runner-shared-dind-844669d9bc-zdwf8
uid: 108949b6-473a-4974-88a6-6e202199b0ab
❯ kubectl tree deploy gitlab-runner-shared-dind
NAMESPACE NAME READY REASON AGE
gitlab-runner Deployment/gitlab-runner-shared-dind - 2d21h
gitlab-runner ├─ReplicaSet/gitlab-runner-shared-dind-6644f67cb7 - 2d20h
gitlab-runner ├─ReplicaSet/gitlab-runner-shared-dind-77cbff786d - 2d20h
gitlab-runner └─ReplicaSet/gitlab-runner-shared-dind-844669d9bc - 2d20h
gitlab-runner └─Pod/gitlab-runner-shared-dind-844669d9bc-zdwf8 True 4h32m
gitlab-runner ├─CiliumEndpoint/gitlab-runner-shared-dind-844669d9bc-zdwf8 - 4h32m
gitlab-runner └─Pod/tmp-shell-vbtkqmnq7c False PodCompleted 6m27s
Edited by Fredrik Larsson