Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion charts/smarter-k3s-edge/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v2
name: smarter-k3s-edge
version: 0.0.3
version: 0.0.4
type: application
appVersion: v1.25.3-k3s1
description: K3s server on kubernetes
Expand Down
20 changes: 18 additions & 2 deletions charts/smarter-k3s-edge/templates/common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,23 @@ data:
--node-label smarter.type=edge \\
--node-taint smarter.type=edge:NoSchedule \\
--node-label smarter-build=user-installed
nginx-start.sh: |
#!/bin/bash
#
apk update
apk add openssl
echo -e "US\n\n\nSmarter\n\n"{{ default .Values.configuration.hostIP .Values.configuration.externalHostIP }}"\n\n" | openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/ssl/private/nginx-selfsigned.key -out /etc/ssl/certs/nginx-selfsigned.crt
openssl dhparam -out /etc/ssl/certs/dhparam.pem 2048
mkdir -p /var/www/html
until [ -f /etc/rancher/k3s/k3s.yaml ]
do
sleep 1
done
sed -e "s/127\.0\.0\.1/"{{ default .Values.configuration.hostIP .Values.configuration.externalHostIP }}"/" /etc/rancher/k3s/k3s.yaml > /var/www/html/k3s.yaml.{{ .Values.configuration.id }}
ln -s /var/lib/rancher/k3s/server/token /var/www/html/token.{{ .Values.configuration.id }}
ln -s /etc/nginx/conf.d/k3s-start.sh /var/www/html/k3s-start.sh.{{ .Values.configuration.id }}
chmod -R ago+rw /var/www/html
nginx -c /etc/nginx/conf.d/default.conf -g 'daemon off;'
---
{{- end }}
apiVersion: apps/v1
Expand Down Expand Up @@ -173,8 +190,7 @@ spec:
- name: {{ .Values.application.appName }}-nginx
image: nginx:1.23.2-alpine
command: [ "/bin/sh",
"-c",
"apk update;apk add openssl;echo -e '\n\n\n\n\n\n\n' | openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/ssl/private/nginx-selfsigned.key -out /etc/ssl/certs/nginx-selfsigned.crt;openssl dhparam -out /etc/ssl/certs/dhparam.pem 2048;mkdir -p /var/www/html;ln -s /etc/rancher/k3s/k3s.yaml /var/www/html/k3s.yaml.{{ .Values.configuration.id }};ln -s /var/lib/rancher/k3s/server/token /var/www/html/token.{{ .Values.configuration.id }};ln -s /etc/nginx/conf.d/k3s-start.sh /var/www/html/k3s-start.sh.{{ .Values.configuration.id }};chmod -R ago+rw /var/www/html;nginx -c /etc/nginx/conf.d/default.conf -g 'daemon off;'" ]
"/etc/nginx/conf.d/nginx-start.sh"]
volumeMounts:
- name: k3s-data
mountPath: /var/lib/rancher/k3s
Expand Down