mirror of
https://github.com/jpetazzo/container.training.git
synced 2026-02-14 17:49:59 +00:00
52 lines
972 B
YAML
52 lines
972 B
YAML
---
|
|
kind: Deployment
|
|
apiVersion: apps/v1
|
|
metadata:
|
|
name: admission
|
|
spec:
|
|
selector:
|
|
matchLabels:
|
|
app: admission
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: admission
|
|
spec:
|
|
volumes:
|
|
- name: tls
|
|
secret:
|
|
secretName: admission
|
|
- name: app
|
|
configMap:
|
|
name: admission
|
|
containers:
|
|
- name: admission
|
|
image: python
|
|
command:
|
|
- sh
|
|
- -c
|
|
- |
|
|
pip install Flask gunicorn PyYAML
|
|
exec gunicorn \
|
|
--bind 0.0.0.0:443 --keyfile /tls/tls.key --certfile /tls/tls.crt \
|
|
--access-logfile - \
|
|
--chdir /app webhook:app
|
|
volumeMounts:
|
|
- name: tls
|
|
mountPath: /tls
|
|
- name: app
|
|
mountPath: /app
|
|
---
|
|
kind: Service
|
|
apiVersion: v1
|
|
metadata:
|
|
name: admission
|
|
spec:
|
|
selector:
|
|
app: admission
|
|
ports:
|
|
- protocol: TCP
|
|
port: 443
|
|
targetPort: 443
|
|
type: ClusterIP
|