diff --git a/template/manifests/Service/draft.yaml b/template/manifests/Service/draft.yaml new file mode 100644 index 00000000..1fac6020 --- /dev/null +++ b/template/manifests/Service/draft.yaml @@ -0,0 +1,30 @@ +templateName: "Service" +description: "This template is used to create a generic Service for an application" +type: "manifest" +variables: + - name: "PORT" + type: "int" + kind: "port" + description: "the port exposed in the application" + default: + value: 80 + - name: "APPNAME" + type: "string" + kind: "kubernetesResourceName" + description: "the name of the application" + - name: "PARTOF" + type: "string" + kind: "label" + description: "the label to identify which project the resource belong to" + - name: "GENERATORLABEL" + type: "string" + kind: "label" + description: "the label to identify who generated the resource" + default: + value: "draft" + - name: "TARGETPORT" + type: "int" + kind: "port" + description: "the port the Service uses to make the application accessible from outside the cluster" + default: + referenceVar: "PORT" \ No newline at end of file diff --git a/template/manifests/Service/service.yaml b/template/manifests/Service/service.yaml new file mode 100644 index 00000000..2ab33e33 --- /dev/null +++ b/template/manifests/Service/service.yaml @@ -0,0 +1,16 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{.APPNAME}} + labels: + app.kubernetes.io/name: {{.APPNAME}} + app.kubernetes.io/part-of: {{.PARTOF}} + kubernetes.azure.com/generator: {{.GENERATORLABEL}} +spec: + type: ClusterIP + selector: + app: {{.APPNAME}} + ports: + - protocol: TCP + port: {{.PORT}} + targetPort: {{.TARGETPORT}} \ No newline at end of file