Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix cloud-init schema validation error when {{ growpart_str }} is not empty #432

Open
wants to merge 897 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
897 commits
Select commit Hold shift + click to select a range
b8a80e3
Merge pull request #345 from vitobotta:cluster-autoscaler-refactoring
vitobotta Apr 15, 2024
e8edb38
Fix syntax error on Github workflow
vitobotta Apr 15, 2024
1e8c06e
Add cluster autoscaler manifest URL setting to configuration
vitobotta Apr 15, 2024
20c2c2d
Refactor the Cluster Autoscaler installation to manipulate the manife…
vitobotta Apr 15, 2024
7dad80a
Fix command output
vitobotta Apr 15, 2024
5e0079b
Fix patching autoscaler container
vitobotta Apr 15, 2024
b9f2e47
Merge pull request #346 from vitobotta:cluster-autoscaler-yaml-patching
vitobotta Apr 15, 2024
33c4f91
Cleanup
vitobotta Apr 16, 2024
e0a99f3
Cleanup
vitobotta Apr 16, 2024
1f4b687
Cleanup
vitobotta Apr 16, 2024
e1c51e6
Remove duplication for: adding toleration
vitobotta Apr 16, 2024
afb9c7a
Cleanup
vitobotta Apr 16, 2024
6a8fb2a
Remove duplication for code that applies a kubectl command
vitobotta Apr 16, 2024
26db62a
Big refactoring!
vitobotta Apr 17, 2024
17c15de
Update README
vitobotta Apr 17, 2024
8000e41
Change Crystal extension
vitobotta Apr 17, 2024
0c9ec19
Limit concurrency
vitobotta Apr 17, 2024
8eb9d1c
Change max instances per placement group limit
vitobotta Apr 17, 2024
9355466
Print API response when server cannot be created
vitobotta Apr 17, 2024
7ff530d
Raise concurrency to 10
vitobotta Apr 17, 2024
c099511
Update README.md
vitobotta Apr 17, 2024
5cf5afa
Merge branch 'more-refactoring' of github.com:vitobotta/hetzner-k3s i…
vitobotta Apr 17, 2024
5745984
Raise concurrency
vitobotta Apr 17, 2024
65f4c3b
Cluster creation working fine
vitobotta Apr 17, 2024
77e970a
Cleanup
vitobotta Apr 17, 2024
a2a052c
Fix DNS issue
vitobotta Apr 18, 2024
5581c25
Fix kubelet args
vitobotta Apr 18, 2024
0f3903a
Add script to delete unscheduled pods
vitobotta Apr 18, 2024
d150ea4
Use a mutex to synchronise attaching instances to the network
vitobotta Apr 18, 2024
37d2e97
Change formatting of extra args
vitobotta Apr 18, 2024
2b66d2d
Do not sleep after attaching instance to netwrk
vitobotta Apr 18, 2024
88d10e5
Replace single subnet setting with private network settings
vitobotta Apr 18, 2024
8bcb77f
Handle configuration when private network is disabled
vitobotta Apr 18, 2024
bf4910e
Refactor configuration
vitobotta Apr 18, 2024
09bad78
Refactor configuration of manifests
vitobotta Apr 18, 2024
b449c05
Fix CNI validation
vitobotta Apr 18, 2024
2334049
Expand paths for the SSH keys
vitobotta Apr 18, 2024
29c4e5b
Cleanup
vitobotta Apr 18, 2024
387a2d0
Add missing cni variable to worker install script
vitobotta Apr 18, 2024
5a0747b
Synchronise attaching instances to network
vitobotta Apr 18, 2024
fd5ce34
Add missing public ip detection to worker install script
vitobotta Apr 18, 2024
17cc80e
Fix network name for Hetzner secret
vitobotta Apr 18, 2024
8a72c36
Update worker install script
vitobotta Apr 18, 2024
fe66ba2
Update worker install script
vitobotta Apr 18, 2024
3e3e309
Disable network policies as they cause problems
vitobotta Apr 18, 2024
07dc0a7
Install CCM without network support if private network is disabled
vitobotta Apr 18, 2024
e868af0
Fizes for supporting disabled private network
vitobotta Apr 19, 2024
6a7d71f
Don't wait when creating workers; creare placement groups concurrently
vitobotta Apr 19, 2024
f3ceb5a
Memoize token
vitobotta Apr 19, 2024
1ab889d
Disable CNI installation when CNI is disabled
vitobotta Apr 19, 2024
81ca5b1
Update log message for waiting instance to be running
vitobotta Apr 19, 2024
2c8da32
Allow dismissing output of shell command
vitobotta Apr 19, 2024
37005c5
Add script to reset Cilium network configuration
vitobotta Apr 19, 2024
a61f791
Cleanup
vitobotta Apr 19, 2024
5e133cd
Maximise use of placement groups
vitobotta Apr 19, 2024
dc48cf7
Fix issue with fetching placement group if there are more than 25
vitobotta Apr 19, 2024
4eaa120
Fix handling of placement groups
vitobotta Apr 19, 2024
6a3cf78
Delete placement groups when they are supposed to be deleted
vitobotta Apr 19, 2024
2405bf2
Apply firewall in non disruptive way
vitobotta Apr 19, 2024
323faf0
Validate presence of kubectl and helm in PATH
vitobotta Apr 19, 2024
0e85e61
Add native support for Cilium
vitobotta Apr 19, 2024
13b6f6d
Fix Cilium config
vitobotta Apr 19, 2024
496ff80
Fix support for publoic network-only clusters
vitobotta Apr 21, 2024
70634bb
Cleanup
vitobotta Apr 21, 2024
fda1b4f
Cleanup
vitobotta Apr 21, 2024
5c670ee
Fix Flannel config
vitobotta Apr 21, 2024
fc3f12d
Sort sans to reduce changes to the scripts
vitobotta Apr 21, 2024
69d99a8
Fix assignment to placement group
vitobotta Apr 21, 2024
fc22f6a
Reduce verbosity
vitobotta Apr 21, 2024
f1765b9
Update README with new cluster creation record
vitobotta Apr 21, 2024
92c2bc8
Update cluster creation time in README
vitobotta Apr 21, 2024
68d1ef3
Cleanup
vitobotta Apr 21, 2024
1fe608a
Change default image to Ubuntu 24.04
vitobotta Apr 27, 2024
2ee119b
Only process 10 servers per time
vitobotta Apr 27, 2024
233f5e9
Deploy k3s on ready nodes while creating other nodes
vitobotta Apr 27, 2024
d1b2a82
LImit channels size
vitobotta Apr 27, 2024
19d8f6b
Introduce state file
vitobotta Apr 27, 2024
da4a1aa
Add cilium and calicoctl to .gitignore
vitobotta Apr 27, 2024
d618ae0
Refactor Hetzner::Client methods to handle rate limiting and response…
vitobotta Apr 27, 2024
087b673
Open node port range in firewall
vitobotta Apr 27, 2024
e689d18
Open wireguard port for Cilium
vitobotta Apr 27, 2024
47fc698
Update default image to Ubuntu 24.04
vitobotta Apr 27, 2024
bc0d624
Refactor Hetzner API client to exit early if locations or instance ty…
vitobotta Apr 27, 2024
df110ee
Use retriable to retry requests
vitobotta Apr 27, 2024
fe87923
Cleanup
vitobotta Apr 28, 2024
fe13372
Print remaining time
vitobotta Apr 28, 2024
1ff22f3
Use a Tuple instead of Array
vitobotta Apr 28, 2024
e2a21b1
Reduce API calls by finding existing nodes with kubectl
vitobotta Apr 28, 2024
fb6a3a1
Retry request
vitobotta Apr 28, 2024
3851baf
Return result of SSH command
vitobotta Apr 28, 2024
ab63240
Add a warning about cluster_dns and service_cidr in examples
jpetazzo Apr 28, 2024
dbe7576
Merge pull request #352 from jpetazzo/add-cluster-dns-warning-in-example
vitobotta Apr 28, 2024
943d7f2
Add build instructions
jpetazzo Apr 28, 2024
30b59c9
Ignore cluster info if kubeconfig is not available
vitobotta Apr 28, 2024
0f9eb76
Omit output if disabled
vitobotta Apr 28, 2024
291ccb0
Rename Flannel class to CNI and add mode attribute to choose which CN…
vitobotta Apr 28, 2024
ca83227
Add CNI mode attributes and helper methods to CNI configuration class
vitobotta Apr 28, 2024
00dee0d
Refactor Kubernetes::Installer to use CNI configuration for flannel b…
vitobotta Apr 28, 2024
c678903
Remove cluster state class
vitobotta Apr 28, 2024
7263892
Refactor Kubernetes::Installer to install Cilium CNI when selected as…
vitobotta Apr 28, 2024
6334561
Make Cilium chart version configurable
vitobotta Apr 28, 2024
58f28f3
Enable Wireguard encryption for Cilium only if encryption has been en…
vitobotta Apr 28, 2024
6ddc910
Update Cilium chart version to v1.15.4
vitobotta Apr 28, 2024
1031f9d
Enable different Wireguard ports dpending on CNI
vitobotta Apr 28, 2024
1ff9c01
Refactor CNI configuration to enable/disable kube-proxy based on CNI …
vitobotta Apr 28, 2024
679cca2
Refactor Kubernetes::Installer to install Spegel when enabled
vitobotta Apr 28, 2024
897e951
Add missing require
vitobotta Apr 28, 2024
840ac45
Merge branch 'main' into more-refactoring
vitobotta Apr 28, 2024
7ccc10b
Merge pull request #355 from jpetazzo/add-build-instructions
vitobotta Apr 28, 2024
3c8580b
Add logo
vitobotta Apr 28, 2024
df4f551
Add instructions about VSCode
jpetazzo Apr 28, 2024
d8c47b0
Merge pull request #357 from jpetazzo/add-vscode-instrucdtions
vitobotta Apr 28, 2024
ee5e594
Merge branch 'main' into more-refactoring
vitobotta Apr 28, 2024
ef356ed
Refactor firewall rule description for wireguard traffic
vitobotta Apr 28, 2024
30aafc6
Fix condition in Kubernetes::Installer to check if cluster is running
vitobotta May 1, 2024
7c85ead
Fixed a recursion issue
vitobotta May 1, 2024
8dc9fde
Remove duplicate method definition
vitobotta May 1, 2024
c1cab80
Cilium: fix deletion of unmanaged pods after installing
vitobotta May 1, 2024
3ea9d95
Use internal ip in firewall when CCM hasn't been installed yet but ma…
vitobotta May 1, 2024
0af97e8
Cleanup
vitobotta May 1, 2024
9cd47af
Fix syntax
vitobotta May 1, 2024
b04f0a0
Fix issues due to concurrent access to properties
vitobotta May 1, 2024
8cd91e3
Delete kubeconfig file when deleting the cluster
vitobotta May 1, 2024
c945eef
Sort placement groups by name so the list is always consistent
vitobotta May 1, 2024
e8d857f
Remove code that kills unmanaged pods when installing cilium
vitobotta May 1, 2024
a98419c
Pass settings to instance delete
vitobotta May 1, 2024
b7302a3
Pass settings to initializer for instance finder
vitobotta May 1, 2024
74e48c4
Enable SSH support for instance deletion
vitobotta May 1, 2024
047808e
Add SSH support to instance finder
vitobotta May 1, 2024
59a77c1
Cleanup
vitobotta May 1, 2024
9b54564
Randomize script filename
vitobotta May 1, 2024
10b5c65
Fix placement group assignment
vitobotta May 1, 2024
315e7b1
Fix creation of remaining placement groups
vitobotta May 1, 2024
bdacc14
Raise concurency to 25
vitobotta May 1, 2024
15f1246
Start installing software before setting up worker nodes
vitobotta May 1, 2024
7e4536c
Raise concurrency to 50
vitobotta May 1, 2024
3ed7647
Use a mutex for rate limit wait msg
vitobotta May 1, 2024
1a90ee0
Start the server on creation if private network is disabled
vitobotta May 1, 2024
fad7011
Cheeck if API server is reachable before checking for existence of se…
vitobotta May 2, 2024
e1e7677
Start instance on create if there is no private network
vitobotta May 2, 2024
cf468ef
Add support for embedded registry mirror
vitobotta May 2, 2024
9fd68e3
Remove extra arg left by mistake
vitobotta May 2, 2024
d824c12
Change ipam mode so not to cause Cilium network to overlap with hetzn…
vitobotta May 2, 2024
afcf2de
Reorder the instructions to move the necessary steps before checking …
khustochka May 6, 2024
ab29910
Merge pull request #359 from khustochka/reorder-instructions
vitobotta May 6, 2024
9770705
Upgrade Alpine version
vitobotta Jun 22, 2024
bc717c2
fix: k3s install only AFTER cloud init is done
Jul 15, 2024
3f11f64
Formatting fix (spaces)
Jul 15, 2024
4aaec73
Merge pull request #380 from axiros/main
vitobotta Jul 16, 2024
ca97798
Fix deprecation
vitobotta Jul 22, 2024
f2d6875
Merge branch 'main' into more-refactoring
vitobotta Jul 22, 2024
8124b48
Retry creating the instance
vitobotta Jul 23, 2024
88e306d
Fix detection of whether the cluster is ready or not
vitobotta Jul 23, 2024
22a9fdd
Do not include instance type in instance name by default, make it opt…
vitobotta Jul 23, 2024
728cb8a
Increase timeout for SSH connections to 5 seconds
vitobotta Jul 23, 2024
bcde429
Print a message when creating an instance fails
vitobotta Jul 23, 2024
bc3e2d3
Add support for Hillsboro region
vitobotta Jul 23, 2024
aae0c98
Add current timestamp to each log line
vitobotta Jul 23, 2024
07a6aad
Fix setting network for autoscaled instances
vitobotta Jul 23, 2024
6be1c97
Upgrade CSI driver
vitobotta Jul 23, 2024
9876720
Do not open etcd ports if using external datastore
vitobotta Jul 23, 2024
958eb30
Upgrade Cilium to latest version
vitobotta Jul 23, 2024
470e3b9
Enable local path provisioner
vitobotta Jul 23, 2024
bf52992
Split documentation into multiple files
vitobotta Jul 23, 2024
ba7f5e7
Improve docs
vitobotta Jul 23, 2024
ae266ec
Add note about external datastores to the recommendations page
vitobotta Jul 23, 2024
5b72f2e
Add note about helm to prerequisites
vitobotta Jul 24, 2024
9a0b5a3
Move section to more relevant page
vitobotta Jul 24, 2024
24491a5
Add blank line to avoid confusion
vitobotta Jul 24, 2024
193c867
Update default k3s version
vitobotta Jul 24, 2024
4174189
Ensure worker scripts also wait for cloud init to finish its stuff
vitobotta Jul 24, 2024
5e2da31
apply enable_public_net_ipv4 and enable_public_net_ipv6 to autoscaler…
Funzinator Jul 19, 2024
18700ad
Merge pull request #381 from Funzinator/main
vitobotta Jul 24, 2024
bb0c820
Merge branch 'main' into more-refactoring
vitobotta Jul 24, 2024
b4eefbf
Fix setting names
vitobotta Jul 25, 2024
f39396e
Fix instance names for labels and taints
vitobotta Jul 25, 2024
71745b7
Fix support for multiline post create commands
vitobotta Jul 25, 2024
424d81f
Add a couple of clarifying comments in sample conf
jpetazzo Jul 30, 2024
6dcfb15
Merge pull request #392 from jpetazzo/add-clarifying-comments-in-samp…
vitobotta Jul 30, 2024
3b7762e
Timeout increase 30->60s
Jul 30, 2024
abbde98
chore: #389 Cloud init wait improvements
Jul 30, 2024
b6a05b0
Merge pull request #393 from axiros/more-refactoring
vitobotta Jul 30, 2024
df3b681
fix: #393 My wait function definition was buggy, causing autoscaler c…
Jul 31, 2024
5ca5e81
Merge pull request #394 from axiros/more-refactoring
vitobotta Jul 31, 2024
d379982
Update Setting up a cluster.md
axgkl Aug 2, 2024
d62c8b9
Merge pull request #398 from axgkl/patch-2
vitobotta Aug 4, 2024
9a60d92
Use correct config setting to enable encryption with Cilium
vitobotta Aug 4, 2024
abfacb1
Merge branch 'more-refactoring' of github.com:vitobotta/hetzner-k3s i…
vitobotta Aug 4, 2024
10c5a62
Merge branch 'main' into more-refactoring
vitobotta Aug 6, 2024
a9b0674
fix: Filter cloud init wait
Aug 7, 2024
b867654
fix: solve timeout when api server hostname is given
Aug 7, 2024
cfd3673
Fix SSH when using non-default port + add test harness
jpetazzo Jul 29, 2024
b8b721e
Attach instance to network automatically
vitobotta Aug 12, 2024
bd745d9
Merge pull request #405 from axiros/filter-cloud-init-wait-for-autosc…
vitobotta Aug 12, 2024
ae4230c
Merge pull request #391 from jpetazzo/fix-ssh-port-customization
vitobotta Aug 17, 2024
b02f9d7
Merge pull request #407 from axiros/api-server
vitobotta Aug 17, 2024
7f1442a
Restore change removed by mistake
vitobotta Aug 18, 2024
60e1126
Fix handling of custom SSH port when openssh server is configured for…
vitobotta Aug 18, 2024
b000a04
Improve handling of the script to wait for cloud init to finish
vitobotta Aug 18, 2024
d0cd104
Improve log message to tell user to delete autoscaled nodes if firewa…
vitobotta Aug 18, 2024
a1e0fff
Attach instance to network if it doesn't happen automatically as expe…
vitobotta Aug 18, 2024
6fa526b
WIP
vitobotta Aug 18, 2024
7eade3c
User multiple contexts instead of load balancer
vitobotta Aug 18, 2024
e3d5e44
Upgrade CSI
vitobotta Aug 18, 2024
37f2016
Update CSI manifest url
vitobotta Aug 18, 2024
0007caf
Automatically delete autoscaled nodes
vitobotta Aug 18, 2024
6e4fcc6
Update version
vitobotta Aug 18, 2024
173f4d1
Update log message
vitobotta Aug 18, 2024
cc03f6a
Update version in docs
vitobotta Aug 18, 2024
674cc9f
Update version in docs
vitobotta Aug 18, 2024
b822ad8
Update README
vitobotta Aug 18, 2024
97cb521
Merge pull request #348 from vitobotta:more-refactoring
vitobotta Aug 18, 2024
2607d05
Cleanup
vitobotta Aug 18, 2024
d2ced88
Docs: add mention that the api must be world accessible when the priv…
vitobotta Aug 19, 2024
b1ccf08
If the private network is available, then use the private IP to reach…
vitobotta Aug 19, 2024
67ca42a
Bump version
vitobotta Aug 19, 2024
5172b14
Bump version in the links
vitobotta Aug 19, 2024
05f5ee7
Fix release for Intel macs
vitobotta Aug 19, 2024
f1c8ab8
Bump version in docs
vitobotta Aug 19, 2024
e454b88
Update installation doc
vitobotta Aug 19, 2024
8dc6dc2
Always open port in the firewall if embedded registry is enabled
vitobotta Aug 19, 2024
70c148d
Bump version
vitobotta Aug 19, 2024
62ff387
Update README.md (#1)
zajdee Aug 20, 2024
22ab924
Add some NAT doc in Setting up a cluster.md
Aug 20, 2024
acb6877
Merge pull request #416 from zajdee/main
vitobotta Aug 20, 2024
2a81145
Merge pull request #417 from Jboulery/add-some-nat-doc
vitobotta Aug 20, 2024
b77d03c
Use IpInfo.io to detect current IP address
vitobotta Aug 23, 2024
0b203e7
Merge branch 'main' of github.com:vitobotta/hetzner-k3s
vitobotta Aug 23, 2024
329e026
Bump version
vitobotta Aug 23, 2024
6a42f85
Bump version in the docs
vitobotta Aug 23, 2024
ae0fb2a
Configure memory requests for Cilium
vitobotta Aug 24, 2024
74d7fed
Update Installation.md
fishuke Aug 24, 2024
ae7dafb
Merge pull request #422 from fishuke/patch-1
vitobotta Aug 25, 2024
7cda8d2
Upgrade `crest` shard
n7st Aug 25, 2024
50babf3
Merge pull request #423 from n7st/main
vitobotta Aug 26, 2024
c357daa
Bump version
vitobotta Aug 26, 2024
74da9f6
Bump version in the docs
vitobotta Aug 26, 2024
0881bcd
Use hashes instead of namedtuples due to a change in the Crest library
vitobotta Aug 29, 2024
73af877
Bump version
vitobotta Aug 29, 2024
b6ad785
Update config example in tutorial
vitobotta Aug 29, 2024
1867799
chore: Update hetzner-k3s download links to v2.0.6
vitobotta Aug 29, 2024
c3c593a
Update tutorial
vitobotta Aug 30, 2024
51d5f4f
Use Hetzner autoscaler image
vitobotta Aug 30, 2024
500da2c
Bump version in links
vitobotta Aug 30, 2024
91eed4c
Fixed an issue with detection of private network for autoscaled nodes
vitobotta Aug 30, 2024
4b98dd6
chore: Update hetzner-k3s download links to v2.0.8
vitobotta Aug 30, 2024
3eaa3e8
add link to Setting up a cluster.md
lauw70 Aug 31, 2024
8e29f9f
update docs to make nginx default ingress class
lauw70 Aug 31, 2024
cc73a0a
Merge pull request #431 from lauw70/nginx-default-ingress-class
vitobotta Aug 31, 2024
0b17e56
fix cloud-init schema validation when {{ growpart_str }} is not empty
Sep 1, 2024
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
131 changes: 131 additions & 0 deletions .devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
{
"name": "${localWorkspaceFolder}",

"dockerComposeFile": [
"docker-compose.yml",
"docker-compose.override.yml"
],

"service": "hetzner-k3s",

"workspaceFolder": "/home/app/hetzner-k3s",

"shutdownAction": "stopCompose",

"customizations": {
"vscode": {
"extensions": [
"formulahendry.auto-close-tag",
"formulahendry.auto-rename-tag",
"aaron-bond.better-comments",
"angelomollame.conflict-squeezer",
"ms-vscode-remote.remote-containers",
"ms-azuretools.vscode-docker",
"mikestead.dotenv",
"kaiwood.endwise",
"usernamehw.errorlens",
"ninoseki.vscode-gem-lens",
"mhutchie.git-graph",
"donjayamanne.githistory",
"github.vscode-github-actions",
"GitHub.vscode-pull-request-github",
"GitHub.remotehub",
"codezombiech.gitignore",
"eamodio.gitlens",
"ZainChen.json",
"ziyasal.vscode-open-in-github",
"christian-kohler.path-intellisense",
"wayou.vscode-todo-highlight",
"redhat.vscode-xml",
"redhat.vscode-yaml",
"mutantdino.resourcemonitor",
"technosophos.vscode-helm",
"jgillich.crystal-lang-fixed"
// "crystal-lang-tools.crystal-lang"
],
"recommendations": [
"GitHub.copilot",
"GitHub.copilot-chat",
"JeroenV.github-copilot-with-context"
],
"settings": {
"editor.tabSize": 2,
"editor.wordWrapColumn": 200,
"editor.renderWhitespace": "all",
"editor.accessibilitySupport": "off",
"editor.inlineSuggest.enabled": true,
"editor.bracketPairColorization.enabled": true,
"editor.foldingImportsByDefault": true,
"editor.tabCompletion": "on",
"editor.fontFamily": "Source Code Pro",
"editor.linkedEditing": true,
"editor.stickyScroll.enabled": true,

"diffEditor.codeLens": true,

"files.trimTrailingWhitespace": true,
"files.insertFinalNewline": true,
"files.exclude": {
"**/.history": true
},

"terminal.integrated.defaultProfile.linux": "zsh",
"terminal.integrated.shell.linux": "/bin/zsh",
"terminal.integrated.cwd": "/home/app/hetzner-k3s",
"terminal.integrated.allowChords": false,
"terminal.explorerKind": "integrated",
"terminal.integrated.shellIntegration.enabled": true,
"terminal.integrated.scrollback": 20000,

"scm.autoReveal": false,

"git.autofetch": true,
"git.pruneOnFetch": true,
"git.openRepositoryInParentFolders": "never",

"gitlens.ai.experimental.provider": "openai",
"gitlens.ai.experimental.openai.model": "gpt-4-turbo-preview",

"githubPullRequests.pullBranch": "never",

"github.copilot.enable": {
"*": true,
"plaintext": false,
"markdown": false,
"scminput": false,
"yaml": true
},

"security.workspace.trust.untrustedFiles": "open",

"redhat.telemetry.enabled": false,

"yaml.schemas": {
"kubernetes": "*.yaml,*.yml"
},

"workbench.commandPalette.preserveInput": true,
"workbench.startupEditor": "none",
"workbench.editor.closeOnFileDelete": true,
"workbench.editor.highlightModifiedTabs": true,
"workbench.editor.autoLockGroups": {
"terminalEditor": false
},

"explorer.openEditors.visible": 1,
"explorer.autoReveal": false,
"explorer.confirmDragAndDrop": false,

"[json]": {
"editor.defaultFormatter": "vscode.json-language-features"
},

"telemetry.telemetryLevel": "off"
}
}
},

"containerEnv": {
"PROJECT": "${localWorkspaceFolder}"
}
}
9 changes: 9 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
root = true

[*.cr]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 2
trim_trailing_whitespace = true
4 changes: 4 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# These are supported funding model platforms

github: [vitobotta]

85 changes: 85 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: Create release

on:
push:
tags:
- 'v*'

jobs:

build_releases:
name: Build binary - ${{ matrix.binary_os_suffix }}-${{ matrix.binary_arch_suffix }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VERSION: ${{ github.ref_name }}
MESSAGE: "WIP"
FILENAME: hetzner-k3s-${{ matrix.binary_os_suffix }}-${{ matrix.binary_arch_suffix }}

strategy:
matrix:
include:
- runs_on_tag: macos-13
binary_os_suffix: macos
binary_arch_suffix: amd64
- runs_on_tag: macos-14
binary_os_suffix: macos
binary_arch_suffix: arm64
architecture: arm
- runs_on_tag: ubuntu-22.04
binary_os_suffix: linux
binary_arch_suffix: arm64
arch: aarch64
distro: alpine_latest
- runs_on_tag: ubuntu-24.04
binary_os_suffix: linux
binary_arch_suffix: amd64
arch: none
distro: none
base_image: amd64/alpine

runs-on: ${{ matrix.runs_on_tag }}

steps:
- name: Checkout code
uses: actions/checkout@v3
with:
set-safe-directory: '/home/runner/work/hetzner-k3s/hetzner-k3s'

- if: matrix.binary_os_suffix == 'macos'
name: macos build step
run: |
brew install crystal libssh2 openssl@3
shards install --without-development
crystal build src/hetzner-k3s.cr --release
chmod +x hetzner-k3s
cp hetzner-k3s ${{ env.FILENAME }}

- if: matrix.binary_os_suffix == 'linux'
uses: uraimo/run-on-arch-action@v2
name: linux build step
with:
arch: ${{ matrix.arch }}
distro: ${{ matrix.distro }}
base_image: ${{ matrix.base_image }}

shell: /bin/sh

install: |
apk update
apk add --update --no-cache gcc gmp-dev libevent-static musl-dev pcre-dev pcre2-dev libxml2-dev \
libxml2-static openssl-dev openssl-libs-static tzdata yaml-static zlib-static xz-static \
make git autoconf automake libtool patch libssh2-static libssh2-dev crystal shards

run: |
shards install --without-development
crystal build src/hetzner-k3s.cr --release --static
cp hetzner-k3s ${{ env.FILENAME }}

- name: Publish new version
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ env.GITHUB_TOKEN }}
file: ${{ env.FILENAME }}
tag: ${{ env.VERSION }}
overwrite: true
body: ${{ env.MESSAGE }}
24 changes: 24 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,27 @@
.rspec_status
/kubeconfig
/cluster_config.yaml
dist/hetzner-k3s.jar
dist/hetzner-k3s

/lib/
/bin/
/.shards/
*.dwarf
hetzner-k3s
k3s-releases.yaml
actions-runner
/.idea/
.DS_Store
.env.vars
.zsh_history
temp
docker-compose.override.yml
cilium
calicoctl

e2e-tests/env
e2e-tests/sshkey*
e2e-tests/test-*
create.log
delete.log
3 changes: 0 additions & 3 deletions .rspec

This file was deleted.

6 changes: 0 additions & 6 deletions .travis.yml

This file was deleted.

63 changes: 63 additions & 0 deletions .zshrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
ZSH=$HOME/.oh-my-zsh

autoload -U +X compinit && compinit
autoload -U +X bashcompinit && bashcompinit

plugins=(zsh-autosuggestions kubectl kubectx git-prompt)

export LC_CTYPE=en_US.UTF-8
export LC_ALL=en_US.UTF-8
export EDITOR='code --wait'
export VISUAL='code --wait'
export TERM=xterm-256color
export XDG_CONFIG_HOME=$HOME/.config
export ZSH_AUTOSUGGEST_ACCEPT_WIDGETS=("${(@)ZSH_AUTOSUGGEST_ACCEPT_WIDGETS:#forward-char}")
export PATH="/home/app/hetzner-k3s/bin:$HOME/.krew/bin:./bin:$HOME/bin:$GOPATH/bin:$PATH"
export HISTFILE="/home/app/hetzner-k3s/.zsh_history"

source $ZSH/oh-my-zsh.sh
source <(kubectl completion zsh)
source <(stern --completion=zsh)

alias k="kubectl"
alias stern="stern -s 1s"

bindkey '^a' autosuggest-accept
bindkey '\C-[OC' forward-word # ctrl-right
bindkey "\e[1;5C" forward-word # ctrl-right

ulimit -n 65536

setTerminalText () {
local mode=$1 ; shift
echo -ne "\033]$mode;$@\007"
}

stt_title () {
setTerminalText 2 $@;
}

k8s_prompt_info() {
local ctx=$(kubectl config current-context 2>/dev/null)
local ns=$(kubectl config view --minify --output 'jsonpath={..namespace}' 2>/dev/null)

if [[ -n $ctx ]]; then
echo "[%{$fg_bold[green]%}$ctx%{$reset_color%}:%{$fg_bold[blue]%}$ns%{$reset_color%}]"
fi
}

PROMPT='[${${PROJECT##*/}%}] %~%b $(git_super_status) $(k8s_prompt_info)%\> '
RPROMPT='%T'

set -a
source /home/app/hetzner-k3s/.env.vars
set +a

echo "*" > /home/app/hetzner-k3s/tmp/.gitignore
echo "!.gitignore" >> /home/app/hetzner-k3s/tmp/.gitignore

eval "$(ssh-agent -s)"

ssh-add -k ~/.ssh/id_*[!.pub]

clear
41 changes: 41 additions & 0 deletions Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
FROM alpine:3.20.1

RUN apk update \
&& apk add --update --no-cache gcc gmp-dev libevent-static musl-dev pcre-dev pcre2-dev libxml2-dev \
libxml2-static openssl-dev openssl-libs-static tzdata yaml-static zlib-static xz-static \
make git autoconf automake libtool patch libssh2-static libssh2-dev crystal shards \
curl docker zsh bash openssl k9s shadow go \
gcc g++ libc-dev libxml2-dev openssl-dev yaml-dev zlib-dev crystal openssh-client

RUN curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/$(uname -m | sed -e 's/x86_64/amd64/' -e 's/aarch64/arm64/')/kubectl" && chmod +x ./kubectl && mv ./kubectl /usr/local/bin/kubectl

RUN sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" \
&& git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions

RUN set -x; cd "$(mktemp -d)" \
&& OS="$(uname | tr '[:upper:]' '[:lower:]')" \
&& ARCH="$(uname -m | sed -e 's/x86_64/amd64/' -e 's/\(arm\)\(64\)\?.*/\1\2/' -e 's/aarch64$/arm64/')" \
&& KREW="krew-${OS}_${ARCH}" \
&& curl -fsSLO "https://github.com/kubernetes-sigs/krew/releases/latest/download/${KREW}.tar.gz" \
&& tar zxvf "${KREW}.tar.gz" \
&& ./"${KREW}" install krew \
&& PATH="$HOME/.krew/bin:$PATH" kubectl krew install ctx \
&& PATH="$HOME/.krew/bin:$PATH" kubectl krew install ns

RUN curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash

ENV GOPATH=/root/go

RUN mkdir -p $GOPATH/bin

RUN go install github.com/stern/stern@latest

SHELL ["/bin/zsh", "-c"]

RUN echo '/bin/zsh' | chsh `whoami`

RUN rm /root/.zshrc && ln -s /home/app/hetzner-k3s/.zshrc /root/.zshrc

ENV DEVCONTAINER=true

CMD ["tail", "-f", "/dev/null"]
7 changes: 0 additions & 7 deletions Gemfile

This file was deleted.

Loading