4 Commits

Author SHA1 Message Date
d50a40259d chore(release): 1.0.1 [skip ci]
## [1.0.1](http://gitea.gitea.svc.cluster.local:3000/djpbessems/ContainerImage.SpamasaurusRex/compare/v1.0.0...v1.0.1) (2024-02-28)

### Bug Fixes

* Align chart port configuration and health/readiness endpoints w/ golang code ([d81ca32](d81ca32460))
2024-02-28 10:39:48 +00:00
c26a7295b9 Merge branch 'main' of https://code.spamasaurus.com/djpbessems/ContainerImage.SpamasaurusRex
All checks were successful
Container & Helm chart / Semantic Release (Dry-run) (push) Successful in 27s
Container & Helm chart / Helm chart (push) Successful in 16s
Container & Helm chart / Container image (push) Successful in 1m15s
Container & Helm chart / Semantic Release (push) Successful in 25s
2024-02-28 21:37:18 +11:00
d81ca32460 fix: Align chart port configuration and health/readiness endpoints w/ golang code 2024-02-28 21:36:06 +11:00
f1e0a25d1c chore: Remove redundant chart templating 2024-02-28 21:31:23 +11:00
4 changed files with 12 additions and 135 deletions

View File

@ -1,3 +1,10 @@
## [1.0.1](http://gitea.gitea.svc.cluster.local:3000/djpbessems/ContainerImage.SpamasaurusRex/compare/v1.0.0...v1.0.1) (2024-02-28)
### Bug Fixes
* Align chart port configuration and health/readiness endpoints w/ golang code ([d81ca32](http://gitea.gitea.svc.cluster.local:3000/djpbessems/ContainerImage.SpamasaurusRex/commit/d81ca32460e5c87b49507f8163c6e64c3d2c8f15))
# 1.0.0 (2024-02-28)

View File

@ -1,96 +0,0 @@
{{- if not .Values.jsonServer.seedData.existingConfigMap }}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ .Release.Name }}-configmap
data:
index.html: |
<html>
<head>
<link
rel="stylesheet"
href="https://use.fontawesome.com/releases/v5.8.2/css/all.css"
integrity="sha384-oS3vJWv+0UjzBfQzYUhtDYW+Pj2yciDJxpsK1OYPAYjqT085Qq/1cq5FLXAZQ7Ay"
crossorigin="anonymous"
/>
<link rel="stylesheet" href="style.css" />
<title>JSON Server</title>
</head>
<body>
<header>
<div class="container">
<nav>
<ul>
<li class="title">
JSON Server
</li>
</ul>
</nav>
</div>
</header>
<main>
<div class="container">
<h1>Congrats!</h1>
<p>
You're successfully running JSON Server
<br />
✧*。٩(ˊᗜˋ*)و✧*。
</p>
<div id="resources"></div>
</div>
</main>
<footer>
<div class="container">
<p>
Howdy mates!
</p>
</div>
</footer>
<script src="script.js"></script>
</body>
</html>
update.sh: |
#!/bin/bash
while getopts u: flag
do
case "${flag}" in
u) URL=${OPTARG};;
esac
done
[[ $(getent hosts $URL) ]] || {
echo 'Could not resolve' $URL
exit 1
}
echo '['$(date "+%Y-%m-%d %H:%M:%S")'] Started polling helm releases with 60 second interval'
while sleep 60;
do
echo '['$(date "+%Y-%m-%d %H:%M:%S")']' $(curl -ks https://$URL/components | jq length) 'known releases in database'
for entry in $(helm list --all-namespaces --output json | jq -r '.[] | @base64'); do
RELEASE=$(echo $entry | base64 -d | jq -cS '.type="helm" | del(.namespace, .revision, .status)')
APP_NAME=$(echo $RELEASE | jq -r '.name')
APP_ID=$(curl -ks https://$URL/components?name=$APP_NAME | jq -r '.[0].id')
# Release is not yet in database
[ "$APP_ID" == null ] && {
curl -ks -X POST https://$URL/components -H 'Content-Type: application/json' --data "$RELEASE" -o /dev/null
}
# Release is already in database
[ "$APP_ID" != null ] && {
curl -ks -X PATCH https://$URL/components/$APP_ID -H 'Content-Type: application/json' --data "$RELEASE" -o /dev/null
}
done
done
db.json: |
{{ include "common.tplvalues.render" ( dict "value" .Values.jsonServer.seedData.configInline "context" $) | indent 4 }}
{{- end -}}

View File

@ -29,56 +29,22 @@ spec:
- name: {{ .Chart.Name }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.jsonServer.image.repository }}:{{ .Values.jsonServer.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.jsonServer.image.pullPolicy }}
image: "{{ .Values.spamasaurusRex.image.repository }}:{{ .Values.spamasaurusRex.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.spamasaurusRex.image.pullPolicy }}
ports:
- name: http
containerPort: {{ .Values.service.port }}
protocol: TCP
livenessProbe:
httpGet:
path: /
path: /health
port: http
readinessProbe:
httpGet:
path: /
path: /readiness
port: http
resources:
{{- toYaml .Values.resources | nindent 12 }}
volumeMounts:
- name: {{ .Release.Name }}-configmap
mountPath: /data/db.json
subPath: db.json
- name: {{ .Release.Name }}-configmap
mountPath: /usr/local/lib/node_modules/spamasaurusrex/public/index.html
subPath: index.html
- name: {{ .Chart.Name }}-sidecar
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.sidecar.image.repository }}:{{ .Values.sidecar.image.tag }}"
imagePullPolicy: {{ .Values.sidecar.image.pullPolicy }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
command:
- /bin/bash
- -c
- "/opt/update.sh -u {{ .Values.sidecar.targetUrl }}"
volumeMounts:
- name: {{ .Release.Name }}-configmap
mountPath: /opt/update.sh
subPath: update.sh
volumes:
- name: {{ .Release.Name }}-configmap
configMap:
name: {{ .Release.Name }}-configmap
items:
- key: db.json
path: db.json
- key: index.html
path: index.html
- key: update.sh
path: update.sh
mode: 0744
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}

View File

@ -37,7 +37,7 @@ securityContext: {}
service:
type: ClusterIP
port: 80
port: 8080
ingress:
enabled: true