Skip to content

Commit

Permalink
charts: rancher fleet multinode deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
hunchback committed Feb 18, 2021
1 parent b381196 commit dc3f5a0
Show file tree
Hide file tree
Showing 6 changed files with 398 additions and 4 deletions.
4 changes: 4 additions & 0 deletions .mk/k8s.mk
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ $(TOOLSBIN)/kubectl:
sudo -E curl -fsSL -o $(TOOLSBIN)/kubectl https://storage.googleapis.com/kubernetes-release/release/v1.20.1/bin/linux/amd64/kubectl && \
sudo -E chmod a+x $(TOOLSBIN)/kubectl

$(TOOLSBIN)/jq:
sudo wget -O $@ https://github.com/stedolan/jq/releases/download/jq-1.6/jq-linux64 && \
sudo chmod a+x $@

# NodePorts are in the 30000-32767 range by default, which means a NodePort is
# unlikely to match a service’s intended port (for example, 8080 may be exposed
# as 31020).
Expand Down
8 changes: 5 additions & 3 deletions contrib/charts/skydive-analyzer/Makefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
include ../../../.mk/k8s.mk

# must be within the range of k8s nodePort
ANALYZER_NODEPORT?=30000
ANALYZER_NODEPORT?=30082
ANALYZER_PORT?=8082
ANALYZER_SERVICE?=skydive-analyzer
ETCD_NODEPORT?=30001
NEWUI_NODEPORT?=30002
ETCD_NODEPORT?=30079
NEWUI_NODEPORT?=30080

.PHONY: uninstall
uninstall: $(TOOLSBIN)/helm
Expand All @@ -14,10 +14,12 @@ uninstall: $(TOOLSBIN)/helm
.PHONY: install
install: $(TOOLSBIN)/helm
helm install skydive-analyzer . \
--set service.type=NodePort \
--set service.port=${ANALYZER_PORT} \
--set service.nodePort=${ANALYZER_NODEPORT} \
--set etcd.nodePort=${ETCD_NODEPORT} \
--set elasticsearch.enabled=true \
--set newui.enabled=true \
--set newui.nodePort=${NEWUI_NODEPORT} \

.PHONY: status
Expand Down
70 changes: 70 additions & 0 deletions contrib/charts/skydive-analyzer/fleet.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
defaultNamespace: default
targetCustomizations:
- name: broker
helm:
values:
newui:
enabled: false
service:
type: NodePort
nodePort: 30082
etcd:
nodePort: 30079
extraEnvs:
- name: SKYDIVE_HOST_ID
value: "broker"
- name: SKYDIVE_ANALYZER_TOPOLOGY_FABRIC
value: null
- name: SKYDIVE_ANALYZER_TOPOLOGY_K8S_CLUSTER_NAME
value: "broker"
clusterSelector:
matchLabels:
name: local

- name: east
helm:
values:
newui:
enabled: false
service:
type: ClusterIP
extraEnvs:
- name: SKYDIVE_HOST_ID
value: "east"
- name: SKYDIVE_ANALYZERS
value: "broker:30082"
- name: SKYDIVE_ANALYZER_TOPOLOGY_FABRIC
value: null
- name: SKYDIVE_ANALYZER_TOPOLOGY_K8S_CLUSTER_NAME
value: "east"
- name: SKYDIVE_ETCD_EMBEDDED
value: "false"
- name: SKYDIVE_ETCD_SERVERS
value: "http://broker:30079"
clusterSelector:
matchLabels:
env: east

- name: west
helm:
values:
newui:
enabled: false
service:
type: ClusterIP
extraEnvs:
- name: SKYDIVE_HOST_ID
value: "west"
- name: SKYDIVE_ANALYZERS
value: "broker:30082"
- name: SKYDIVE_ANALYZER_TOPOLOGY_FABRIC
value: null
- name: SKYDIVE_ANALYZER_TOPOLOGY_K8S_CLUSTER_NAME
value: "west"
- name: SKYDIVE_ETCD_EMBEDDED
value: "false"
- name: SKYDIVE_ETCD_SERVERS
value: "http://broker:30079"
clusterSelector:
matchLabels:
env: west
2 changes: 1 addition & 1 deletion contrib/charts/skydive-analyzer/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ etcd:
nodePort:

newui:
enabled: true
enabled: false
image:
repository: "skydive/skydive-ui"
tag: "latest"
Expand Down
9 changes: 9 additions & 0 deletions contrib/fleet/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
include ../../.mk/k8s.mk

.PHONY: install uinstall status logs
install uninstall status logs: $(TOOLSBIN)/k3d $(TOOLSBIN)/helm $(TOOLSBIN)/kubectl $(TOOLSBIN)/jq
./skydive.sh $@

.PHONY: broker east west
broker east west: $(TOOLSBIN)/kubectl
kubectl --context k3d-$@ port-forward service/skydive-analyzer 8082:8082
Loading

0 comments on commit dc3f5a0

Please sign in to comment.