Skip to content

Commit

Permalink
adding a generic service template
Browse files Browse the repository at this point in the history
  • Loading branch information
Vidya2606 committed Oct 16, 2024
1 parent d5acab2 commit 5a905f5
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
30 changes: 30 additions & 0 deletions template/manifests/Service/draft.yaml
Original file line number Diff line number Diff line change
@@ -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"
16 changes: 16 additions & 0 deletions template/manifests/Service/service.yaml
Original file line number Diff line number Diff line change
@@ -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}}

0 comments on commit 5a905f5

Please sign in to comment.