Commit 0ce60e73 authored by Luc Bourdot's avatar Luc Bourdot
Browse files

Yes it is

parent bb4cd385
kubectl create configmap e-user-config --from-file=local.env.js
......@@ -27,14 +27,10 @@ spec:
name: e-user
protocol: TCP
resources: {}
volumeMounts:
- mountPath: /usr/src/app/server/config
name: e-user
volumes:
- name: e-user
persistentVolumeClaim:
claimName: e-user
# volumes:
# - name: cfgmap
# configMap:
# name: e-user-config
---
kind: Service
......@@ -52,43 +48,3 @@ spec:
type: LoadBalancer
---
apiVersion: v1
kind: PersistentVolume
metadata:
name: e-user
spec:
capacity:
storage: 500Mi
accessModes:
- ReadWriteOnce
persistentVolumeReclaimPolicy: Delete
storageClassName: local-storage
local:
path: /tmp/euser
nodeAffinity:
required:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.io/hostname
operator: In
values:
- matthieu-pc
---
# Persistent Volume Claim
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: e-user
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 100Mi
storageClassName: local-storage
status: {}
kind: Deployment
apiVersion: extensions/v1beta1 # for versions before 1.9.0 use apps/v1beta2
metadata:
name: e-user
labels:
service: e-user
spec:
replicas: 1
strategy: {}
selector:
matchLabels:
service: e-user
replicas: 1 # tells deployment to run 2 pods matching the template
template:
metadata:
labels:
service: e-user
spec:
containers:
- env:
- name: MONGODB_URI
value: mongodb://mongodb/dbu
name: e-user
image: luceole/e-user-prod:0.5.5
ports:
- containerPort: 8080
name: e-user
protocol: TCP
resources: {}
volumeMounts:
- mountPath: /usr/src/app/server/config
name: e-user
volumes:
- name: e-user
persistentVolumeClaim:
claimName: e-user
---
kind: Service
apiVersion: v1
metadata:
name: e-user
spec:
type: NodePort
selector:
service: e-user
ports:
- port: 80
targetPort: 8080
protocol: TCP
type: LoadBalancer
---
apiVersion: v1
kind: PersistentVolume
metadata:
name: e-user
spec:
capacity:
storage: 500Mi
accessModes:
- ReadWriteOnce
persistentVolumeReclaimPolicy: Delete
storageClassName: local-storage
local:
path: /tmp/euser
nodeAffinity:
required:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.io/hostname
operator: In
values:
- asus-luc
---
# Persistent Volume Claim
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: e-user
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 100Mi
storageClassName: local-storage
status: {}
......@@ -27,9 +27,9 @@ spec:
name: mongodb
image: mongo:latest
command: ['/bin/bash']
args: ["-c", "mongod --smallfiles --logpath=/dev/null"]
args: ["-c", "mongod --smallfiles --logpath=/dev/null --bind_ip 0.0.0.0."]
ports:
- containerPort: 8081
- containerPort: 27017
name: mongodb
protocol: TCP
resources: {}
......@@ -56,9 +56,7 @@ spec:
selector:
service: mongodb
ports:
- port: 8081
targetPort: 8081
protocol: TCP
- port: 27017
---
# Persistent Volume Claim
......@@ -91,52 +89,3 @@ spec:
storageClassName: local-storage
status: {}
---
# Persistent volumes
apiVersion: v1
kind: PersistentVolume
metadata:
name: mongodb-data
spec:
capacity:
storage: 500Mi
accessModes:
- ReadWriteOnce
persistentVolumeReclaimPolicy: Delete
storageClassName: local-storage
local:
path: /tmp/mongodb-data
nodeAffinity:
required:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.io/hostname
operator: In
values:
- matthieu-pc
---
apiVersion: v1
kind: PersistentVolume
metadata:
name: mongodb-save
spec:
capacity:
storage: 500Mi
accessModes:
- ReadWriteOnce
persistentVolumeReclaimPolicy: Delete
storageClassName: local-storage
local:
path: /tmp/mongodb-save
nodeAffinity:
required:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.io/hostname
operator: In
values:
- matthieu-pc
\ No newline at end of file
kind: Deployment
apiVersion: extensions/v1beta1 # for versions before 1.9.0 use apps/v1beta2
metadata:
name: mongodb
labels:
service: mongodb
spec:
replicas: 1
strategy: {}
selector:
matchLabels:
service: mongodb
replicas: 1 # tells deployment to run 2 pods matching the template
template:
metadata:
labels:
service: mongodb
spec:
containers:
- env:
- name: MONGO_DATA_DIR
value: /data/db
- name: MONGO_LOG_DIR
value: /dev/null
name: mongodb
image: mongo:latest
command: ['/bin/bash']
args: ["-c", "mongod --smallfiles --logpath=/dev/null"]
ports:
- containerPort: 8081
name: mongodb
protocol: TCP
resources: {}
volumeMounts:
- mountPath: /data/db
name: mongodb-data
- mountPath: /backup
name: mongodb-save
volumes:
- name: mongodb-data
persistentVolumeClaim:
claimName: mongodb-data
- name: mongodb-save
persistentVolumeClaim:
claimName: mongodb-save
---
kind: Service
apiVersion: v1
metadata:
name: mongodb
spec:
type: NodePort
selector:
service: mongodb
ports:
- port: 8081
targetPort: 8081
protocol: TCP
---
# Persistent Volume Claim
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: mongodb-data
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 200Mi
storageClassName: local-storage
status: {}
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: mongodb-save
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 200Mi
storageClassName: local-storage
status: {}
---
# Persistent volumes
apiVersion: v1
kind: PersistentVolume
metadata:
name: mongodb-data
spec:
capacity:
storage: 500Mi
accessModes:
- ReadWriteOnce
persistentVolumeReclaimPolicy: Delete
storageClassName: local-storage
local:
path: /tmp/mongodb-data
nodeAffinity:
required:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.io/hostname
operator: In
values:
- asus-luc
---
apiVersion: v1
kind: PersistentVolume
metadata:
name: mongodb-save
spec:
capacity:
storage: 500Mi
accessModes:
- ReadWriteOnce
persistentVolumeReclaimPolicy: Delete
storageClassName: local-storage
local:
path: /tmp/mongodb-save
nodeAffinity:
required:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.io/hostname
operator: In
values:
- asus-luc
# Persistent volumes
apiVersion: v1
kind: PersistentVolume
metadata:
name: mongodb-data
spec:
capacity:
storage: 500Mi
accessModes:
- ReadWriteOnce
persistentVolumeReclaimPolicy: Delete
storageClassName: local-storage
local:
path: /KubeData/mongodb-data
nodeAffinity:
required:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.io/hostname
operator: In
values:
- asus-luc
---
apiVersion: v1
kind: PersistentVolume
metadata:
name: mongodb-save
spec:
capacity:
storage: 500Mi
accessModes:
- ReadWriteOnce
persistentVolumeReclaimPolicy: Delete
storageClassName: local-storage
local:
path: /KubeData/mongodb-save
nodeAffinity:
required:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.io/hostname
operator: In
values:
- asus-luc
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment