Skip to content

Commit 977b1c0

Browse files
committed
inventor
1 parent 8f23c1c commit 977b1c0

File tree

11 files changed

+261
-0
lines changed

11 files changed

+261
-0
lines changed

.github/workflows/release.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Release Charts
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
release:
10+
# depending on default permission settings for your org (contents being read-only or read-write for workloads), you will have to add permissions
11+
# see: https://docs.github.com/en/actions/security-guides/automatic-token-authentication#modifying-the-permissions-for-the-github_token
12+
permissions:
13+
contents: write
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v3
18+
with:
19+
fetch-depth: 0
20+
21+
- name: Configure Git
22+
run: |
23+
git config user.name "$GITHUB_ACTOR"
24+
git config user.email "[email protected]"
25+
26+
- name: Install Helm
27+
uses: azure/setup-helm@v4
28+
env:
29+
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
30+
31+
- name: Run chart-releaser
32+
uses: helm/[email protected]
33+
env:
34+
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"

charts/inventor/.helmignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.idea

charts/inventor/Chart.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
apiVersion: v2
2+
name: inventor
3+
version: 0.0.2
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
{{- define "inventor.config" }}
2+
- name: APP_ENV
3+
valueFrom:
4+
configMapKeyRef:
5+
name: inventor
6+
key: APP_ENV
7+
8+
- name: REDIS_ADDR
9+
valueFrom:
10+
configMapKeyRef:
11+
name: inventor
12+
key: REDIS_ADDR
13+
14+
- name: REDIS_PORT
15+
valueFrom:
16+
configMapKeyRef:
17+
name: inventor
18+
key: REDIS_PORT
19+
20+
- name: REDIS_DBNO
21+
valueFrom:
22+
configMapKeyRef:
23+
name: inventor
24+
key: REDIS_DBNO
25+
26+
- name: TTL_SECONDS
27+
valueFrom:
28+
configMapKeyRef:
29+
name: inventor
30+
key: TTL_SECONDS
31+
32+
- name: API_TOKEN
33+
valueFrom:
34+
secretKeyRef:
35+
name: inventor
36+
key: API_TOKEN
37+
38+
- name: SD_TOKEN
39+
valueFrom:
40+
secretKeyRef:
41+
name: inventor
42+
key: SD_TOKEN
43+
optional: true
44+
{{ end -}}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
kind: ConfigMap
2+
apiVersion: v1
3+
metadata:
4+
name: inventor
5+
data:
6+
{{- range $key, $value := .Values.config }}
7+
{{ $key }}: {{ $value | quote }}
8+
{{- end }}
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: inventor
5+
labels:
6+
app: inventor
7+
type: backend
8+
spec:
9+
revisionHistoryLimit: 2
10+
selector:
11+
matchLabels:
12+
app: inventor
13+
type: backend
14+
replicas: {{ default 1 .Values.replicas }}
15+
template:
16+
metadata:
17+
labels:
18+
app: inventor
19+
type: backend
20+
{{- if .Values.annotations }}
21+
annotations:
22+
{{- range $key, $value := .Values.annotations }}
23+
{{ $key }}: {{ $value | quote }}
24+
{{- end }}
25+
{{- end }}
26+
spec:
27+
containers:
28+
{{ if .Values.redis.enabled }}
29+
- name: redis
30+
imagePullPolicy: {{ .Values.redis.pullPolicy }}
31+
image: {{ .Values.redis.image | quote }}
32+
{{ end }}
33+
- name: main
34+
imagePullPolicy: {{ .Values.main.pullPolicy }}
35+
image: {{ .Values.main.image | quote }}
36+
env:
37+
{{ include "inventor.config" . | indent 10 }}
38+
readinessProbe:
39+
httpGet:
40+
path: /healthcheck
41+
port: 80
42+
initialDelaySeconds: 10
43+
periodSeconds: 60
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{{- if .Values.ingress.enabled }}
2+
apiVersion: networking.k8s.io/v1
3+
kind: Ingress
4+
metadata:
5+
name: inventor
6+
{{- if .Values.ingress.annotations }}
7+
annotations:
8+
{{- range $key, $value := .Values.ingress.annotations }}
9+
{{ $key }}: {{ $value | quote }}
10+
{{- end }}
11+
{{- end }}
12+
spec:
13+
{{- if .Values.ingress.ingressClassName }}
14+
ingressClassName: {{ .Values.ingress.ingressClassName }}
15+
{{- end }}
16+
{{- if .Values.ingress.tls }}
17+
tls:
18+
- hosts:
19+
- {{ .Values.ingress.host }}
20+
{{- if .Values.ingress.secretName }}
21+
secretName: {{ .Values.ingress.secretName }}
22+
{{- end }}
23+
{{- end }}
24+
rules:
25+
- host: {{ .Values.ingress.host }}
26+
http:
27+
paths:
28+
{{- range $path := .Values.ingress.paths }}
29+
- path: {{ $path }}
30+
pathType: ImplementationSpecific
31+
backend:
32+
service:
33+
name: inventor
34+
port:
35+
number: 80
36+
{{- end }}
37+
{{ end }}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
kind: Secret
2+
apiVersion: v1
3+
metadata:
4+
name: inventor
5+
data:
6+
{{- range $key, $value := .Values.secret }}
7+
{{ $key }}: {{ $value | toString | b64enc }}
8+
{{- end }}
9+
type: Opaque
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
kind: Service
2+
apiVersion: v1
3+
metadata:
4+
name: inventor
5+
{{- if .Values.service.annotations }}
6+
annotations:
7+
{{- range $key, $value := .Values.service.annotations }}
8+
{{ $key }}: {{ $value | quote }}
9+
{{- end }}
10+
{{- end }}
11+
labels:
12+
app: inventor
13+
type: backend
14+
spec:
15+
selector:
16+
app: inventor
17+
type: backend
18+
ports:
19+
- name: http
20+
protocol: TCP
21+
port: 80
22+
targetPort: 80
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{{- if .Values.servicemonitor.enabled }}
2+
kind: ServiceMonitor
3+
apiVersion: monitoring.coreos.com/v1
4+
metadata:
5+
name: inventor
6+
labels:
7+
app: inventor
8+
type: backend
9+
spec:
10+
endpoints:
11+
- interval: 60s
12+
path: /metrics
13+
port: http
14+
jobLabel: inventor
15+
selector:
16+
matchLabels:
17+
app: inventor
18+
type: backend
19+
{{- end -}}

0 commit comments

Comments
 (0)