Initial Commit

This commit is contained in:
Alan Bridgeman 2025-02-11 12:52:05 -06:00
parent ff52718a85
commit b3b43329cd
22 changed files with 1582 additions and 0 deletions

23
src/Service.py Normal file
View 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')