From 4afa02fe9d54f6805c510b19dbfd87c99966cbf3 Mon Sep 17 00:00:00 2001 From: Arjav Desai Date: Wed, 14 Sep 2022 18:31:22 -0500 Subject: [PATCH] fix k8s support and add v8o support --- .../src/main/archetype/common/common.xml | 1 - .../archetype/common/files/app.yaml.mustache | 45 +++++---- .../archetype/common/files/v8o.yaml.mustache | 34 +++++++ .../src/main/archetype/common/packaging.xml | 92 ++++++++----------- 4 files changed, 91 insertions(+), 81 deletions(-) create mode 100644 archetypes/helidon/src/main/archetype/common/files/v8o.yaml.mustache diff --git a/archetypes/helidon/src/main/archetype/common/common.xml b/archetypes/helidon/src/main/archetype/common/common.xml index d857052bab7..ba4d9bab53e 100644 --- a/archetypes/helidon/src/main/archetype/common/common.xml +++ b/archetypes/helidon/src/main/archetype/common/common.xml @@ -41,7 +41,6 @@ .helidon.mustache README.md.mustache - app.yaml.mustache diff --git a/archetypes/helidon/src/main/archetype/common/files/app.yaml.mustache b/archetypes/helidon/src/main/archetype/common/files/app.yaml.mustache index e684f72c9db..9a51f58cd6b 100644 --- a/archetypes/helidon/src/main/archetype/common/files/app.yaml.mustache +++ b/archetypes/helidon/src/main/archetype/common/files/app.yaml.mustache @@ -1,19 +1,3 @@ -# -# Copyright (c) 2018, 2021 Oracle and/or its affiliates. All rights reserved. -# -# 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. -# - kind: Service apiVersion: v1 metadata: @@ -29,11 +13,24 @@ spec: targetPort: 8080 name: http --- -{{#yaml-section}} -{{.}} ---- -{{/yaml-section}} - -{{#app-yaml-content}} -{{.}} -{{/app-yaml-content}} \ No newline at end of file +kind: Deployment +apiVersion: apps/v1 +metadata: + name: {{artifactId}} +spec: + replicas: 1 + selector: + matchLabels: + app: {{artifactId}} + template: + metadata: + labels: + app: {{artifactId}} + version: v1 + spec: + containers: + - name: {{artifactId}} + image: {{artifactId}} + imagePullPolicy: IfNotPresent + ports: + - containerPort: 8080 diff --git a/archetypes/helidon/src/main/archetype/common/files/v8o.yaml.mustache b/archetypes/helidon/src/main/archetype/common/files/v8o.yaml.mustache new file mode 100644 index 00000000000..bd0f49aea62 --- /dev/null +++ b/archetypes/helidon/src/main/archetype/common/files/v8o.yaml.mustache @@ -0,0 +1,34 @@ +kind: Component +apiVersion: core.oam.dev/v1alpha2 +metadata: + name: {{artifactId}}-component +spec: + workload: + apiVersion: oam.verrazzano.io/v1alpha1 + kind: VerrazzanoHelidonWorkload + metadata: + name: {{artifactId}}-workload + labels: + app: {{artifactId}} + spec: + deploymentTemplate: + metadata: + name: {{artifactId}}-deployment + podSpec: + containers: + - name: {{artifactId}}-container + image : {{artifactId}} + ports: + - containerPort: 8080 + name: http +--- +kind: ApplicationConfiguration +apiVersion: core.oam.dev/v1alpha2 +metadata: + name: {{artifactId}}-appconf + annotations: + version: v1.0.0 + description: "{{artifactId}} application" +spec: + components: + - componentName: {{artifactId}}-component diff --git a/archetypes/helidon/src/main/archetype/common/packaging.xml b/archetypes/helidon/src/main/archetype/common/packaging.xml index e49202493bb..e7986fbd8a2 100644 --- a/archetypes/helidon/src/main/archetype/common/packaging.xml +++ b/archetypes/helidon/src/main/archetype/common/packaging.xml @@ -29,34 +29,37 @@ default="false" optional="true"> + + files + + app.yaml.mustache + + - - - + + + + + @@ -66,35 +69,12 @@ spec: default="false" optional="true"> - - - - - + + files + + v8o.yaml.mustache + +