mirror of
https://github.com/kerberos-io/deployment.git
synced 2026-08-23 15:18:32 +00:00
update
This commit is contained in:
47
README.md
47
README.md
@@ -1,3 +1,50 @@
|
||||
# Edge deployment on k8s
|
||||
|
||||
This ...
|
||||
|
||||
### OpenEBS
|
||||
|
||||
Some of the services we'll leverage such as MongoDB or Minio require storage, to persist their data safely. In a managed Kubernetes cluster, the relevant cloud provider will allocate storage automatically for you, as you might expect this is not the case for a self-hosted cluster.
|
||||
|
||||
Therefore we will need to prepare some storage or persistent volume. To simplify this we can leverage the OpenEBS storage solution, which can automatically provision PV (Persistent volumes) for us.
|
||||
|
||||
Let us start with installing the OpenEBS operator. Please note that you might need to change the mount folder. Download the `openebs-operator.yaml`.
|
||||
|
||||
wget https://openebs.github.io/charts/openebs-operator.yaml
|
||||
|
||||
Scroll to the bottom, until you hit the `StorageClass` section. Modify the `BasePath` value to the destination (external mount) you prefer.
|
||||
|
||||
#Specify the location (directory) where
|
||||
# where PV(volume) data will be saved.
|
||||
# A sub-directory with pv-name will be
|
||||
# created. When the volume is deleted,
|
||||
# the PV sub-directory will be deleted.
|
||||
#Default value is /var/openebs/local
|
||||
- name: BasePath
|
||||
value: "/var/openebs/local/"
|
||||
|
||||
Once you are ok with the `BasePath` go ahead and apply the operator.
|
||||
|
||||
kubectl apply -f openebs-operator.yaml
|
||||
|
||||
Once done it should start installing several resources in the `openebs` namespace. If all resources are created successfully we can launch the `helm install` for MongoDB.
|
||||
|
||||
### MongoDB
|
||||
|
||||
When using Kerberos Vault, it will persist references to the recordings stored in your storage provider in a MongoDB database. As used before, we are using `helm` to install MongoDB in our Kubernetes cluster. Within the Kerberos Vault project we are using the latest official mongodb driver, so we support all major MongoDB versions (4.x, 5.x, 6.x, 7.x).
|
||||
|
||||
Have a look into the `./mongodb/values.yaml` file, you will find plenty of configurations for the MongoDB helm chart. To change the username and password of the MongoDB instance, go ahead and [find the attribute where](https://github.com/kerberos-io/vault/blob/master/kubernetes/mongodb/values.yaml#L148) you can change the root password. Please note that we are using the official [Bitnami Mongodb helm chart](https://github.com/bitnami/charts/tree/main/bitnami/mongodb), so please use their repository for more indepth configuration.
|
||||
|
||||
Next to that you might also consider a SaaS MongoDB deployment using MongoDB Atlas or using a managed cloud like AWS, GCP, Azure or Alibaba cloud. A managed service takes away a lot of management and maintenance from your side (backups, security, sharing, etc). If you do want to install MongoDB in your own cluster then please continue with this tutorial.
|
||||
|
||||
helm repo add bitnami https://charts.bitnami.com/bitnami
|
||||
kubectl create namespace mongodb
|
||||
|
||||
Note: If you are installing a self-hosted Kubernetes cluster, we recommend using `openebs`. Therefore make sure to uncomment the `global`.`storageClass` attribute, and make sure it's using `openebs-hostpath` instead.
|
||||
|
||||
helm install mongodb -n mongodb bitnami/mongodb --values ./mongodb-values.yaml
|
||||
|
||||
Once installed successfully, we should verify if the password has been set correctly. Print out the password using `echo $MONGODB_ROOT_PASSWORD` and confirm the password is what you've specified in the `values.yaml` file.
|
||||
|
||||
export MONGODB_ROOT_PASSWORD=$(kubectl get secret -n mongodb mongodb -o jsonpath="{.data.mongodb-root-password}" | base64 --decode)
|
||||
echo $MONGODB_ROOT_PASSWORD
|
||||
|
||||
@@ -0,0 +1,96 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: vault
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: vault
|
||||
minReadySeconds: 10
|
||||
strategy:
|
||||
type: RollingUpdate
|
||||
rollingUpdate:
|
||||
maxUnavailable: 1
|
||||
maxSurge: 1
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: vault
|
||||
spec:
|
||||
containers:
|
||||
- name: vault
|
||||
image: kerberos/vault:1.0.1398121865
|
||||
#imagePullPolicy: Always
|
||||
resources:
|
||||
limits:
|
||||
memory: 4096Mi
|
||||
cpu: 2000m
|
||||
ports:
|
||||
- containerPort: 80
|
||||
envFrom:
|
||||
- configMapRef:
|
||||
name: mongodb
|
||||
# Injecting the ca-certificates inside the container.
|
||||
#volumeMounts:
|
||||
#- name: rootcerts
|
||||
# mountPath: /etc/ssl/certs/ca-certificates.crt
|
||||
# subPath: ca-certificates.crt
|
||||
env:
|
||||
- name: GIN_MODE
|
||||
value: release
|
||||
- name: KERBEROS_LOGIN_USERNAME
|
||||
value: "root"
|
||||
- name: KERBEROS_LOGIN_PASSWORD
|
||||
value: "kerberos"
|
||||
|
||||
# Mongodb configuration (if you are not using the configmap)
|
||||
# This is the mongodb database where data will be stored, you might use a different name if you want.
|
||||
#- name: MONGODB_DATABASE_STORAGE
|
||||
# value : "KerberosStorage"
|
||||
|
||||
# MongoDB URI (for example for a SaaS service like MongoDB Atlas)
|
||||
# If uri is set, the below properties are not used (host, adminDatabase, username, password)
|
||||
#MONGODB_URI: "mongodb+srv://xx:xx@kerberos-hub.xxx.mongodb.net/?retryWrites=true&w=majority&appName=xxx"
|
||||
|
||||
# If you do not wish to use the URI, you can specify the individual values.
|
||||
#- name: MONGODB_HOST
|
||||
# value: "mongodb.mongodb"
|
||||
#- name: MONGODB_DATABASE_CREDENTIALS
|
||||
# value: "admin"
|
||||
#- name: MONGODB_USERNAME
|
||||
# value: "root"
|
||||
#- name: MONGODB_PASSWORD
|
||||
# value: "yourmongodbpassword"
|
||||
|
||||
# MQTT broker to be used for on-demand forwarding.
|
||||
- name : MQTTURI
|
||||
value: "tcp://mqtt.kerberos.io:1883"
|
||||
- name : MQTT_USERNAME
|
||||
value: ""
|
||||
- name : MQTT_PASSWORD
|
||||
value: ""
|
||||
|
||||
# If you have a chained vault setup, enable this.
|
||||
- name: CONTINUOUS_FORWARDING
|
||||
value: "false"
|
||||
#volumes:
|
||||
#- name: rootcerts
|
||||
# configMap:
|
||||
# name: rootcerts
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: vault-lb
|
||||
labels:
|
||||
app: vault
|
||||
spec:
|
||||
type: LoadBalancer
|
||||
ports:
|
||||
- port: 80
|
||||
targetPort: 80
|
||||
name: frontend
|
||||
protocol: TCP
|
||||
selector:
|
||||
app: vault
|
||||
2415
mongodb-values.yaml
Normal file
2415
mongodb-values.yaml
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user