Skip to content

Commit 198b23c

Browse files
author
Qreta Dev
committed
feat: add target namespace for the deployment
1 parent f27cbdd commit 198b23c

File tree

2 files changed

+13
-9
lines changed

2 files changed

+13
-9
lines changed

examples/deploy.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: v1
22
kind: Secret
33
metadata:
44
name: gh-deploy-key # set a secret name for the SSH key
5-
namespace: qretadeploy # qretadeploy is the namespace for running QretaDeploy
5+
namespace: qretadeploy # namespace for running QretaDeploy
66
type: Opaque
77
stringData:
88
id_ed25519: |
@@ -17,6 +17,7 @@ metadata:
1717
namespace: qretadeploy
1818
spec:
1919
name: qreta-gitops-deploy
20+
targetNamespace: qretadeploy
2021
repoUrl: [email protected]:qretaio/QretaDeploy.git
2122
branch: main
2223
interval: "30"

manifests/QretaDeploy.yaml

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
apiVersion: v1
2-
kind: Namespace
3-
metadata:
4-
name: qretadeploy
5-
---
61
apiVersion: kro.run/v1alpha1
72
kind: ResourceGraphDefinition
83
metadata:
@@ -13,18 +8,26 @@ spec:
138
kind: QretaDeploy
149
spec:
1510
name: string
11+
targetNamespace: string
1612
repoUrl: string
1713
branch: string
1814
folder: string | default="."
1915
sshKeys: string | default=""
2016
interval: string
2117
resources:
18+
- id: namespace
19+
template:
20+
apiVersion: v1
21+
kind: Namespace
22+
metadata:
23+
name: ${ schema.spec.targetNamespace }
2224
- id: script
2325
template:
2426
apiVersion: v1
2527
kind: ConfigMap
2628
metadata:
2729
name: qretadeploy-sh
30+
namespace: ${ schema.spec.targetNamespace }
2831
data:
2932
deploy.sh: |
3033
#!/bin/sh
@@ -55,7 +58,7 @@ spec:
5558
kind: Deployment
5659
metadata:
5760
name: ${ schema.spec.name }
58-
namespace: qretadeploy
61+
namespace: ${ schema.spec.targetNamespace }
5962
annotations:
6063
reloader.stakater.com/auto: "true"
6164
spec:
@@ -105,7 +108,7 @@ spec:
105108
kind: ServiceAccount
106109
metadata:
107110
name: ${ schema.spec.name }
108-
namespace: qretadeploy
111+
namespace: ${ schema.spec.targetNamespace }
109112
- id: clusterRoleBinding
110113
template:
111114
apiVersion: rbac.authorization.k8s.io/v1
@@ -119,4 +122,4 @@ spec:
119122
subjects:
120123
- kind: ServiceAccount
121124
name: ${ schema.spec.name }
122-
namespace: qretadeploy
125+
namespace: ${ schema.spec.targetNamespace }

0 commit comments

Comments
 (0)