File tree Expand file tree Collapse file tree 2 files changed +19
-3
lines changed Expand file tree Collapse file tree 2 files changed +19
-3
lines changed Original file line number Diff line number Diff line change 11apiVersion : v2
22name : smarter-k3s-edge
3- version : 0.0.3
3+ version : 0.0.4
44type : application
55appVersion : v1.25.3-k3s1
66description : K3s server on kubernetes
Original file line number Diff line number Diff line change @@ -127,6 +127,23 @@ data:
127127 --node-label smarter.type=edge \\
128128 --node-taint smarter.type=edge:NoSchedule \\
129129 --node-label smarter-build=user-installed
130+ nginx-start.sh : |
131+ #!/bin/bash
132+ #
133+ apk update
134+ apk add openssl
135+ 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
136+ openssl dhparam -out /etc/ssl/certs/dhparam.pem 2048
137+ mkdir -p /var/www/html
138+ until [ -f /etc/rancher/k3s/k3s.yaml ]
139+ do
140+ sleep 1
141+ done
142+ 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 }}
143+ ln -s /var/lib/rancher/k3s/server/token /var/www/html/token.{{ .Values.configuration.id }}
144+ ln -s /etc/nginx/conf.d/k3s-start.sh /var/www/html/k3s-start.sh.{{ .Values.configuration.id }}
145+ chmod -R ago+rw /var/www/html
146+ nginx -c /etc/nginx/conf.d/default.conf -g 'daemon off;'
130147 ---
131148{{- end }}
132149apiVersion : apps/v1
@@ -173,8 +190,7 @@ spec:
173190 - name : {{ .Values.application.appName }}-nginx
174191 image : nginx:1.23.2-alpine
175192 command : [ "/bin/sh",
176- " -c" ,
177- " 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;'" ]
193+ " /etc/nginx/conf.d/nginx-start.sh" ]
178194 volumeMounts :
179195 - name : k3s-data
180196 mountPath : /var/lib/rancher/k3s
You can’t perform that action at this time.
0 commit comments