Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
650dcdb
Change k3s.yaml from 127.0.0.1 to correct IP
alexandref75 Feb 16, 2023
a62665f
Fix chart version so artifacts are created
alexandref75 Feb 16, 2023
2d80457
Merge branch 'main' into test-k3s-edge
alexandref75 Feb 23, 2023
e91a93a
Fix k3s-start.sh script
alexandref75 Feb 23, 2023
eec846c
Merge branch 'main' into test-k3s-edge
alexandref75 Feb 23, 2023
9261c86
Allow grafana host to be renamed
alexandref75 Feb 24, 2023
dc9ade6
Merge branch 'main' into test-k3s-edge
alexandref75 Feb 24, 2023
eec371a
Add support for labeling node automatically
alexandref75 Feb 24, 2023
2a0e6e7
Merge branch 'main' into test-k3s-edge
alexandref75 Feb 25, 2023
aa7ed85
Adding terraform scripts
alexandref75 Feb 25, 2023
29f9489
Update of terraform for running smarter on EC2
alexandref75 Feb 27, 2023
76a8227
Fixing documentation and some leftover varibles
alexandref75 Feb 27, 2023
5d18bb7
Add support for traefik at nginx allowing use of letsencrypt
alexandref75 Feb 28, 2023
c163da3
Fixes for uysing traefik for nginx k3s configuration
alexandref75 Feb 28, 2023
c29dab3
Fix documentation to access nip.io for k3s-start.sh script
alexandref75 Feb 28, 2023
812e90c
Fix setting deployment-name
alexandref75 Feb 28, 2023
dbf1bdc
Organizing files on directory to simplify user interface
alexandref75 Feb 28, 2023
999c894
Put letsencrypt email a snot define so terraform ask for it
alexandref75 Feb 28, 2023
59b37e1
Add troubleshooting section
alexandref75 Mar 23, 2023
6bf1ce0
Fixes for traefik
alexandref75 Mar 23, 2023
31fa2c5
Merge branch 'main' into k3s-traefik
alexandref75 Mar 23, 2023
0d6e65c
Graviton instance
alexandref75 Mar 24, 2023
584f059
Merge branch 'main' into k3s-traefik
alexandref75 Mar 24, 2023
9ac5462
Anonymize
alexandref75 Mar 24, 2023
9b95c7b
A little more info for debugging
alexandref75 Mar 24, 2023
77378f1
Add letsencrypt_email as variable
alexandref75 Mar 29, 2023
67d8c64
Add timing and logging information
alexandref75 Mar 29, 2023
f5316d8
Add link to main README for terraform
alexandref75 Mar 29, 2023
93643ef
Add more external variables
alexandref75 Mar 29, 2023
4bd83f8
Add AWS_VPC_subnet_id as variable
alexandref75 Mar 29, 2023
3e9c112
Changed domain to <IP>.nip.io so Let's encrypt applies to the whole
alexandref75 Mar 30, 2023
154c03c
Add the extra variables
alexandref75 Mar 30, 2023
8109c18
FIx _ and < characters on README (markdown)
alexandref75 Mar 31, 2023
fde5a18
Syntax fixes
alexandref75 Mar 31, 2023
904b9fb
Add figure and more description
alexandref75 Apr 4, 2023
c102349
Fix reference to Terraform script
alexandref75 Apr 4, 2023
fb715d5
Rewrite main README to be clear on installation using terraform
alexandref75 Apr 4, 2023
94c6dfc
Fix README to put terraform first
alexandref75 Apr 4, 2023
0e74195
Add support for tfvars on README and a template
alexandref75 Apr 4, 2023
3e728cd
Change to template.tfvars
alexandref75 Apr 4, 2023
6fe2cd7
Change smarter-k3s-edge to be able to be embedded in another website
alexandref75 Apr 4, 2023
61cb5b2
Fix terraform to use grafana instead of k3s website
alexandref75 Apr 4, 2023
6612fcf
Merge branch 'main' into k3s-traefik
alexandref75 Apr 4, 2023
eb83670
Change to sslip.io and be a little more resilient
alexandref75 Apr 5, 2023
a43d982
Back to k3s host using sslip and waiting k3s to be alive to return
alexandref75 Apr 5, 2023
e5dae8c
Merge branch 'main' into k3s-traefik
alexandref75 Apr 5, 2023
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.11
version: 0.0.12
type: application
appVersion: v1.25.3-k3s1
description: K3s server on kubernetes
Expand Down
2 changes: 1 addition & 1 deletion charts/smarter-k3s-edge/templates/k3s-edge-ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ spec:
port:
number: {{ .Values.configuration.portHTTP }}
tls:
- secretName: {{ .Values.configuration.certificateID }}
- secretName: {{ default .Values.application.appName .Values.configuration.certificateID }}-tls
hosts:
- {{ .Values.configuration.host }}.{{ .Values.configuration.domain }}
---
Expand Down
1 change: 0 additions & 1 deletion charts/smarter-k3s-edge/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,3 @@ configuration:
# Uncomment to enable labeling for smarter-demo
#smarter_demo_labels: true
wwwpath: /
certificateID: "{{ .Values.application.appName }}-tls"
6 changes: 4 additions & 2 deletions terraform/k3s/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,13 @@ do
sleep 5
done
echo "----- Adding smarter-edge to k3s"
sudo su - ubuntu bash -c "helm install my-smartercloud-edge smarter/smarter-k3s-edge --set configuration.externalHostIP=$ADVERTISE_IP --set configuration.hostIP=$LOCAL_IP --set configuration.port=6444 --set configuration.portHTTP=80 --set configuration.id='${random_string.k3s_edge_id.result}' --set configuration.smarter_demo_labels=true --set configuration.host=grafana --set configuration.domain=$PUBLIC_HOSTNAME.sslip.io --set configuration.traefik=true --set configuration.certificateID=my-smartercloud-grafana-tls --set configuration.wwwpath=/k3s/ --wait"
#sudo su - ubuntu bash -c "helm install my-smartercloud-edge smarter/smarter-k3s-edge --set configuration.externalHostIP=$ADVERTISE_IP --set configuration.hostIP=$LOCAL_IP --set configuration.port=6444 --set configuration.portHTTP=80 --set configuration.id='${random_string.k3s_edge_id.result}' --set configuration.smarter_demo_labels=true --set configuration.host=grafana --set configuration.domain=$PUBLIC_HOSTNAME.sslip.io --set configuration.traefik=true --set configuration.certificateID=my-smartercloud-grafana-tls --set configuration.wwwpath=/k3s/ --wait"
sudo su - ubuntu bash -c "helm install my-smartercloud-edge smarter/smarter-k3s-edge --set configuration.externalHostIP=$ADVERTISE_IP --set configuration.hostIP=$LOCAL_IP --set configuration.port=6444 --set configuration.portHTTP=80 --set configuration.id='${random_string.k3s_edge_id.result}' --set configuration.smarter_demo_labels=true --set configuration.host=k3s --set configuration.domain=$PUBLIC_HOSTNAME.sslip.io --set configuration.traefik=true --set configuration.wwwpath=/ --wait"
echo "----- Waiting for k3s.yaml from k3s-edge"
until [ -f /home/ubuntu/k3s.yaml.${random_string.k3s_edge_id.result} ]
do
sudo su - ubuntu bash -c "wget --no-check-certificate https://grafana.$PUBLIC_HOSTNAME.sslip.io/k3s/k3s.yaml.${random_string.k3s_edge_id.result}"
#sudo su - ubuntu bash -c "wget --no-check-certificate https://grafana.$PUBLIC_HOSTNAME.sslip.io/k3s/k3s.yaml.${random_string.k3s_edge_id.result}"
sudo su - ubuntu bash -c "wget --no-check-certificate https://k3s.$PUBLIC_HOSTNAME.sslip.io/k3s.yaml.${random_string.k3s_edge_id.result}"
if [ -z "$(grep 'kind: Config' /home/ubuntu/k3s.yaml.${random_string.k3s_edge_id.result})" ]
then
echo "Received a file but it is not a k3s.yaml file, removing"
Expand Down
7 changes: 7 additions & 0 deletions terraform/smarter-main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,13 @@ module "k3s" {
security_group_ids = [aws_security_group.sg.id]
kubeconfig_mode = "644"
letsencrypt_email = var.letsencrypt_email

}

resource "null_resource" "k3s-wait" {
provisioner "local-exec" {
command = "until [ -z \"$(wget https://${format("k3s.%s.sslip.io",substr(split(".",module.k3s.instance.public_dns)[0],4,-1))}/k3s-start.sh.${module.k3s.k3s_edge.result} -O - 2>/dev/null)\" ];do sleep 5;done"
}
}

output "k3s_master_public_dns" {
Expand Down