Skip to content

Commit

Permalink
added the orphaned namespace cleaner namespace definition
Browse files Browse the repository at this point in the history
  • Loading branch information
anshulvermapatel committed Feb 26, 2025
1 parent d45ec73 commit e2fd0b0
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ parameters:
- name: CLIENT_ID
description: The Azure Client ID used for federation
required: true
- name: ORPHANED_NAMESPACE_CLEANER
- name: ORPHANED_NAMESPACE_CLEANER_NAMESPACE
description: The namespace to create to have a cronjob which will delete the orphaned namespace which are not deleted due to any issues with the jenkins job.
value: orphaned-namespace-cleaner
- name: KUBECTL_IMAGE
Expand Down Expand Up @@ -78,19 +78,23 @@ objects:
namespace: ${NAMESPACE}
data:
cs-client-id: ${CLIENT_ID}
- apiVersion: v1
kind: Namespace
metadata:
name: ${ORPHANED_NAMESPACE_CLEANER_NAMESPACE}
- apiVersion: v1
kind: ServiceAccount
metadata:
name: orphaned-namespace-cleaner-cronjob
namespace: ${ORPHANED_NAMESPACE_CLEANER}
namespace: ${ORPHANED_NAMESPACE_CLEANER_NAMESPACE}
- apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: orphaned-namespace-cleaner-cronjob
subjects:
- kind: ServiceAccount
name: orphaned-namespace-cleaner-cronjob
namespace: ${ORPHANED_NAMESPACE_CLEANER}
namespace: ${ORPHANED_NAMESPACE_CLEANER_NAMESPACE}
roleRef:
kind: ClusterRole
name: namespace-admin
Expand All @@ -99,7 +103,7 @@ objects:
kind: CronJob
metadata:
name: orphaned-namespace-cleaner
namespace: ${ORPHANED_NAMESPACE_CLEANER}
namespace: ${ORPHANED_NAMESPACE_CLEANER_NAMESPACE}
spec:
schedule: "0 0 * * *"
successfulJobsHistoryLimit: 3
Expand Down

0 comments on commit e2fd0b0

Please sign in to comment.