diff --git a/oka/apps/jenkins-ns-params.yaml b/oka/apps/jenkins-ns-params.yaml new file mode 100644 index 0000000000000000000000000000000000000000..c9a14f790e6105b6eb0a510915729e810122ccef --- /dev/null +++ b/oka/apps/jenkins-ns-params.yaml @@ -0,0 +1 @@ +namespace: jenkins diff --git a/oka/apps/jenkins/manifests/jenkins-hr.yaml b/oka/apps/jenkins/manifests/jenkins-hr.yaml index fd4108e468620bcdd2da304db2f637a3b0916e89..f83ae76446ec7990fc635d56ff5ce1dd73b96cb6 100644 --- a/oka/apps/jenkins/manifests/jenkins-hr.yaml +++ b/oka/apps/jenkins/manifests/jenkins-hr.yaml @@ -30,8 +30,6 @@ spec: kind: HelmRepository name: bitnamicharts namespace: jenkins - install: - createNamespace: true interval: 3m0s targetNamespace: jenkins values: {} diff --git a/oka/apps/jenkins/templates/jenkins-ks.yaml b/oka/apps/jenkins/templates/jenkins-ks.yaml index 62bc3003449b0ad575c075f8d178bdcb02c8db80..616304b88c51ecf20ff14382567b97ce1b191186 100644 --- a/oka/apps/jenkins/templates/jenkins-ks.yaml +++ b/oka/apps/jenkins/templates/jenkins-ks.yaml @@ -18,14 +18,39 @@ apiVersion: kustomize.toolkit.fluxcd.io/v1 kind: Kustomization metadata: - name: 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} diff --git a/oka/apps/namespace/manifests/namespace.yaml b/oka/apps/namespace/manifests/namespace.yaml new file mode 100644 index 0000000000000000000000000000000000000000..ac2c4afb50bcec952b7bf3246081dd259dd1f6d4 --- /dev/null +++ b/oka/apps/namespace/manifests/namespace.yaml @@ -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/oka/apps/namespace/templates/namespace-ks.yaml b/oka/apps/namespace/templates/namespace-ks.yaml new file mode 100644 index 0000000000000000000000000000000000000000..3e22d968982d10fd10c4591eecf41b11740a1a78 --- /dev/null +++ b/oka/apps/namespace/templates/namespace-ks.yaml @@ -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/oka/apps/testacme/manifests/testacmeappco.yaml b/oka/apps/testacme/manifests/testacme-deploy.yaml similarity index 72% rename from oka/apps/testacme/manifests/testacmeappco.yaml rename to oka/apps/testacme/manifests/testacme-deploy.yaml index 65404e7a87d063cc1f4bd58404104db3f51b0ed7..1138a8d1e6980ace0eba1d49badbc2a0405fda39 100644 --- a/oka/apps/testacme/manifests/testacmeappco.yaml +++ b/oka/apps/testacme/manifests/testacme-deploy.yaml @@ -1,22 +1,3 @@ -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 ---- apiVersion: apps/v1 kind: Deployment metadata: diff --git a/oka/apps/jenkins/templates/jenkins-ns.yaml b/oka/apps/testacme/manifests/testacme-ns.yaml similarity index 97% rename from oka/apps/jenkins/templates/jenkins-ns.yaml rename to oka/apps/testacme/manifests/testacme-ns.yaml index 4143ffe19091e57f39d88f0f879c581732539442..80c8fb0968d75a9d35f78b5ff61bd33cf76a2456 100644 --- a/oka/apps/jenkins/templates/jenkins-ns.yaml +++ b/oka/apps/testacme/manifests/testacme-ns.yaml @@ -14,8 +14,8 @@ # See the License for the specific language governing permissions and # limitations under the License. ####################################################################################### ---- + apiVersion: v1 kind: Namespace metadata: - name: jenkins + name: ${target_ns} diff --git a/oka/apps/testacme/manifests/testacme-svc.yaml b/oka/apps/testacme/manifests/testacme-svc.yaml new file mode 100644 index 0000000000000000000000000000000000000000..fa4224ef0f9260eb0c1c15d473f55054657bda00 --- /dev/null +++ b/oka/apps/testacme/manifests/testacme-svc.yaml @@ -0,0 +1,18 @@ +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/oka/apps/testacme/templates/testacme-ks.yaml b/oka/apps/testacme/templates/testacme-ks.yaml index 3a21e70142181e693d2ceb1bbbf979ab377a33fc..38df03fa4fa14480a634fdb2adc3cdcd6f764070 100644 --- a/oka/apps/testacme/templates/testacme-ks.yaml +++ b/oka/apps/testacme/templates/testacme-ks.yaml @@ -1,8 +1,3 @@ -apiVersion: v1 -kind: Namespace -metadata: - name: ${TARGET_NS} ---- apiVersion: kustomize.toolkit.fluxcd.io/v1 kind: Kustomization metadata: