71 lines
1.3 KiB
YAML
71 lines
1.3 KiB
YAML
---
|
|
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
labels:
|
|
app: $DEPLOYMENT_NAME
|
|
name: $DEPLOYMENT_NAME
|
|
namespace: blackdice
|
|
spec:
|
|
replicas: 1
|
|
selector:
|
|
matchLabels:
|
|
app: $DEPLOYMENT_NAME
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: $DEPLOYMENT_NAME
|
|
spec:
|
|
imagePullSecrets:
|
|
- name: do-registry
|
|
containers:
|
|
- image: $IMAGE_NAME
|
|
imagePullPolicy: Always
|
|
name: $DEPLOYMENT_NAME
|
|
ports:
|
|
- containerPort: 3000
|
|
protocol: UDP
|
|
restartPolicy: Always
|
|
|
|
|
|
---
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: $DEPLOYMENT_NAME
|
|
namespace: blackdice
|
|
spec:
|
|
ports:
|
|
- name: $DEPLOYMENT_NAME
|
|
port: 3000
|
|
protocol: TCP
|
|
targetPort: 3000
|
|
selector:
|
|
app: $DEPLOYMENT_NAME
|
|
type: ClusterIP
|
|
|
|
|
|
---
|
|
apiVersion: batch/v1
|
|
kind: CronJob
|
|
metadata:
|
|
name: $DEPLOYMENT_NAME
|
|
namespace: blackdice
|
|
spec:
|
|
schedule: "0 0 * * *"
|
|
jobTemplate:
|
|
spec:
|
|
template:
|
|
spec:
|
|
containers:
|
|
- name: $DEPLOYMENT_NAME
|
|
image: $IMAGE_NAME
|
|
command: ["/bin/bash", "-c"]
|
|
args: [
|
|
"/usr/local/gcf1/bin/gcf1dbmng.sh etc urldb_download && \
|
|
/usr/local/gcf1/bin/gcf1dbmng.sh etc urldb_update"
|
|
]
|
|
restartPolicy: OnFailure
|
|
backoffLimit: 4
|
|
|