Compare commits

...

2 Commits

Author SHA1 Message Date
eaf642ca49
Add /status/:code
Some checks failed
Gitea Actions Demo / test (push) Blocked by required conditions
Gitea Actions Demo / release-image (push) Blocked by required conditions
Gitea Actions Demo / lint (push) Has been cancelled
2024-08-11 17:52:04 -05:00
72f083c444
Add Argo Rollout
All checks were successful
Gitea Actions Demo / lint (push) Successful in 1m28s
Gitea Actions Demo / test (push) Successful in 1m20s
Gitea Actions Demo / release-image (push) Successful in 1m8s
2024-08-11 12:56:53 -05:00
3 changed files with 60 additions and 0 deletions

7
app.rb
View File

@ -2,6 +2,7 @@ require "bundler/setup"
require "sinatra" require "sinatra"
require "sinatra/json" require "sinatra/json"
require "sinatra/cookies" require "sinatra/cookies"
require "sinatra/multi_route"
require "time" require "time"
require "fileutils" require "fileutils"
require "json" require "json"
@ -355,3 +356,9 @@ get "/_cat/cookies" do
end end
end end
end end
route :delete, :get, :patch, :post, :put, "/status/:code" do
# hello
code = Integer(params[:code])
status code if code.between? 100, 599
end

View File

@ -5,5 +5,6 @@ namespace: toy
resources: resources:
- secret.yaml - secret.yaml
- deployment.yaml - deployment.yaml
- rollout.yaml
- services.yaml - services.yaml
- ingress.yaml - ingress.yaml

View File

@ -0,0 +1,52 @@
---
apiVersion: argoproj.io/v1alpha1
kind: Rollout
metadata:
name: toy
spec:
replicas: 5
strategy:
canary:
steps:
- setWeight: 20
- pause: {}
- setWeight: 40
- pause: {duration: 10}
- setWeight: 60
- pause: {duration: 10}
- setWeight: 80
- pause: {duration: 10}
revisionHistoryLimit: 2
selector:
matchLabels:
app: toy
template:
metadata:
labels:
app: toy
spec:
containers:
- name: toy
image: git.kill0.net/ryanc/toy:latest
ports:
- name: web
containerPort: 4567
env:
- name: SESSION_SECRET
valueFrom:
secretKeyRef:
name: toy-session-secret
key: session_secret
optional: true
livenessProbe:
httpGet:
path: /livez
port: 4567
initialDelaySeconds: 3
periodSeconds: 3
readinessProbe:
httpGet:
path: /readyz
port: 4567
initialDelaySeconds: 5
periodSeconds: 5