Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added variant supporting development on docker desktop #296

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions variants/docker-desktop/Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
docker-desktop variant enables quick development on docker-desktop
=

Used simple bash scripts to deploy in order to simplify debugging
first time the deployment is slow due to fetching images
Tested on mac

To init: apply.sh
To delete: delete.sh


To purge pvc after delete.sh
-
```
kubectl get all,pv,pvc -n kafka


kubectl patch persistentvolume/pvc-a1c7bd1e-11f9-11ea-9768-025000000001 -p '{"metadata":{"finalizers": []}}' --type=merge
kubectl patch persistentvolume/pvc-a1c92058-11f9-11ea-9768-025000000001 -p '{"metadata":{"finalizers": []}}' --type=merge
kubectl patch persistentvolume/pvc-a2200b1f-11f9-11ea-9768-025000000001 -p '{"metadata":{"finalizers": []}}' --type=merge
kubectl patch persistentvolume/pvc-a221cf45-11f9-11ea-9768-025000000001 -p '{"metadata":{"finalizers": []}}' --type=merge
kubectl patch persistentvolume/pvc-a223ceca-11f9-11ea-9768-025000000001 -p '{"metadata":{"finalizers": []}}' --type=merge
kubectl patch -p '{"metadata":{"finalizers": []}}' --type=merge
kubectl patch -p '{"metadata":{"finalizers": []}}' --type=merge
kubectl patch -p '{"metadata":{"finalizers": []}}' --type=merge
```
48 changes: 48 additions & 0 deletions variants/docker-desktop/apply.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#!/usr/bin/env bash

# Abasic bash script (I know it repeats itself) for simplicity

DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
echo "$0 is located at: $DIR"

# make this file's location parents parent the working dir
cd $DIR/../../

base=$(pwd)
echo "working directory is base:\n$base"


kubectl apply -f 00-namespace.yml


kubectl apply -f variants/docker-desktop/docker-storage.yaml


kubectl apply -f rbac-namespace-default/node-reader.yml

kubectl apply -f rbac-namespace-default/pod-labler.yml


kubectl apply -f variants/docker-desktop/default-privilege-add.yaml


kubectl apply -f zookeeper/10zookeeper-config.yml

kubectl apply -f zookeeper/20pzoo-service.yml

kubectl apply -f zookeeper/21zoo-service.yml

kubectl apply -f zookeeper/30service.yml

kubectl apply -f zookeeper/50pzoo.yml

kubectl apply -f zookeeper/51zoo.yml


kubectl apply -f kafka/10broker-config.yml

kubectl apply -f kafka/20dns.yml

kubectl apply -f kafka/30bootstrap-service.yml

kubectl apply -f kafka/50kafka.yml
35 changes: 35 additions & 0 deletions variants/docker-desktop/default-privilege-add.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
apiVersion: v1
kind: Namespace
metadata:
name: my-namespace

---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRole
metadata:
name: default-privilege-add
rules:
- apiGroups: [""]
resources:
- endpoints
- services
- pods
verbs: ["get", "list", "watch"]

---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
metadata:
name: default-privilege-add
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: default-privilege-add
subjects:
- kind: ServiceAccount
name: default
namespace: default
- kind: ServiceAccount
name: my-namespace
namespace: my-namespace
66 changes: 66 additions & 0 deletions variants/docker-desktop/delete.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
#!/usr/bin/env bash

# Abasic bash script (I know it repeats itself) for simplicity

DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
echo "$0 is located at: $DIR"

# make this file's location parents parent the working dir
cd $DIR/../../

base=$(pwd)
echo "working directory is base:\n$base"


kubectl delete -f kafka/50kafka.yml

kubectl delete -f kafka/30bootstrap-service.yml

kubectl delete -f kafka/20dns.yml

kubectl delete -f kafka/10broker-config.yml



kubectl delete -f zookeeper/51zoo.yml

kubectl delete -f zookeeper/50pzoo.yml


#kubectl delete pv,pvc -n kafka --all

kubectl delete -f variants/docker-desktop/docker-storage.yaml


kubectl delete -f zookeeper/30service.yml

kubectl delete -f zookeeper/21zoo-service.yml

kubectl delete -f zookeeper/20pzoo-service.yml

kubectl delete -f zookeeper/10zookeeper-config.yml


kubectl delete -f variants/docker-desktop/default-privilege-add.yaml


kubectl delete -f rbac-namespace-default/pod-labler.yml

kubectl delete -f rbac-namespace-default/node-reader.yml


#kubectl delete -f 00-namespace.yml














9 changes: 9 additions & 0 deletions variants/docker-desktop/docker-storage.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
name: standard
namespace: kafka
provisioner: docker.io/hostpath
reclaimPolicy: Retain
allowVolumeExpansion: true
volumeBindingMode: Immediate