3 Commits

Author SHA1 Message Date
01e4c38185 add a CronJob
All checks were successful
Ruby Lint / lint (push) Successful in 25s
Ruby Test / test (push) Successful in 17s
Release / docker (push) Successful in 18m45s
2025-06-29 15:01:53 -05:00
b33d4d92ad bundle update 2025-06-29 14:45:39 -05:00
b4941e435e add endpionts for cuid2 and ksuid 2025-06-29 14:44:58 -05:00
4 changed files with 42 additions and 2 deletions

View File

@@ -13,7 +13,7 @@ GEM
mini_mime (>= 1.0.0)
multi_xml (>= 0.5.2)
json (2.12.2)
jwt (3.1.1)
jwt (3.1.2)
base64
ksuid (1.0.0)
language_server-protocol (3.17.0.5)
@@ -102,7 +102,7 @@ GEM
rack-protection (= 4.1.1)
sinatra (= 4.1.1)
tilt (~> 2.0)
sorbet-runtime (0.5.12204)
sorbet-runtime (0.5.12210)
standard (1.50.0)
language_server-protocol (~> 3.17.0.2)
lint_roller (~> 1.0)

20
app.rb
View File

@@ -12,6 +12,8 @@ require "securerandom"
require "random/formatter"
require "ulid"
require "anyflake"
require "cuid2"
require "ksuid"
require "jwt"
@@ -362,6 +364,24 @@ get "/snowflake" do
end
end
get "/cuid2" do
n = params.fetch(:n, 1).to_i
stream do |out|
n.times do |_|
out << format("%s\n", Cuid2.generate)
end
end
end
get "/ksuid" do
n = params.fetch(:n, 1).to_i
stream do |out|
n.times do |_|
out << format("%s\n", KSUID.new)
end
end
end
post "/quit" do
Process.kill("TERM", ppid)
nil

View File

@@ -0,0 +1,19 @@
apiVersion: batch/v1
kind: CronJob
metadata:
name: kubernaut
spec:
schedule: "* * * * *"
jobTemplate:
spec:
template:
spec:
containers:
- name: hello
image: busybox:1.37
imagePullPolicy: IfNotPresent
command:
- /bin/sh
- -c
- echo "=^.^= <(meow)"
restartPolicy: OnFailure

View File

@@ -7,3 +7,4 @@ resources:
- deployment.yaml
- hpa.yaml
- services.yaml
- cronjob.yaml