initial commit

This commit is contained in:
allard
2025-11-23 18:58:51 +01:00
commit 376a944abc
1553 changed files with 314731 additions and 0 deletions

View File

@@ -0,0 +1,62 @@
#VOORAF:
========
De processor moet avx instructieset aankunnen.
Dit kun je controleren door het volgende commando uit te voeren in je virtualbx vm:
cat /proc/cpuinfo | grep flags
output:
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov
pat pse36 clflush mmx fxsr sse sse2 ht syscall nx rdtscp lm constant_tsc rep_good
nopl xtopology nonstop_tsc cpuid tsc_known_freq pni pclmulqdq ssse3 fma cx16 pcid
sse4_1 sse4_2 x2apic movbe popcnt aes xsave avx f16c rdrand hypervisor lahf_lm abm
3dnowprefetch pti fsgsbase bmi1 avx2 bmi2 invpcid rdseed adx clflushopt arat
Je moet dan avx en sse4_2 tussen de flags zien staan:
anders moet je op de windows host het commando
bcdedit /set hypervisorlaunchtype off
uitvoeren.
#INSTALLATIE
============
helm install mongodb bitnami/mongodb-sharded -n mongodb -f values.yaml
OUTPUT:
NAME: mongodb
LAST DEPLOYED: Mon Jul 7 09:10:41 2025
NAMESPACE: mongodb
STATUS: deployed
REVISION: 1
TEST SUITE: None
NOTES:
CHART NAME: mongodb-sharded
CHART VERSION: 9.1.1
APP VERSION: 8.0.4
The MongoDB® Sharded cluster can be accessed via the Mongos instances in port 27017 on the following DNS name from within your cluster:
mongodb-mongodb-sharded.mongodb.svc.cluster.local
To get the root password run:
export MONGODB_ROOT_PASSWORD=$(kubectl get secret --namespace mongodb mongodb-mongodb-sharded -o jsonpath="{.data.mongodb-root-password}" | base64 -d)
To connect to your database run the following command:
kubectl run --namespace mongodb mongodb-mongodb-sharded-client --rm --tty -i --restart='Never' --image docker.io/bitnami/mongodb-sharded:8.0.4-debian-12-r1 --command -- mongosh admin --host mongodb-mongodb-sharded --authenticationDatabase admin -u root -p $MONGODB_ROOT_PASSWORD
To connect to your database from outside the cluster execute the following commands:
kubectl port-forward --namespace mongodb svc/mongodb-mongodb-sharded 27017:27017 &
mongosh --host 127.0.0.1 --authenticationDatabase admin -p $MONGODB_ROOT_PASSWORD
WARNING: There are "resources" sections in the chart not set. Using "resourcesPreset" is not recommended for production. For production installations, please set the following values according to your workload needs:
- configsvr.resources
- mongos.resources
- shardsvr.dataNode.resources
+info https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/

View File

@@ -0,0 +1,11 @@
apiVersion: backstage.io/v1alpha1
kind: Component
metadata:
name: asus-mongodb-sharded
title: Mongodb-sharded (asus)
spec:
type: service
lifecycle: production
owner: platform-team
partOf:
- ../catalog-info.yaml

View File

@@ -0,0 +1,16 @@
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: mongo-express-lp.allarddcs.nl-tls
namespace: mongodb
spec:
dnsNames:
- mongo-express-lp.allarddcs.nl
issuerRef:
group: cert-manager.io
kind: ClusterIssuer
name: letsencrypt
secretName: mongo-express-lp.allarddcs.nl-tls
usages:
- digital signature
- key encipherment

View File

@@ -0,0 +1 @@
microk8s kubectl expose deployment mongodb-mongodb-sharded --type=NodePort --name=mongodb-nodeport -n mongodb --port=27017

View File

@@ -0,0 +1,22 @@
apiVersion: v1
kind: Service
metadata:
name: mongo
namespace: mongodb
spec:
ports:
- protocol: TCP
port: 27017
targetPort: 27017
---
apiVersion: v1
kind: Endpoints
metadata:
name: mongo
namespace: mongodb
subsets:
- addresses:
- ip: 192.168.2.109
ports:
- port: 30513

View File

@@ -0,0 +1,35 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: mongo-express
spec:
replicas: 1
selector:
matchLabels:
app: mongo-express
template:
metadata:
labels:
app: mongo-express
spec:
containers:
- name: mongo-express
image: mongo-express
env:
- name: ME_CONFIG_MONGODB_URL
value: "mongodb://root:Mongodb01@192.168.2.109:30981"
ports:
- containerPort: 8081
---
apiVersion: v1
kind: Service
metadata:
name: mongo-express
spec:
type: NodePort
ports:
- port: 8081
targetPort: 8081
nodePort: 30801
selector:
app: mongo-express

View File

@@ -0,0 +1,43 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: mongo-express
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
env:
- name: ME_CONFIG_MONGODB_SERVER
value: "mongo.mongodb.svc.cluster.local"
- name: ME_CONFIG_MONGODB_PORT
value: "27017"
- name: ME_CONFIG_BASICAUTH_USERNAME
value: "admin"
- name: ME_CONFIG_BASICAUTH_PASSWORD
value: "pass"
ports:
- containerPort: 8081
---
apiVersion: v1
kind: Service
metadata:
name: mongo-express
spec:
type: NodePort
ports:
- port: 8081
targetPort: 8081
nodePort: 30081
selector:
app: mongo-express

View File

@@ -0,0 +1,63 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: mongo-sharded-express
namespace: nodejs
labels:
app: mongo-sharded-express
spec:
replicas: 1
selector:
matchLabels:
app: mongo-sharded-express
template:
metadata:
labels:
app: mongo-sharded-express
spec:
containers:
- name: mongo-sharded-express
image: mongo-express
ports:
- containerPort: 8081
env:
- name: ME_CONFIG_OPTIONS_EDITORTHEME
value: "ambiance"
- name: ME_CONFIG_BASICAUTH_USERNAME
value: "admin"
- name: ME_CONFIG_BASICAUTH_PASSWORD
value: "Mongodb01"
- name: ME_CONFIG_MONGODB_URL
value: "mongodb://root:Mongodb01@192.168.2.109:30981"
---
apiVersion: v1
kind: Service
metadata:
name: mongo-sharded-express
namespace: nodejs
labels:
name: mongo-sharded-express
spec:
type: ClusterIP
ports:
- port: 8081
name: http
selector:
app: mongo-sharded-express
---
apiVersion: traefik.io/v1alpha1
kind: IngressRoute
metadata:
name: mongo-sharded-express-tls
namespace: nodejs
spec:
entryPoints:
- websecure
routes:
- match: Host(`mongoshardedexpress-prod.allarddcs.nl`)
kind: Rule
services:
- name: mongo-sharded-express
port: 8081
tls:
certResolver: letsencrypt

File diff suppressed because it is too large Load Diff