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.
107 lines
2.4 KiB
107 lines
2.4 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:
|
|
selector:
|
|
matchLabels:
|
|
app: python-deployment
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: python-deployment
|
|
spec:
|
|
replicas: 5
|
|
strategy:
|
|
canary:
|
|
steps:
|
|
- setWeight: 20
|
|
- pause: {}
|
|
- setWeight: 40
|
|
- pause: {duration: 10}
|
|
- setWeight: 60
|
|
- pause: {duration: 10}
|
|
- setWeight: 80
|
|
- pause: {duration: 10}
|
|
containers:
|
|
- name: app
|
|
args:
|
|
- '/bin/python3'
|
|
- '/app/app.py'
|
|
readinessProbe:
|
|
initialDelaySeconds: 10
|
|
timeoutSeconds: 10
|
|
failureThreshold: 10
|
|
httpGet:
|
|
path: /
|
|
port: 8000
|
|
livenessProbe:
|
|
initialDelaySeconds: 10
|
|
timeoutSeconds: 10
|
|
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
|
|
---
|
|
apiVersion: v1
|
|
kind: ConfigMap
|
|
metadata:
|
|
name: app-script-config
|
|
data:
|
|
app.py: |
|
|
#! /bin/python3
|
|
from http.server import BaseHTTPRequestHandler
|
|
from time import sleep
|
|
|
|
class GetHandler(BaseHTTPRequestHandler):
|
|
def do_GET(self):
|
|
sleep(1)
|
|
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()
|