Skip to content

Commit

Permalink
Everything should get running with make alone.
Browse files Browse the repository at this point in the history
  • Loading branch information
JoelJa835 committed Jun 26, 2024
1 parent fdbe4a8 commit 983bd84
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 47 deletions.
9 changes: 6 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,16 @@ MINIO_PV_FILE := kubernetes/storage/minio-pv.yaml
MINIO_DEPLOYMENT_FILE := kubernetes/storage/minio-deployment.yaml
MINIO_SERVICE_FILE := kubernetes/services/minio-service.yaml

MANAGER_SERVICE_FILE := kubernetes/service/manager-service.yaml
MANAGER_SERVICE_FILE := kubernetes/services/manager-service.yaml
MANAGER_DEPLOYMENT_FILE := kubernetes/deployments/manager-service-statefull-set.yaml


ROLES_CREATE_FILE := kubernetes/roles/job-creator-role.yaml
ROLES_ROLESBIND := kubernetes/roles/job-creator-rolebinding.yaml




# Targets
.PHONY: deploy

Expand All @@ -33,7 +35,7 @@ deploy:
kubectl create -f $(AUTH_DEPLOYMENT_FILE)
kubectl create -f $(AUTH_SERVICE_FILE)
kubectl create -f $(CASSANDRA_SERVICE_FILE)
kubectl create -f $(CASSANDRA_STORAGE_FILE)
#kubectl create -f $(CASSANDRA_STORAGE_FILE)
kubectl create -f $(CASSANDRA_DEPLOYMENT_FILE)
kubectl create -f $(MINIO_STORAGE_FILE)
kubectl create -f $(MINIO_PV_FILE)
Expand All @@ -47,6 +49,7 @@ deploy:




.PHONY: clean

clean:
Expand All @@ -65,4 +68,4 @@ clean:
kubectl delete -f $(MANAGER_SERVICE_FILE)
kubectl delete -f $(MANAGER_DEPLOYMENT_FILE)
kubectl delete -f $(ROLES_CREATE_FILE)
kubectl delete -f $(ROLES_ROLESBIND)
kubectl delete -f $(ROLES_ROLESBIND)
31 changes: 22 additions & 9 deletions kubernetes/dds/cassandra-statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,30 +29,43 @@ spec:
name: cql
env:
- name: CASSANDRA_SEEDS
value: cassandra-0.cassandra.dena.svc.cluster.local
value: "cassandra-0.cassandra.dena.svc.cluster.local"
- name: MAX_HEAP_SIZE
value: 256M
value: "256M"
- name: HEAP_NEWSIZE
value: 100M
value: "100M"
- name: CASSANDRA_CLUSTER_NAME
value: "Cassandra"
- name: CASSANDRA_DC
value: "DC1"
- name: CASSANDRA_RACK
value: "Rack1"
- name: CASSANDRA_ENDPOINT_SNITCH
value: GossipingPropertyFileSnitch
value: "GossipingPropertyFileSnitch"
lifecycle:
postStart:
exec:
command: ["/bin/sh", "-c",
"echo \"Waiting for Cassandra to start...\";
while ! echo \"DESCRIBE KEYSPACES;\" | cqlsh; do sleep 2; done;
echo \"Cassandra is ready! Initializing schema...\";
cqlsh -e \"CREATE KEYSPACE IF NOT EXISTS admins WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1};
USE admins;
CREATE TABLE IF NOT EXISTS users (user_id UUID PRIMARY KEY, username TEXT, password TEXT);
INSERT INTO users (user_id, username, password) VALUES (uuid(), 'admin', 'admin') IF NOT EXISTS;
CREATE TABLE IF NOT EXISTS roles (role_name TEXT PRIMARY KEY, permissions SET<TEXT>);
INSERT INTO roles (role_name, permissions) VALUES ('admin', {'CREATE', 'ALTER', 'DROP', 'SELECT', 'MODIFY'}) IF NOT EXISTS;\""]
volumeMounts:
- name: cassandra-data
mountPath: /var/lib/cassandra/data
mountPath: "/var/lib/cassandra/data"
volumeClaimTemplates:
- metadata:
name: cassandra-data
namespace: dena
annotations: # comment line if you want to use a StorageClass
volume.beta.kubernetes.io/storage-class: "" # comment line if you want to use a StorageClass or specify which StorageClass
namespace: "dena"
annotations:
volume.beta.kubernetes.io/storage-class: ""
spec:
accessModes: ["ReadWriteOnce"]
resources:
requests:
storage: 1Gi
storage: "1Gi"
68 changes: 34 additions & 34 deletions kubernetes/dds/local-volumes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,37 +14,37 @@ spec:
hostPath:
path: /tmp/data/cassandra-data-1
persistentVolumeReclaimPolicy: Recycle
---
apiVersion: v1
kind: PersistentVolume
metadata:
name: cassandra-data-2
namespace: dena
labels:
type: local
app: cassandra
spec:
capacity:
storage: 1Gi
accessModes:
- ReadWriteOnce
hostPath:
path: /tmp/data/cassandra-data-2
persistentVolumeReclaimPolicy: Recycle
---
apiVersion: v1
kind: PersistentVolume
metadata:
name: cassandra-data-3
namespace: dena
labels:
type: local
app: cassandra
spec:
capacity:
storage: 1Gi
accessModes:
- ReadWriteOnce
hostPath:
path: /tmp/data/cassandra-data-3
persistentVolumeReclaimPolicy: Recycle
# ---
# apiVersion: v1
# kind: PersistentVolume
# metadata:
# name: cassandra-data-2
# namespace: dena
# labels:
# type: local
# app: cassandra
# spec:
# capacity:
# storage: 1Gi
# accessModes:
# - ReadWriteOnce
# hostPath:
# path: /tmp/data/cassandra-data-2
# persistentVolumeReclaimPolicy: Recycle
# ---
# apiVersion: v1
# kind: PersistentVolume
# metadata:
# name: cassandra-data-3
# namespace: dena
# labels:
# type: local
# app: cassandra
# spec:
# capacity:
# storage: 1Gi
# accessModes:
# - ReadWriteOnce
# hostPath:
# path: /tmp/data/cassandra-data-3
# persistentVolumeReclaimPolicy: Recycle
2 changes: 1 addition & 1 deletion testing_scripts/tester.sh
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ kubectl delete -f minio-storage-class.yaml


#fix for kubernetes storages
kubectl patch pv cassandra-data-pv-1 -p '{"metadata":{"finalizers":null}}'
kubectl patch pv cassandra-data-1 -p '{"metadata":{"finalizers":null}}'

kubectl rollout restart deployment ui-deployment -n dena

Expand Down

0 comments on commit 983bd84

Please sign in to comment.