Skip to content

Commit 0267f91

Browse files
Update App forceu-gokapi on branch main
1 parent 9c060a2 commit 0267f91

File tree

12 files changed

+316
-3
lines changed

12 files changed

+316
-3
lines changed

forceu-gokapi/.do/deploy.template.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ spec:
1414
envs:
1515
- key: TZ
1616
value: UTC
17+
scope: RUN_TIME
1718
http_port: 53842
1819
routes:
1920
- path: /

forceu-gokapi/aws-cloudformation.cf.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
AWSTemplateFormatVersion: 2010-09-09
2-
Description: DeployStack CFN template translated from Docker compose
2+
Description: Generated from container configuration by docker-to-iac
33
Parameters:
44
VPC:
55
Type: AWS::EC2::VPC::Id

forceu-gokapi/docker-run.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
docker run -v gokapi-data:/app/data -v gokapi-config:/app/config -p 53842:53842 -e TZ=UTC f0rc3/gokapi:latest
1+
docker run -v ./gokapi-data:/app/data -v ./gokapi-config:/app/config -p 53842:53842 -e TZ=UTC f0rc3/gokapi:latest

forceu-gokapi/helm/Chart.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
apiVersion: v2
2+
name: forceu-gokapi
3+
description: A Helm chart for DeployStack application generated from Docker configuration
4+
type: application
5+
version: 0.1.0
6+
appVersion: 1.0.0
7+
maintainers:
8+
- name: DeployStack
9+
email: hello@deploystack.io
10+
dependencies: []
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
2+
Thank you for installing {{ .Chart.Name }}.
3+
4+
Your application has been deployed successfully!
5+
6+
{{- range $key, $service := .Values.services }}
7+
{{- if and $service.enabled $service.service.ports }}
8+
9+
Service {{ $key }}:
10+
{{- if contains "NodePort" $service.service.type }}
11+
Access on: http://NODE_IP:NODE_PORT
12+
Get the NodePort by running: kubectl get svc {{ include "deploystack.fullname" $ }}-{{ $key }}
13+
{{- else if contains "LoadBalancer" $service.service.type }}
14+
Access on: http://EXTERNAL_IP:PORT
15+
Get the LoadBalancer IP by running: kubectl get svc {{ include "deploystack.fullname" $ }}-{{ $key }}
16+
{{- else if contains "ClusterIP" $service.service.type }}
17+
Access within the cluster only
18+
Forward ports by running: kubectl port-forward svc/{{ include "deploystack.fullname" $ }}-{{ $key }} LOCAL_PORT:SERVICE_PORT
19+
{{- end }}
20+
{{- end }}
21+
{{- end }}
22+
23+
For more information on managing your application, see the Helm documentation:
24+
https://helm.sh/docs/
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
2+
{{/*
3+
Expand the name of the chart.
4+
*/}}
5+
{{- define "deploystack.name" -}}
6+
{{- default .Chart.Name .Values.global.nameOverride | trunc 63 | trimSuffix "-" }}
7+
{{- end }}
8+
9+
{{/*
10+
Create a default fully qualified app name.
11+
*/}}
12+
{{- define "deploystack.fullname" -}}
13+
{{- if .Values.global.fullnameOverride }}
14+
{{- .Values.global.fullnameOverride | trunc 63 | trimSuffix "-" }}
15+
{{- else }}
16+
{{- $name := default .Chart.Name .Values.global.nameOverride }}
17+
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
18+
{{- end }}
19+
{{- end }}
20+
21+
{{/*
22+
Create chart name and version as used by the chart label.
23+
*/}}
24+
{{- define "deploystack.chart" -}}
25+
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
26+
{{- end }}
27+
28+
{{/*
29+
Common labels
30+
*/}}
31+
{{- define "deploystack.labels" -}}
32+
helm.sh/chart: {{ include "deploystack.chart" . }}
33+
{{ include "deploystack.selectorLabels" . }}
34+
{{- if .Chart.AppVersion }}
35+
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
36+
{{- end }}
37+
app.kubernetes.io/managed-by: {{ .Release.Service }}
38+
{{- end }}
39+
40+
{{/*
41+
Selector labels
42+
*/}}
43+
{{- define "deploystack.selectorLabels" -}}
44+
app.kubernetes.io/name: {{ include "deploystack.name" . }}
45+
app.kubernetes.io/instance: {{ .Release.Name }}
46+
{{- end }}
47+
48+
{{/*
49+
Service reference helper
50+
*/}}
51+
{{- define "deploystack.serviceReference" -}}
52+
{{- if .service }}
53+
{{- if .service.service.ports }}
54+
{{- with index .service.service.ports 0 }}
55+
{{ $.serviceKey }}.{{ $.serviceName }}.svc.cluster.local:{{ .port }}
56+
{{- end }}
57+
{{- else }}
58+
{{ $.serviceKey }}.{{ $.serviceName }}.svc.cluster.local
59+
{{- end }}
60+
{{- else }}
61+
unknown-service-reference
62+
{{- end }}
63+
{{- end }}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
2+
{{- range $key, $service := .Values.services }}
3+
{{- if $service.enabled }}
4+
{{- if $service.environment.regular }}
5+
apiVersion: v1
6+
kind: ConfigMap
7+
metadata:
8+
name: {{ include "deploystack.fullname" $ }}-{{ $key }}-config
9+
labels:
10+
{{- include "deploystack.labels" $ | nindent 4 }}
11+
app.kubernetes.io/component: {{ $key }}
12+
data:
13+
{{- toYaml $service.environment.regular | nindent 2 }}
14+
{{- end }}
15+
16+
{{- if $service.dependencies }}
17+
---
18+
apiVersion: v1
19+
kind: ConfigMap
20+
metadata:
21+
name: {{ include "deploystack.fullname" $ }}-{{ $key }}-dependencies
22+
labels:
23+
{{- include "deploystack.labels" $ | nindent 4 }}
24+
app.kubernetes.io/component: {{ $key }}
25+
data:
26+
{{- range $service.dependencies }}
27+
{{- $serviceName := .service }}
28+
{{- range $envKey, $envValue := .variables }}
29+
{{ $envKey }}: {{ include "deploystack.serviceReference" (dict "service" (index $.Values.services $serviceName) "serviceKey" $serviceName) }}
30+
{{- end }}
31+
{{- end }}
32+
{{- end }}
33+
{{- end }}
34+
{{- end }}
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
2+
{{- range $key, $service := .Values.services }}
3+
{{- if $service.enabled }}
4+
apiVersion: apps/v1
5+
kind: Deployment
6+
metadata:
7+
name: {{ include "deploystack.fullname" $ }}-{{ $key }}
8+
labels:
9+
{{- include "deploystack.labels" $ | nindent 4 }}
10+
app.kubernetes.io/component: {{ $key }}
11+
spec:
12+
{{- if not $service.autoscaling.enabled }}
13+
replicas: {{ $service.replicaCount }}
14+
{{- end }}
15+
selector:
16+
matchLabels:
17+
{{- include "deploystack.selectorLabels" $ | nindent 6 }}
18+
app.kubernetes.io/component: {{ $key }}
19+
template:
20+
metadata:
21+
{{- with $.Values.global.podAnnotations }}
22+
annotations:
23+
{{- toYaml . | nindent 8 }}
24+
{{- end }}
25+
labels:
26+
{{- include "deploystack.selectorLabels" $ | nindent 8 }}
27+
app.kubernetes.io/component: {{ $key }}
28+
spec:
29+
{{- with $.Values.global.imagePullSecrets }}
30+
imagePullSecrets:
31+
{{- toYaml . | nindent 8 }}
32+
{{- end }}
33+
securityContext:
34+
{{- toYaml $.Values.global.podSecurityContext | nindent 8 }}
35+
containers:
36+
- name: {{ $key }}
37+
securityContext:
38+
{{- toYaml $.Values.global.securityContext | nindent 12 }}
39+
image: "{{ $service.image.repository }}:{{ $service.image.tag | default "latest" }}"
40+
imagePullPolicy: {{ $service.image.pullPolicy }}
41+
{{- if $service.command }}
42+
command:
43+
{{- toYaml $service.command | nindent 12 }}
44+
{{- end }}
45+
ports:
46+
{{- range $service.service.ports }}
47+
- name: http-{{ .port }}
48+
containerPort: {{ .targetPort }}
49+
protocol: {{ .protocol }}
50+
{{- end }}
51+
{{- if or $service.environment.regular $service.environment.sensitive }}
52+
env:
53+
{{- range $envKey, $envValue := $service.environment.regular }}
54+
- name: {{ $envKey }}
55+
valueFrom:
56+
configMapKeyRef:
57+
name: {{ include "deploystack.fullname" $ }}-{{ $key }}-config
58+
key: {{ $envKey }}
59+
{{- end }}
60+
{{- range $envKey, $envValue := $service.environment.sensitive }}
61+
- name: {{ $envKey }}
62+
valueFrom:
63+
secretKeyRef:
64+
name: {{ include "deploystack.fullname" $ }}-{{ $key }}-secret
65+
key: {{ $envKey }}
66+
{{- end }}
67+
{{- if $service.dependencies }}
68+
{{- range $service.dependencies }}
69+
{{- range $envKey, $envValue := .variables }}
70+
- name: {{ $envKey }}
71+
valueFrom:
72+
configMapKeyRef:
73+
name: {{ include "deploystack.fullname" $ }}-{{ $key }}-dependencies
74+
key: {{ $envKey }}
75+
{{- end }}
76+
{{- end }}
77+
{{- end }}
78+
{{- end }}
79+
{{- with $service.volumes }}
80+
volumeMounts:
81+
{{- toYaml . | nindent 12 }}
82+
{{- end }}
83+
resources:
84+
{{- toYaml $service.resources | nindent 12 }}
85+
{{- with $service.volumes }}
86+
volumes:
87+
{{- range . }}
88+
- name: {{ .name }}
89+
hostPath:
90+
path: {{ .hostPath }}
91+
{{- end }}
92+
{{- end }}
93+
{{- end }}
94+
{{- end }}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
2+
{{- range $key, $service := .Values.services }}
3+
{{- if $service.enabled }}
4+
{{- if $service.environment.sensitive }}
5+
apiVersion: v1
6+
kind: Secret
7+
metadata:
8+
name: {{ include "deploystack.fullname" $ }}-{{ $key }}-secret
9+
labels:
10+
{{- include "deploystack.labels" $ | nindent 4 }}
11+
app.kubernetes.io/component: {{ $key }}
12+
type: Opaque
13+
data:
14+
{{- range $envKey, $envValue := $service.environment.sensitive }}
15+
{{ $envKey }}: {{ $envValue | b64enc | quote }}
16+
{{- end }}
17+
{{- end }}
18+
{{- end }}
19+
{{- end }}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
2+
{{- range $key, $service := .Values.services }}
3+
{{- if $service.enabled }}
4+
apiVersion: v1
5+
kind: Service
6+
metadata:
7+
name: {{ include "deploystack.fullname" $ }}-{{ $key }}
8+
labels:
9+
{{- include "deploystack.labels" $ | nindent 4 }}
10+
app.kubernetes.io/component: {{ $key }}
11+
spec:
12+
type: {{ $service.service.type }}
13+
ports:
14+
{{- range $service.service.ports }}
15+
- port: {{ .port }}
16+
targetPort: {{ .targetPort }}
17+
protocol: {{ .protocol }}
18+
name: http-{{ .port }}
19+
{{- end }}
20+
selector:
21+
{{- include "deploystack.selectorLabels" $ | nindent 4 }}
22+
app.kubernetes.io/component: {{ $key }}
23+
{{- end }}
24+
{{- end }}

0 commit comments

Comments
 (0)