Skip to content

Instantly share code, notes, and snippets.

@maxgfr
Last active March 21, 2018 10:11
Show Gist options
  • Save maxgfr/bcc313d5a3c648ebbf057467bc579aa3 to your computer and use it in GitHub Desktop.
Save maxgfr/bcc313d5a3c648ebbf057467bc579aa3 to your computer and use it in GitHub Desktop.
Kubernetes & Cloudant
kind: PersistentVolume
apiVersion: v1
metadata:
name: cloudant-pv
labels:
app: microprofile-app
spec:
capacity:
storage: 4Gi
accessModes:
- ReadWriteMany
hostPath:
path: "/var/cloudant"
persistentVolumeReclaimPolicy: Recycle
---
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: cloudant-pv-claim
annotations:
volume.beta.kubernetes.io/storage-class: ""
labels:
app: microprofile-app
spec:
accessModes:
- ReadWriteMany
resources:
requests:
storage: 3Gi
---
apiVersion: v1
kind: Service
metadata:
name: cloudant-service
labels:
app: microprofile-app
spec:
type: NodePort
ports:
- port: 80
nodePort: 31111
targetPort: 80
name: http
selector:
name: cloudant-deployment
---
kind: Deployment
apiVersion: extensions/v1beta1
metadata:
name: cloudant-db
labels:
app: microprofile-app
spec:
replicas: 3
template:
metadata:
labels:
name: cloudant-deployment
version: v1
spec:
containers:
- name: cloudant-db
image: ibmcom/cloudant-developer:latest
imagePullPolicy: Always
command: ["/bin/sh","-c"]
args: ["if [ ! -z $dbPassword ]; then sed -i 's/^admin.*/admin = '$dbPassword'/g' /opt/cloudant/etc/local.ini && sed -i 's/^cloudant.*/cloudant = '$dbPassword'/g' /opt/cloudant/etc/local.ini && if [ ! -a /srv/cloudant ]; then sed -i 's/172.17.0.2/127.0.0.1/g' /etc/haproxy/haproxy.cfg && cast license --silent && cast database init -v -y -p $dbPassword ; fi; exec /usr/sbin/init; fi;"]
securityContext:
privileged: true
ports:
- containerPort: 80
volumeMounts:
- name: cloudant-pv
mountPath: /srv
volumes:
- name: cloudant-pv
persistentVolumeClaim:
claimName: cloudant-pv-claim
---
kind: Job
apiVersion: batch/v1
metadata: {name: resilient-java-microservices-with-istio-metrics}
spec:
template:
metadata: {name: resilient-java-microservices-with-istio-metrics}
spec:
containers:
- env:
- {name: config, value: '{"event_id": "web",
"repository_id": "resilient-java-microservices-with-istio",
"target_services": [null], "target_runtimes":
["Kubernetes Cluster"], "event_organizer":
"dev-journeys"}'}
- {name: language, value: 'java'}
image: journeycode/kubernetes:latest
name: resilient-java-microservices-with-istio-metrics
resources:
limits: {cpu: 100m}
restartPolicy: Never
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment