Skip to content

Instantly share code, notes, and snippets.

@ll911
Last active November 9, 2018 23:58
Show Gist options
  • Save ll911/394ea0c2383944a537f74c55284c590a to your computer and use it in GitHub Desktop.
Save ll911/394ea0c2383944a537f74c55284c590a to your computer and use it in GitHub Desktop.
bcdc-main-dc.yaml
apiVersion: v1
kind: DeploymentConfig
metadata:
annotations:
labels:
app: bcdc
name: ckan-main
name: bcdc-ckan-main
spec:
replicas: 1
selector:
app: bcdc
name: ckan-main
deploymentconfig: bcdc-ckan-main
template:
metadata:
annotations:
labels:
app: bcdc
name: ckan-main
deploymentconfig: bcdc-ckan-main
spec:
containers:
- name: ckan
image: docker-registry.default.svc:5000/dbc-bcdc-dev/bcdc-atomic-base
command: ["tail", "-f", "/dev/null"]
volumeMounts:
- name: ckan-filestore
mountPath: /var/lib/ckan
- name: bcdc-conf
mountPath: /conf
imagePullPolicy: Always
- name: datapusher
image: docker-registry.default.svc:5000/dbc-bcdc-dev/datapusher-atomic-base
command: ["gunicorn", "wsgi:app", "-k", "gevent"]
env:
- name: JOB_CONFIG
value: /conf/datapusher_settings.py
volumeMounts:
- name: datapusher-conf
mountPath: /conf
- name: solr
image: solr:7.2.1-alpine
volumeMounts:
- name: solrcore
mountPath: /opt/solr/server/solr/mycores
- name: solr-logs
mountPath: /opt/solr/server/logs
- name: bcdc-solr-conf
mountPath: /opt/solr/server/solr/mycores/conf
- name: redis
image: redis
ports:
- containerPort: 6379
name: client
command: ["redis-server", "/conf/redis.conf"]
readinessProbe:
exec:
command:
- sh
- -c
- "redis-cli -h $(hostname) ping"
initialDelaySeconds: 15
timeoutSeconds: 5
livenessProbe:
exec:
command:
- sh
- -c
- "redis-cli -h $(hostname) ping"
initialDelaySeconds: 20
periodSeconds: 3
volumeMounts:
- name: redis-conf
mountPath: /conf
readOnly: false
- name: redis-data
mountPath: /data
readOnly: false
volumes:
- name: redis-data
emtptyDir: {}
- name: solr-logs
emtptyDir: {}
- name: ckan-filestore
persistentVolumeClaim:
claimName: file-store
- name: solrcore
persistentVolumeClaim:
claimName: solr-core
- name: bcdc-conf
configMap:
name: bcdc-config
defaultMode: 420
- name: bcdc-solr-conf
configMap:
name: bcdc-solr-config
defaultMode: 420
- name: datapusher-conf
configMap:
name: bcdc-config
items:
- key: datapusher.wsgi
path: datapusher.wsgi
- key: datapusher_settings.py
path: datapusher_settings.py
- name: redis-conf
configMap:
name: ckan-cache
items:
- key: redis.conf
path: redis.conf
triggers:
- type: ConfigChange
- imageChangeParams:
automatic: true
containerNames:
- ckan
from:
kind: ImageStreamTag
name: 'bcdc-atomic-base:latest'
type: ImageChange
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
annotations:
volume.beta.kubernetes.io/storage-class: gluster-file
name: solr-core
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
annotations:
volume.beta.kubernetes.io/storage-class: gluster-file
name: file-store
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 5Gi
---
apiVersion: v1
kind: ConfigMap
data:
redis.conf: |-
appendonly no
protected-mode yes
metadata:
name: ckan-cache
---
apiVersion: v1
kind: Service
metadata:
labels:
app: bcdc
name: bcdc
spec:
ports:
- name: ckan
port: 5000
targetPort: 5000
protocol: TCP
- name: datapusher
port: 8800
targetPort: 8800
protocol: TCP
- name: ckan-cache
port: 6379
targetPort: 6379
protocol: TCP
- name: solr
port: 8983
targetPort: 8983
protocol: TCP
selector:
app: bcdc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment