Upload files to 'sk1'
This commit is contained in:
parent
ea6f69520f
commit
5e5309d9e5
7
sk1/mongo-configmap.yaml
Normal file
7
sk1/mongo-configmap.yaml
Normal file
@ -0,0 +1,7 @@
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: mongo-configmap
|
||||
namespace: z2
|
||||
data:
|
||||
database-url: mongo-service
|
34
sk1/mongo-deployment.yaml
Normal file
34
sk1/mongo-deployment.yaml
Normal file
@ -0,0 +1,34 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: mongo-deployment
|
||||
namespace: z2
|
||||
labels:
|
||||
app: mongodb
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: mongodb
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: mongodb
|
||||
spec:
|
||||
containers:
|
||||
- name: mongodb
|
||||
image: mongo:latest
|
||||
ports:
|
||||
- containerPort: 27017
|
||||
env:
|
||||
#mongo-secret.yaml poskytne meno a heslo, bezpecnejsie base64
|
||||
- name: MONGO_INITDB_ROOT_USERNAME
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: mongo-secret
|
||||
key: mongo-username
|
||||
- name: MONGO_INITDB_ROOT_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: mongo-secret
|
||||
key: mongo-password
|
38
sk1/mongo-express-deployment.yaml
Normal file
38
sk1/mongo-express-deployment.yaml
Normal file
@ -0,0 +1,38 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: mongo-express-deployment
|
||||
namespace: z2
|
||||
labels:
|
||||
app: mongo-express
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: mongo-express
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: mongo-express
|
||||
spec:
|
||||
containers:
|
||||
- name: mongo-express
|
||||
image: mongo-express:latest
|
||||
ports:
|
||||
- containerPort: 8081
|
||||
env:
|
||||
- name: ME_CONFIG_MONGODB_ADMINUSERNAME
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: mongo-secret
|
||||
key: mongo-username
|
||||
- name: ME_CONFIG_MONGODB_ADMINPASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: mongo-secret
|
||||
key: mongo-password
|
||||
- name: ME_CONFIG_MONGODB_SERVER
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
name: mongo-configmap
|
||||
key: database-url
|
14
sk1/mongo-express-service.yaml
Normal file
14
sk1/mongo-express-service.yaml
Normal file
@ -0,0 +1,14 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: mongo-express-service
|
||||
namespace: z2
|
||||
spec:
|
||||
selector:
|
||||
app: mongo-express
|
||||
type: LoadBalancer
|
||||
ports:
|
||||
- protocol: TCP
|
||||
port: 8081
|
||||
targetPort: 8081
|
||||
nodePort: 30001
|
9
sk1/mongo-secret.yaml
Normal file
9
sk1/mongo-secret.yaml
Normal file
@ -0,0 +1,9 @@
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: mongo-secret
|
||||
namespace: z2
|
||||
type: Opaque
|
||||
data:
|
||||
mongo-username: YWRtaW4=
|
||||
mongo-password: YWRtaW4=
|
13
sk1/mongo-service.yaml
Normal file
13
sk1/mongo-service.yaml
Normal file
@ -0,0 +1,13 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: mongo-service
|
||||
namespace: z2
|
||||
spec:
|
||||
selector:
|
||||
app: mongodb
|
||||
type: ClusterIP
|
||||
ports:
|
||||
- protocol: TCP
|
||||
port: 27017
|
||||
targetPort: 27017
|
45
sk1/mongo-stateful-set.yaml
Normal file
45
sk1/mongo-stateful-set.yaml
Normal file
@ -0,0 +1,45 @@
|
||||
apiVersion: apps/v1
|
||||
kind: StatefulSet
|
||||
metadata:
|
||||
name: mongodb
|
||||
spec:
|
||||
selector:
|
||||
matchLabels:
|
||||
app: mongodb
|
||||
serviceName: mongo-service
|
||||
replicas: 1
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: mongodb
|
||||
spec:
|
||||
containers:
|
||||
- name: mongodb
|
||||
image: mongo:latest
|
||||
ports:
|
||||
- name: mongodb
|
||||
containerPort: 27017
|
||||
protocol: TCP
|
||||
env:
|
||||
- name: MONGO_INITDB_ROOT_USERNAME
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: mongo-secret
|
||||
key: mongo-username
|
||||
- name: MONGO_INITDB_ROOT_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: mongo-secret
|
||||
key: mongo-password
|
||||
volumeMounts:
|
||||
- mountPath: /data/db
|
||||
name: mongopvc
|
||||
volumeClaimTemplates:
|
||||
- metadata:
|
||||
name: mongopvc
|
||||
spec:
|
||||
accessModes: ["ReadWriteMany"]
|
||||
storageClassName: "local"
|
||||
resources:
|
||||
requests:
|
||||
storage: 500Mi
|
4
sk1/namespace.yaml
Normal file
4
sk1/namespace.yaml
Normal file
@ -0,0 +1,4 @@
|
||||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
name: z2
|
15
sk1/pv.yaml
Normal file
15
sk1/pv.yaml
Normal file
@ -0,0 +1,15 @@
|
||||
apiVersion: v1
|
||||
kind: PersistentVolume
|
||||
metadata:
|
||||
name: pv-mongo
|
||||
labels:
|
||||
type: local
|
||||
spec:
|
||||
storageClassName: local
|
||||
capacity:
|
||||
storage: 500Mi
|
||||
accessModes:
|
||||
- ReadWriteMany
|
||||
persistentVolumeReclaimPolicy: Delete
|
||||
hostPath:
|
||||
path: "/zkt22/z2/pv"
|
@ -3,4 +3,6 @@ set -e
|
||||
|
||||
az group delete -n skuskaZKT -y
|
||||
az group delete -n NetworkWatcherRG -y
|
||||
az group delete -n DefaultResourceGroup-EA -y
|
||||
az group delete -n DefaultResourceGroup-EA -y
|
||||
|
||||
printf 'Sicko vymazane'
|
9
sk1/start-app.sh
Normal file
9
sk1/start-app.sh
Normal file
@ -0,0 +1,9 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
kubectl apply -f mongo-configmap.yaml
|
||||
kubectl apply -f mongo-secret.yaml
|
||||
kubectl apply -f mongo-service.yaml
|
||||
kubectl apply -f mongo-stateful-set.yaml -n z2
|
||||
kubectl apply -f mongo-express-deployment.yaml
|
||||
kubectl apply -f mongo-express-service.yaml
|
8
sk1/stop-app.sh
Normal file
8
sk1/stop-app.sh
Normal file
@ -0,0 +1,8 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
kubectl delete statefulset.apps/mongodb -n z2
|
||||
kubectl delete deployment.apps/mongo-express-deployment -n z2
|
||||
kubectl delete service/mongo-express-service -n z2
|
||||
kubectl delete service/mongo-service -n z2
|
||||
kubectl delete configmap/mongo-configmap -n z2
|
Loading…
Reference in New Issue
Block a user