|
@@ -0,0 +1,71 @@
|
|
|
+---
|
|
|
+apiVersion: apps/v1
|
|
|
+kind: $JNLP_CONTROL
|
|
|
+metadata:
|
|
|
+ name: $DRONE_REPO_NAME
|
|
|
+ namespace: $JNLP_ENV
|
|
|
+ labels:
|
|
|
+ app: $DRONE_REPO_NAME
|
|
|
+spec:
|
|
|
+ serviceName: $DRONE_REPO_NAME
|
|
|
+ replicas: $JNLP_REPLICAS
|
|
|
+ selector:
|
|
|
+ matchLabels:
|
|
|
+ app: $DRONE_REPO_NAME
|
|
|
+ template:
|
|
|
+ metadata:
|
|
|
+ labels:
|
|
|
+ app: $DRONE_REPO_NAME
|
|
|
+ spec:
|
|
|
+ terminationGracePeriodSeconds: 180
|
|
|
+ initContainers:
|
|
|
+ - name: init
|
|
|
+ image: $JNLP_REPO/dev/busybox
|
|
|
+ command: ["chmod","777","-R","$JNLP_MOUNT_PATH"]
|
|
|
+ volumeMounts:
|
|
|
+ - name: volume
|
|
|
+ mountPath: $JNLP_MOUNT_PATH
|
|
|
+ containers:
|
|
|
+ - name: $DRONE_REPO_NAME
|
|
|
+ image: $JNLP_REPO/$JNLP_ENV/$DRONE_REPO_NAME:$JNLP_TAG
|
|
|
+ imagePullPolicy: Always
|
|
|
+ ports:
|
|
|
+ - containerPort: $JNLP_CONTAINER_PORT
|
|
|
+ name: port
|
|
|
+ volumeMounts:
|
|
|
+ - name: volume
|
|
|
+ mountPath: $JNLP_MOUNT_PATH
|
|
|
+ livenessProbe:
|
|
|
+ tcpSocket:
|
|
|
+ port: $JNLP_CONTAINER_PORT
|
|
|
+ initialDelaySeconds: $JNLP_LIVENESS_INIT
|
|
|
+ periodSeconds: $JNLP_LIVENESS_PER
|
|
|
+ readinessProbe:
|
|
|
+ tcpSocket:
|
|
|
+ port: $JNLP_CONTAINER_PORT
|
|
|
+ initialDelaySeconds: $JNLP_READINESS_INIT
|
|
|
+ periodSeconds: $JNLP_READINESS_PER
|
|
|
+ volumeClaimTemplates:
|
|
|
+ - metadata:
|
|
|
+ name: volume
|
|
|
+ spec:
|
|
|
+ accessModes: ["ReadWriteOnce"]
|
|
|
+ storageClassName: rbd
|
|
|
+ resources:
|
|
|
+ requests:
|
|
|
+ storage: $JNLP_STORAGE_CAPACITY
|
|
|
+---
|
|
|
+apiVersion: v1
|
|
|
+kind: Service
|
|
|
+metadata:
|
|
|
+ name: $DRONE_REPO_NAME-svc
|
|
|
+ namespace: $JNLP_ENV
|
|
|
+ labels:
|
|
|
+ app: $DRONE_REPO_NAME-svc
|
|
|
+spec:
|
|
|
+ type: NodePort
|
|
|
+ ports:
|
|
|
+ - port: $JNLP_CONTAINER_PORT
|
|
|
+ targetPort: $JNLP_CONTAINER_PORT
|
|
|
+ selector:
|
|
|
+ app: $DRONE_REPO_NAME
|