-
Notifications
You must be signed in to change notification settings - Fork 0
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
Manik2708
authored and
Manik2708
committed
Jun 28, 2024
1 parent
a355fe0
commit 68b9b45
Showing
20 changed files
with
519 additions
and
1 deletion.
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
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,17 @@ | ||
kind: Service | ||
apiVersion: v1 | ||
metadata: | ||
namespace: hi-cassandra | ||
name: cassandra-client | ||
labels: | ||
app: cassandra | ||
type: LoadBalancer | ||
spec: | ||
type: LoadBalancer | ||
ports: | ||
- name: cql | ||
protocol: TCP | ||
port: 9042 | ||
targetPort: 9042 | ||
selector: | ||
app: cassandra |
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,14 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
namespace: hi-cassandra | ||
labels: | ||
app: cassandra | ||
name: cassandra-headless | ||
spec: | ||
publishNotReadyAddresses: true | ||
clusterIP: None | ||
ports: | ||
- port: 9042 | ||
selector: | ||
app: cassandra |
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,4 @@ | ||
apiVersion: v1 | ||
kind: Namespace | ||
metadata: | ||
name: hi-cassandra |
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,101 @@ | ||
apiVersion: apps/v1 | ||
kind: StatefulSet | ||
metadata: | ||
name: cassandra-nodes | ||
namespace: hi-cassandra | ||
labels: | ||
app: cassandra | ||
spec: | ||
serviceName: cassandra | ||
podManagementPolicy: Parallel | ||
replicas: 2 | ||
selector: | ||
matchLabels: | ||
app: cassandra | ||
template: | ||
metadata: | ||
labels: | ||
app: cassandra | ||
spec: | ||
volumes: | ||
- name: cassandra-data | ||
persistentVolumeClaim: | ||
claimName: cassandra-data | ||
terminationGracePeriodSeconds: 1800 | ||
containers: | ||
- name: cassandra | ||
image: cassandra | ||
imagePullPolicy: Always | ||
ports: | ||
- containerPort: 7000 | ||
name: intra-node | ||
- containerPort: 7001 | ||
name: tls-intra-node | ||
- containerPort: 7199 | ||
name: jmx | ||
- containerPort: 9042 | ||
name: cql | ||
resources: | ||
limits: | ||
cpu: "500m" | ||
memory: 1Gi | ||
requests: | ||
cpu: "500m" | ||
memory: 1Gi | ||
securityContext: | ||
capabilities: | ||
add: | ||
- IPC_LOCK | ||
lifecycle: | ||
preStop: | ||
exec: | ||
command: | ||
- /bin/sh | ||
- -c | ||
- nodetool drain | ||
env: | ||
- name: MAX_HEAP_SIZE | ||
value: 512M | ||
- name: HEAP_NEWSIZE | ||
value: 100M | ||
# - name: CASSANDRA_SEEDS | ||
# value: "hi-cassandra.svc.cluster.local" | ||
- name: CASSANDRA_CLUSTER_NAME | ||
value: "hi-cassandra-cluster" | ||
- name: CASSANDRA_DC | ||
value: "DC1" | ||
- name: CASSANDRA_RACK | ||
value: "Rack1" | ||
- name: POD_IP | ||
valueFrom: | ||
fieldRef: | ||
fieldPath: status.podIP | ||
readinessProbe: | ||
exec: | ||
command: | ||
- /bin/bash | ||
- -c | ||
- nodetool status | ||
initialDelaySeconds: 30 | ||
timeoutSeconds: 30 | ||
livenessProbe: | ||
exec: | ||
command: | ||
- /bin/bash | ||
- -c | ||
- nodetool status | ||
initialDelaySeconds: 30 | ||
timeoutSeconds: 30 | ||
volumeMounts: | ||
- name: cassandra-data | ||
mountPath: /var/lib/cassandra | ||
volumeClaimTemplates: | ||
- metadata: | ||
name: cassandra-data | ||
namespace: hi-cassandra | ||
spec: | ||
accessModes: [ "ReadWriteOnce" ] | ||
storageClassName: standard | ||
resources: | ||
requests: | ||
storage: 1Gi |
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,33 @@ | ||
apiVersion: extensions/vibetal | ||
kind: Deployment | ||
metadata: | ||
name: hi-ingress-controller | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
name: nginix-ingress | ||
template: | ||
metadata: | ||
labels: | ||
name: nginix-ingress | ||
spec: | ||
containers: | ||
- name: nginix-ingress-controller | ||
image: quay.io/kubernetes-ingress-controller/nginx-ingress-controller | ||
args: | ||
- /nginix-ingress-controller | ||
env: | ||
- name: POD_NAME | ||
valueFrom: | ||
fieldRef: | ||
fieldPath: metadata.name | ||
- name: PODE_NAMESPACE | ||
valueFrom: | ||
fieldRef: | ||
fieldPath: metadata.namespace | ||
ports: | ||
- containerPort: 80 | ||
name: http | ||
- containerPort: 443 | ||
name: https |
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,19 @@ | ||
apiVersion: networking.k8s.io/v1 | ||
kind: Ingress | ||
metadata: | ||
name: hi-ingress | ||
annotations: | ||
nginx.ingress.kubernetes.io/rewrite-target: / | ||
spec: | ||
ingressClassName: nginx-class | ||
rules: | ||
- http: | ||
paths: | ||
- path: / | ||
pathType: Prefix | ||
backend: | ||
service: | ||
name: hi-web-service | ||
port: | ||
number: 80 | ||
|
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,20 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: hi-nginx-service | ||
spec: | ||
type: NodePort | ||
ports: | ||
- port: 80 | ||
targetPort: 80 | ||
protocol: TCP | ||
name: http | ||
- port: 443 | ||
targetPort: 443 | ||
protocol: TCP | ||
name: https | ||
selector: | ||
name: nginix-ingress | ||
|
||
|
||
|
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,4 @@ | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: hi-service-account |
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,22 @@ | ||
kind: Service | ||
apiVersion: v1 | ||
metadata: | ||
namespace: hi-rabbitmq | ||
name: rabbitmq-client | ||
labels: | ||
app: rabbitmq | ||
type: LoadBalancer | ||
spec: | ||
type: LoadBalancer | ||
ports: | ||
- name: http | ||
protocol: TCP | ||
port: 15672 | ||
- name: prometheus | ||
protocol: TCP | ||
port: 15692 | ||
- name: amqp | ||
protocol: TCP | ||
port: 5672 | ||
selector: | ||
app: rabbitmq |
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,22 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: rabbitmq-config | ||
namespace: hi-rabbitmq | ||
data: | ||
enabled_plugins: | | ||
[rabbitmq_peer_discovery_k8s, rabbitmq_management, rabbitmq_prometheus]. | ||
rabbitmq.conf: | | ||
## Clustering | ||
cluster_formation.peer_discovery_backend = rabbit_peer_discovery_k8s | ||
cluster_formation.k8s.host = kubernetes.default.svc.cluster.local | ||
cluster_formation.k8s.port = 6443 | ||
cluster_formation.k8s.address_type = hostname | ||
cluster_formation.node_cleanup.interval = 10 | ||
cluster_formation.node_cleanup.only_log_warning = true | ||
cluster_partition_handling = autoheal | ||
cluster_formation.k8s.service_name = rabbitmq-headless | ||
# queue master locator | ||
queue_master_locator=min-masters | ||
# enable guest user | ||
loopback_users.guest = false |
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,21 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: rabbitmq-headless | ||
namespace: hi-rabbitmq | ||
spec: | ||
clusterIP: None | ||
ports: | ||
- name: epmd | ||
port: 4369 | ||
protocol: TCP | ||
targetPort: 4369 | ||
- name: cluster-rpc | ||
port: 25672 | ||
protocol: TCP | ||
targetPort: 25672 | ||
selector: | ||
app: rabbitmq | ||
type: ClusterIP | ||
sessionAffinity: None | ||
publishNotReadyAddresses: true |
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,4 @@ | ||
apiVersion: v1 | ||
kind: Namespace | ||
metadata: | ||
name: hi-rabbitmq |
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,32 @@ | ||
--- | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: rabbitmq | ||
namespace: hi-rabbitmq | ||
--- | ||
kind: Role | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
metadata: | ||
name: rabbitmq | ||
namespace: hi-rabbitmq | ||
rules: | ||
- apiGroups: [""] | ||
resources: ["endpoints"] | ||
verbs: ["get"] | ||
- apiGroups: [""] | ||
resources: ["events"] | ||
verbs: ["create"] | ||
--- | ||
kind: RoleBinding | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
metadata: | ||
name: rabbitmq | ||
namespace: hi-rabbitmq | ||
subjects: | ||
- kind: ServiceAccount | ||
name: rabbitmq | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: Role | ||
name: rabbitmq |
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,14 @@ | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: erlang-cookie | ||
data: | ||
cookie: PUT_YOUR_COOKIE_HERE | ||
--- | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: rabbitmq-admin | ||
data: | ||
user: PUT_THE_USERNAME_HERE | ||
pass: PUT_THE_PASSWORD_HERE |
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,16 @@ | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: erlang-cookie | ||
namespace: hi-rabbitmq | ||
data: | ||
.erlang.cookie: UE5JUkRNSFVBV0tDT1hPU1dEU1A= | ||
--- | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: rabbitmq-admin | ||
namespace: hi-rabbitmq | ||
data: | ||
user: bWFuaWsyNzA4 | ||
pass: RG1hbmlrYUAyNzI3 |
Oops, something went wrong.