You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

103 lines
2.3 KiB

---
apiVersion: batch/v1
kind: Job
metadata:
name: argocd-configplugin-tester-deployment8
labels:
app: argocd-configplugin-tester
spec:
template:
metadata:
labels:
app: argocd-configplugin-tester
spec:
restartPolicy: "Never"
containers:
- name: long-running-task
args:
- '-c'
- 'echo "pass2" > result.txt && cat result.txt && sleep 121'
image: bash
resources:
limits:
memory: 200Mi
requests:
cpu: 100m
memory: 200Mi
---
apiVersion: argoproj.io/v1alpha1
kind: Rollout
metadata:
name: python-deployment
spec:
replicas: 3
strategy:
canary:
maxSurge: 1
maxUnavailable: 0
steps:
- setWeight: 33
- pause:
duration: 1m
selector:
matchLabels:
app: python-deployment
template:
metadata:
labels:
app: python-deployment
spec:
containers:
- name: app
args:
- '/bin/python3'
- '/app/app.py'
readinessProbe:
initialDelaySeconds: 10
timeoutSeconds: 15
failureThreshold: 10
httpGet:
path: /
port: 8000
livenessProbe:
initialDelaySeconds: 10
timeoutSeconds: 15
failureThreshold: 10
httpGet:
path: /
port: 8000
image: python:3
ports:
- containerPort: 8000
volumeMounts:
- name: app-script-volume
mountPath: "/app"
readOnly: true
volumes:
- name: app-script-volume
configMap:
name: app-script-config-9
---
apiVersion: v1
kind: ConfigMap
metadata:
name: app-script-config-9
data:
app.py: |
#! /bin/python3
from http.server import BaseHTTPRequestHandler
from time import sleep
class GetHandler(BaseHTTPRequestHandler):
def do_GET(self):
x = self.wfile.write
self.send_response(200)
self.send_header("Content-type", "text/html")
self.end_headers()
if __name__ == '__main__':
from http.server import HTTPServer
server = HTTPServer(('', 8000), GetHandler)
print('Starting server, use <Ctrl + F2> to stop')
server.serve_forever()