k8s cassandra
This commit is contained in:
@@ -16,17 +16,20 @@
|
|||||||
* [Config Map](#config-map)
|
* [Config Map](#config-map)
|
||||||
* [Stateful Set](#stateful-set)
|
* [Stateful Set](#stateful-set)
|
||||||
* [Service](#service)
|
* [Service](#service)
|
||||||
|
* [Cassandra](#cassandra)
|
||||||
|
* [Stateful Set](#stateful-set-1)
|
||||||
|
* [Service](#service-1)
|
||||||
* [Hlæja](#hlæja)
|
* [Hlæja](#hlæja)
|
||||||
* [Account Register](#account-register)
|
* [Account Register](#account-register)
|
||||||
* [Secret](#secret-1)
|
* [Secret](#secret-1)
|
||||||
* [Config Map](#config-map-1)
|
* [Config Map](#config-map-1)
|
||||||
* [Deployment](#deployment)
|
* [Deployment](#deployment)
|
||||||
* [Service](#service-1)
|
* [Service](#service-2)
|
||||||
* [Device Register](#device-register)
|
* [Device Register](#device-register)
|
||||||
* [Secret](#secret-2)
|
* [Secret](#secret-2)
|
||||||
* [Config Map](#config-map-2)
|
* [Config Map](#config-map-2)
|
||||||
* [Deployment](#deployment-1)
|
* [Deployment](#deployment-1)
|
||||||
* [Service](#service-2)
|
* [Service](#service-3)
|
||||||
<!-- TOC -->
|
<!-- TOC -->
|
||||||
|
|
||||||
----
|
----
|
||||||
@@ -167,6 +170,57 @@ kubectl apply -f .\kube\02-databases\01-postgres\04-service.yaml
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
### Cassandra
|
||||||
|
|
||||||
|
For now... run basic cassandra, we need to add authentication later.
|
||||||
|
|
||||||
|
to get a clean cassandra configuration:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker run --rm cassandra:5.0 cat /etc/cassandra/cassandra.yaml > cassandra-default.yaml
|
||||||
|
```
|
||||||
|
|
||||||
|
modify `authenticator` and `authorizer` and som how get that change inside... local file get to big 262144 bytes limitation.
|
||||||
|
|
||||||
|
some help things for later
|
||||||
|
|
||||||
|
```bashe
|
||||||
|
kubectl exec -it -n hlaeja cassandra-0 -- bash
|
||||||
|
```
|
||||||
|
|
||||||
|
run one of this
|
||||||
|
|
||||||
|
```bash
|
||||||
|
nodetool status
|
||||||
|
```
|
||||||
|
|
||||||
|
or
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cqlsh
|
||||||
|
SELECT data_center FROM system.local;
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Stateful Set
|
||||||
|
|
||||||
|
This is the specifications for cassandra.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
kubectl apply -f .\kube\02-databases\02-cassandra\01-statefulset.yaml
|
||||||
|
```
|
||||||
|
|
||||||
|
Set storage size for permanent storage
|
||||||
|
|
||||||
|
#### Service
|
||||||
|
|
||||||
|
this exposes port and ip.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
kubectl apply -f .\kube\02-databases\02-cassandra\02-service.yaml
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
## Hlæja
|
## Hlæja
|
||||||
|
|
||||||
### Account Register
|
### Account Register
|
||||||
|
|||||||
38
kube/02-databases/02-cassandra/01-statefulset.yaml
Normal file
38
kube/02-databases/02-cassandra/01-statefulset.yaml
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
apiVersion: apps/v1
|
||||||
|
kind: StatefulSet
|
||||||
|
metadata:
|
||||||
|
name: cassandra
|
||||||
|
namespace: hlaeja
|
||||||
|
labels:
|
||||||
|
app: cassandra
|
||||||
|
environment: testing
|
||||||
|
tier: database
|
||||||
|
spec:
|
||||||
|
serviceName: cassandra
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: cassandra
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: cassandra
|
||||||
|
spec:
|
||||||
|
terminationGracePeriodSeconds: 1800
|
||||||
|
containers:
|
||||||
|
- name: cassandra
|
||||||
|
image: cassandra:5.0.4
|
||||||
|
ports:
|
||||||
|
- containerPort: 9042
|
||||||
|
volumeMounts:
|
||||||
|
- name: cassandra-data
|
||||||
|
mountPath: /var/lib/cassandra
|
||||||
|
volumeClaimTemplates:
|
||||||
|
- metadata:
|
||||||
|
name: cassandra-data
|
||||||
|
spec:
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteOnce
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: 10Gi
|
||||||
21
kube/02-databases/02-cassandra/02-service.yaml
Normal file
21
kube/02-databases/02-cassandra/02-service.yaml
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: cassandra
|
||||||
|
namespace: hlaeja
|
||||||
|
labels:
|
||||||
|
app: cassandra
|
||||||
|
environment: testing
|
||||||
|
tier: database
|
||||||
|
annotations:
|
||||||
|
metallb.universe.tf/address-pool: default
|
||||||
|
spec:
|
||||||
|
type: LoadBalancer
|
||||||
|
loadBalancerIP: 10.0.3.142
|
||||||
|
selector:
|
||||||
|
app: cassandra
|
||||||
|
ports:
|
||||||
|
- port: 9042
|
||||||
|
targetPort: 9042
|
||||||
|
protocol: TCP
|
||||||
|
name: cql
|
||||||
Reference in New Issue
Block a user