-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
201 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,189 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: mongo | ||
labels: | ||
app.kubernetes.io/name: mongo | ||
app.kubernetes.io/component: backend | ||
namespace: pxbbq | ||
spec: | ||
ports: | ||
- port: 27017 | ||
targetPort: 27017 | ||
type: ClusterIP | ||
selector: | ||
vm.kubevirt.io/name: freebsd-mongodb | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: pxbbq-web | ||
namespace: pxbbq | ||
spec: | ||
replicas: 3 | ||
selector: | ||
matchLabels: | ||
app: pxbbq-web | ||
template: | ||
metadata: | ||
labels: | ||
app: pxbbq-web | ||
spec: | ||
containers: | ||
- name: pxbbq-web | ||
image: eshanks16/pxbbq:v3.3.1 | ||
env: | ||
- name: MONGO_INIT_USER | ||
value: "porxie" #Mongo User with permissions to create additional databases and users. Typically "porxie" or "pds" | ||
- name: MONGO_INIT_PASS | ||
value: "porxie" #Required to connect the init user to the database. If using the mongodb yaml supplied, use "porxie" | ||
- name: MONGO_NODES | ||
value: "mongo" #COMMA SEPARATED LIST OF MONGO ENDPOINTS. Example: mongo1.dns.name,mongo2.dns.name | ||
- name: MONGO_PORT | ||
value: "27017" | ||
- name: MONGO_USER | ||
value: porxie #Mongo DB User that will be created by using the Init_User | ||
- name: MONGO_PASS | ||
value: "porxie" #Mongo DB Password for User that will be created by using the Init User | ||
imagePullPolicy: IfNotPresent | ||
ports: | ||
- containerPort: 8080 | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: pxbbq-svc | ||
namespace: pxbbq | ||
labels: | ||
app: pxbbq-web | ||
spec: | ||
ports: | ||
- port: 80 | ||
targetPort: 8080 | ||
type: ClusterIP | ||
selector: | ||
app: pxbbq-web | ||
--- | ||
kind: Route | ||
apiVersion: route.openshift.io/v1 | ||
metadata: | ||
name: pxbbq | ||
namespace: pxbbq | ||
labels: | ||
app: pxbbq-web | ||
px-dr: 'false' | ||
spec: | ||
to: | ||
kind: Service | ||
name: pxbbq-svc | ||
weight: 100 | ||
port: | ||
targetPort: 8080 | ||
wildcardPolicy: None | ||
--- | ||
apiVersion: kubevirt.io/v1 | ||
kind: VirtualMachine | ||
metadata: | ||
name: freebsd-mongodb | ||
annotations: | ||
description: FreeBSD MongoDB | ||
labels: | ||
name: mongo | ||
app: backend | ||
os.template.kubevirt.io/freebsd: 'true' | ||
namespace: pxbbq | ||
spec: | ||
running: true | ||
template: | ||
metadata: | ||
annotations: | ||
vm.kubevirt.io/flavor: small | ||
vm.kubevirt.io/os: freebsd | ||
vm.kubevirt.io/workload: server | ||
labels: | ||
kubevirt.io/domain: freebsd | ||
kubevirt.io/size: small | ||
spec: | ||
domain: | ||
cpu: | ||
cores: 2 | ||
sockets: 1 | ||
threads: 1 | ||
devices: | ||
disks: | ||
- disk: | ||
bus: virtio | ||
name: rootdisk | ||
bootOrder: 1 | ||
- disk: | ||
bus: virtio | ||
name: cloudinitdisk | ||
bootOrder: 2 | ||
interfaces: | ||
- masquerade: {} | ||
model: virtio | ||
name: default | ||
networkInterfaceMultiqueue: true | ||
rng: {} | ||
features: | ||
acpi: {} | ||
smm: | ||
enabled: true | ||
firmware: | ||
bootloader: | ||
bios: {} | ||
machine: | ||
type: q35 | ||
resources: | ||
requests: | ||
memory: 2Gi | ||
hostname: freebsd-mongodb | ||
networks: | ||
- name: default | ||
pod: {} | ||
terminationGracePeriodSeconds: 180 | ||
volumes: | ||
- name: rootdisk | ||
dataVolume: | ||
name: 'freebsd-mongodb-rootdisk' | ||
- cloudInitNoCloud: | ||
userData: | | ||
#cloud-config | ||
hostname: mongodb | ||
users: | ||
- name: kubevirt | ||
sudo: ALL=(ALL) NOPASSWD:ALL | ||
passwd: $6$Q1dGl.LfuMeS8RPP$b4xynn.Z3n2/h.YqOV90H7GzoAfjLKPMAKP1rzCeeBxiYNhROkxOXAC4rmQNbQf3oZ.Om8/Q7W8XmTgHsdoLw. | ||
shell: /bin/sh | ||
home: /home/kubevirt | ||
lock_passwd: false | ||
write_files: | ||
- content: | | ||
from pymongo import MongoClient | ||
client = MongoClient('localhost:27017') | ||
foo = client["admin"] | ||
foo.command("createUser", "porxie", pwd="porxie", roles=[{ 'role':'root', 'db':'admin'}]) | ||
path: /tmp/init-mongo.py | ||
permissions: '0600' | ||
runcmd: | ||
- pkg install -y qemu-tools mongodb70 | ||
- sed -i '' 's/bindIp:\ 127.0.0.1/bindIp:\ 0.0.0.0/' /usr/local/etc/mongodb.conf | ||
- echo 'mongod_enable="YES"' >>/etc/rc.conf | ||
- service mongod start | ||
- pkg install -y py39-pymongo | ||
- python3 /tmp/init-mongo.py | ||
name: cloudinitdisk | ||
dataVolumeTemplates: | ||
- metadata: | ||
name: 'freebsd-mongodb-rootdisk' | ||
spec: | ||
storage: | ||
resources: | ||
requests: | ||
storage: 5Gi | ||
storageClassName: px-csi-db | ||
preallocation: false | ||
source: | ||
pvc: | ||
name: freebsd-image | ||
namespace: pxbbq |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
kubectl create ns pxbbq | ||
kubectl label ns pxbbq app=pxbbq | ||
kubectl label ns pxbbq backup=true | ||
|
||
curl -O https://object-storage.public.mtl1.vexxhost.net/swift/v1/1dbafeefbd4f4c80864414a441e72dd2/bsd-cloud-image.org/images/freebsd/13.2/2023-04-21/zfs/freebsd-13.2-zfs-2023-04-21.qcow2 | ||
virtctl image-upload pvc freebsd-image -n pxbbq --size 5Gi --insecure --storage-class px-csi-db --image-path=./freebsd-13.2-zfs-2023-04-21.qcow2 | ||
|
||
kubectl apply -f /assets/kubevirt/ocp/pxbbq-freebsd.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters