Update manifests in the sw-catalog for jenkins app, add namespace and testacme app 24/15224/2
authorgarciadeblas <gerardo.garciadeblas@telefonica.com>
Wed, 11 Jun 2025 07:49:26 +0000 (09:49 +0200)
committergarciadeblas <gerardo.garciadeblas@telefonica.com>
Wed, 11 Jun 2025 08:49:45 +0000 (10:49 +0200)
Change-Id: Ic63604aacda256729e98c4d1a286020925dd92db
Signed-off-by: garciadeblas <gerardo.garciadeblas@telefonica.com>
installers/mgmt-cluster/flux/templates/sw-catalogs/apps/jenkins/manifests/bitnamicharts-repo.yaml
installers/mgmt-cluster/flux/templates/sw-catalogs/apps/jenkins/manifests/jenkins-hr.yaml
installers/mgmt-cluster/flux/templates/sw-catalogs/apps/jenkins/templates/jenkins-ks.yaml
installers/mgmt-cluster/flux/templates/sw-catalogs/apps/jenkins/templates/jenkins-ns.yaml [deleted file]
installers/mgmt-cluster/flux/templates/sw-catalogs/apps/namespace/manifests/namespace.yaml [new file with mode: 0644]
installers/mgmt-cluster/flux/templates/sw-catalogs/apps/namespace/templates/namespace-ks.yaml [new file with mode: 0644]
installers/mgmt-cluster/flux/templates/sw-catalogs/apps/testacme/manifests/testacme-deploy.yaml [new file with mode: 0644]
installers/mgmt-cluster/flux/templates/sw-catalogs/apps/testacme/manifests/testacme-svc.yaml [new file with mode: 0644]
installers/mgmt-cluster/flux/templates/sw-catalogs/apps/testacme/templates/testacme-ks.yaml [new file with mode: 0644]

index 354b837..429a658 100644 (file)
@@ -14,7 +14,6 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 #######################################################################################
-
 ---
 apiVersion: source.toolkit.fluxcd.io/v1beta2
 kind: HelmRepository
index c5d7eb3..f83ae76 100644 (file)
@@ -14,7 +14,6 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 #######################################################################################
-
 ---
 apiVersion: helm.toolkit.fluxcd.io/v2beta1
 kind: HelmRelease
@@ -31,8 +30,6 @@ spec:
         kind: HelmRepository
         name: bitnamicharts
         namespace: jenkins
-  install:
-    createNamespace: true
   interval: 3m0s
   targetNamespace: jenkins
   values: {}
index bbf4d7b..276db4b 100644 (file)
 # See the License for the specific language governing permissions and
 # limitations under the License.
 #######################################################################################
-
 ---
 apiVersion: kustomize.toolkit.fluxcd.io/v1
 kind: Kustomization
 metadata:
-  name: jenkins
-  namespace: jenkins
+  name: ${APPNAME}
+  namespace: flux-system
 spec:
   interval: 1h0m0s
   path: ./apps/jenkins/manifests
   prune: true
+  targetNamespace: ${TARGET_NS}
+  wait: true
   sourceRef:
     kind: GitRepository
     name: sw-catalogs
     namespace: flux-system
+  patches:
+    # - target:
+    #     kind: Namespace
+    #     version: v1
+    #     name: jenkins
+    #   patch: |-
+    #     kind: Namespace
+    #     metadata:
+    #       name: ${TARGET_NS}
+    - target:
+        kind: HelmRelease
+        version: v2beta1
+        name: jenkins
+        namespace: jenkins
+      patch: |-
+        - op: replace
+          path: /metadata/name
+          value: ${APPNAME}
+        - op: replace
+          path: /spec/chart/spec/sourceRef/namespace
+          value: ${TARGET_NS}
+        - op: replace
+          path: /spec/targetNamespace
+          value: ${TARGET_NS}
+    - target:
+        kind: HelmRepository
+        version: v2beta1
+        name: bitnamicharts
+        namespace: jenkins
+      patch: |-
+        - op: replace
+          path: /metadata/namespace
+          value: ${TARGET_NS}
diff --git a/installers/mgmt-cluster/flux/templates/sw-catalogs/apps/jenkins/templates/jenkins-ns.yaml b/installers/mgmt-cluster/flux/templates/sw-catalogs/apps/jenkins/templates/jenkins-ns.yaml
deleted file mode 100644 (file)
index ca2fff8..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-#######################################################################################
-# Copyright ETSI Contributors and Others.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#    http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-# implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#######################################################################################
-
-apiVersion: v1
-kind: Namespace
-metadata:
-  creationTimestamp: null
-  name: jenkins
-spec: {}
-status: {}
diff --git a/installers/mgmt-cluster/flux/templates/sw-catalogs/apps/namespace/manifests/namespace.yaml b/installers/mgmt-cluster/flux/templates/sw-catalogs/apps/namespace/manifests/namespace.yaml
new file mode 100644 (file)
index 0000000..ac2c4af
--- /dev/null
@@ -0,0 +1,23 @@
+#######################################################################################
+# Copyright ETSI Contributors and Others.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+# implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#######################################################################################
+---
+apiVersion: v1
+kind: Namespace
+metadata:
+  name: mynamespace
+  annotations:
+    kustomize.toolkit.fluxcd.io/ssa: "IfNotPresent"
diff --git a/installers/mgmt-cluster/flux/templates/sw-catalogs/apps/namespace/templates/namespace-ks.yaml b/installers/mgmt-cluster/flux/templates/sw-catalogs/apps/namespace/templates/namespace-ks.yaml
new file mode 100644 (file)
index 0000000..3e22d96
--- /dev/null
@@ -0,0 +1,40 @@
+#######################################################################################
+# Copyright ETSI Contributors and Others.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+# implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#######################################################################################
+---
+apiVersion: kustomize.toolkit.fluxcd.io/v1
+kind: Kustomization
+metadata:
+  name: ${APPNAME}
+  namespace: flux-system
+spec:
+  interval: 1h0m0s
+  path: ./apps/namespace/manifests
+  prune: true
+  # deletionPolicy: Orphan
+  sourceRef:
+    kind: GitRepository
+    name: sw-catalogs
+    namespace: flux-system
+  patches:
+    - target:
+        kind: Namespace
+        version: v1
+        name: mynamespace
+      patch: |-
+        - op: replace
+          path: /metadata/name
+          value: ${TARGET_NS}
diff --git a/installers/mgmt-cluster/flux/templates/sw-catalogs/apps/testacme/manifests/testacme-deploy.yaml b/installers/mgmt-cluster/flux/templates/sw-catalogs/apps/testacme/manifests/testacme-deploy.yaml
new file mode 100644 (file)
index 0000000..e467eca
--- /dev/null
@@ -0,0 +1,54 @@
+#######################################################################################
+# Copyright ETSI Contributors and Others.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+# implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#######################################################################################
+---
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+  creationTimestamp: null
+  labels:
+    config: ${appname}
+  name: ${appname}-deployment
+  namespace: ${target_ns}
+spec:
+  replicas: 1
+  selector:
+    matchLabels:
+      run: ${appname}
+  strategy: {}
+  template:
+    metadata:
+      creationTimestamp: null
+      labels:
+        mex-app: ${appname}-deployment
+        mexAppInstName: test
+        mexAppInstOrg: AcmeAppCo
+        mexDeployGen: kubernetes-basic
+        run: ${appname}
+    spec:
+      containers:
+      - image: docker.io/hashicorp/http-echo:1.0
+        imagePullPolicy: Always
+        name: ${appname}
+        ports:
+        - containerPort: 5678
+          protocol: TCP
+        resources: {}
+        args:
+        - "-text=\"${echo_message:=hello}\""
+      imagePullSecrets:
+      - name: docker.io
+
diff --git a/installers/mgmt-cluster/flux/templates/sw-catalogs/apps/testacme/manifests/testacme-svc.yaml b/installers/mgmt-cluster/flux/templates/sw-catalogs/apps/testacme/manifests/testacme-svc.yaml
new file mode 100644 (file)
index 0000000..cb9f968
--- /dev/null
@@ -0,0 +1,35 @@
+#######################################################################################
+# Copyright ETSI Contributors and Others.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+# implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#######################################################################################
+---
+apiVersion: v1
+kind: Service
+metadata:
+  creationTimestamp: null
+  labels:
+    config: ${appname}
+    run: ${appname}
+  name: ${appname}-http
+  namespace: ${target_ns}
+spec:
+  ports:
+  - name: http5678tls
+    port: 5678
+    protocol: TCP
+    targetPort: 5678
+  selector:
+    run: ${appname}
+  type: ClusterIP
diff --git a/installers/mgmt-cluster/flux/templates/sw-catalogs/apps/testacme/templates/testacme-ks.yaml b/installers/mgmt-cluster/flux/templates/sw-catalogs/apps/testacme/templates/testacme-ks.yaml
new file mode 100644 (file)
index 0000000..4401d4b
--- /dev/null
@@ -0,0 +1,37 @@
+#######################################################################################
+# Copyright ETSI Contributors and Others.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+# implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#######################################################################################
+---
+apiVersion: kustomize.toolkit.fluxcd.io/v1
+kind: Kustomization
+metadata:
+  name: ${APPNAME}
+  namespace: flux-system
+spec:
+  interval: 1h0m0s
+  path: ./apps/testacme/manifests
+  prune: true
+  wait: true
+  sourceRef:
+    kind: GitRepository
+    name: sw-catalogs
+    namespace: flux-system
+  # Input parameters
+  postBuild:
+    substitute:
+      appname: ${APPNAME}
+      target_ns: ${TARGET_NS}
+      echo_message: ${ECHO_MESSAGE}