Skip to content

Instantly share code, notes, and snippets.

@cryptcoin-junkey
Created February 17, 2018 01:14
Show Gist options
  • Save cryptcoin-junkey/cba0e3f4138ba3c247c199733ef2a966 to your computer and use it in GitHub Desktop.
Save cryptcoin-junkey/cba0e3f4138ba3c247c199733ef2a966 to your computer and use it in GitHub Desktop.
A part of yaml files for Insight-mona in K8s.
apiVersion: apps/v1beta1
kind: StatefulSet
metadata:
labels:
run: insight-mona
name: insight-mona
namespace: insight
spec:
podManagementPolicy: OrderedReady
replicas: 1
revisionHistoryLimit: 10
selector:
matchLabels:
run: insight-mona
serviceName: insight-mona
template:
metadata:
labels:
run: insight-mona
spec:
affinity:
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
- key: run
operator: In
values:
- insight-mona
topologyKey: kubernetes.io/hostname
containers:
- image: monacoex/insight:monacoin
imagePullPolicy: Always
livenessProbe:
failureThreshold: 3
httpGet:
path: /insight/
port: 3001
scheme: HTTP
initialDelaySeconds: 5
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 1
name: insight-mona
ports:
- containerPort: 3001
protocol: TCP
readinessProbe:
exec:
command:
- sh
- -ec
- curl http://localhost:3001/insight-api-monacoin/sync 2> /dev/null |
grep finished
failureThreshold: 3
initialDelaySeconds: 60
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 1
resources:
limits:
memory: 768Mi
requests:
cpu: 50m
memory: 512Mi
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
volumeMounts:
- mountPath: /home/node/insight/data
name: data
dnsPolicy: ClusterFirst
restartPolicy: Always
schedulerName: default-scheduler
securityContext:
fsGroup: 1000
terminationGracePeriodSeconds: 30
updateStrategy:
type: OnDelete
volumeClaimTemplates:
- metadata:
name: data
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 8Gi
storageClassName: standard
apiVersion: v1
kind: Service
metadata:
labels:
run: insight-mona
name: insight-mona
namespace: insight
spec:
externalTrafficPolicy: Cluster
ports:
- nodePort: 32018
port: 3001
protocol: TCP
targetPort: 3001
selector:
run: insight-mona
sessionAffinity: ClientIP
type: NodePort
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment