Initial Commit
This commit is contained in:
parent
ff52718a85
commit
b3b43329cd
22 changed files with 1582 additions and 0 deletions
23
src/Service.py
Normal file
23
src/Service.py
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
from .Template import Template
|
||||
|
||||
class Service (Template):
|
||||
def __init__(self):
|
||||
"""A class for creating a/some template(s) related to the Service for the app."""
|
||||
|
||||
super().__init__()
|
||||
|
||||
def write(self):
|
||||
"""Write the Service template to a file."""
|
||||
|
||||
with open(f'templates/service.yaml', 'w') as f:
|
||||
f.write('apiVersion: v1' + '\n')
|
||||
f.write('kind: Service' + '\n')
|
||||
f.write('metadata:' + '\n')
|
||||
f.write(' ' + 'name: {{ .Release.Name }}' + '\n')
|
||||
f.write('spec:' + '\n')
|
||||
f.write(' ' + 'selector:' + '\n')
|
||||
f.write(' ' + ' ' + 'app: {{ .Release.Name }}' + '\n')
|
||||
f.write(' ' + 'ports:' + '\n')
|
||||
f.write(' ' + ' ' + '- protocol: TCP' + '\n')
|
||||
f.write(' ' + ' ' + ' ' + 'port: 80' + '\n')
|
||||
f.write(' ' + ' ' + ' ' + 'targetPort: {{ .Values.container.port }}' + '\n')
|
||||
Loading…
Add table
Add a link
Reference in a new issue