Skip to content

Commit

Permalink
fix: setup of nomad and consul with dapr working
Browse files Browse the repository at this point in the history
  • Loading branch information
mati007thm committed Feb 9, 2024
1 parent b9d6c54 commit e2bd24e
Show file tree
Hide file tree
Showing 9 changed files with 113 additions and 67 deletions.
13 changes: 13 additions & 0 deletions dapr-distributed-calendar/hashicorp/components/barista_pubsub.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: dapr.io/v1alpha1
kind: Component
metadata:
name: baristapubsub
namespace: default
spec:
type: pubsub.redis
version: v1
metadata:
- name: redisHost
value: redis:6379
- name: redisPassword
value: ""
14 changes: 14 additions & 0 deletions dapr-distributed-calendar/hashicorp/components/consul.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@

apiVersion: dapr.io/v1alpha1
kind: Component
metadata:
name: consul
namespace: default
spec:
type: state.consul
version: v1
metadata:
- name: datacenter
value: dc1 # Required. Example: dc1
- name: httpAddr
value: 127.0.0.1:8500 # TODO update here 10.1.0.4:8500 # Required. Example: "consul.default.svc.cluster.local:8500"
26 changes: 26 additions & 0 deletions dapr-distributed-calendar/hashicorp/components/daprConfig.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@

apiVersion: dapr.io/v1alpha1
kind: Configuration
metadata:
name: daprConfig
spec:
nameResolution:
component: "consul"
configuration:
selfRegister: true
client:
address: "127.0.0.1:8500" # TODO: update here "10.1.0.4:8500" # Required. Example: "consul.default.svc.cluster.local:8500"
checks:
- name: "Dapr Health Status"
checkID: "daprHealth: - ${APP_ID} - ${CONSUL_HTTP_ADDR}"
interval: "15s"
tcp: "127.0.0.1:8500" # TODO: update here "10.1.0.4:8500" # Required. Example: "consul.default.svc.cluster.local:8500"
tags:
- "dapr"
queryOptions:
useCache: true
filter: "Checks.ServiceTags contains dapr"
tracing:
samplingRate: "1"
zipkin:
endpointAddress: http://127.0.0.1:9411/api/v2/spans
13 changes: 13 additions & 0 deletions dapr-distributed-calendar/hashicorp/components/kitchen_pubsub.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: dapr.io/v1alpha1
kind: Component
metadata:
name: kitchenpubsub
namespace: default
spec:
type: pubsub.redis
version: v1
metadata:
- name: redisHost
value: redis:6379
- name: redisPassword
value: ""
13 changes: 13 additions & 0 deletions dapr-distributed-calendar/hashicorp/components/orderup_pubsub.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: dapr.io/v1alpha1
kind: Component
metadata:
name: orderuppubsub
namespace: default
spec:
type: pubsub.redis
version: v1
metadata:
- name: redisHost
value: redis:6379
- name: redisPassword
value: ""
Empty file modified dapr-distributed-calendar/hashicorp/local/install-consule.sh
100644 → 100755
Empty file.
18 changes: 17 additions & 1 deletion dapr-distributed-calendar/hashicorp/local/install-nomad-consul.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,20 @@ sudo apt-get update && sudo apt-get install wget gpg coreutils
wget -O- https://apt.releases.hashicorp.com/gpg | sudo gpg --dearmor -o /usr/share/keyrings/hashicorp-archive-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/hashicorp.list
sudo apt-get update && sudo apt-get install nomad
sudo apt update && sudo apt install consul
sudo apt update && sudo apt install consul

# fix plugin error for working with consul
cd
curl -L -o cni-plugins.tgz "https://github.com/containernetworking/plugins/releases/download/v1.0.0/cni-plugins-linux-$( [ $(uname -m) = aarch64 ] && echo arm64 || echo amd64)"-v1.0.0.tgz
sudo mkdir -p /opt/cni/bin
sudo tar -C /opt/cni/bin -xzf cni-plugins.tgz

echo 1 | tee /proc/sys/net/bridge/bridge-nf-call-arptables
echo 1 | tee /proc/sys/net/bridge/bridge-nf-call-ip6tables
echo 1 | tee /proc/sys/net/bridge/bridge-nf-call-iptables

cd /etc/sysctl.d/ && sudo touch 10-bridge-nf-call-iptables.conf
echo "net.bridge.bridge-nf-call-arptables = 1" | sudo tee /etc/sysctl.d/10-bridge-nf-call-iptables.conf
echo "net.bridge.bridge-nf-call-ip6tables = 1" | sudo tee -a /etc/sysctl.d/10-bridge-nf-call-iptables.conf
echo "net.bridge.bridge-nf-call-iptables = 1" | sudo tee -a /etc/sysctl.d/10-bridge-nf-call-iptables.conf
sudo sysctl --system
18 changes: 17 additions & 1 deletion dapr-distributed-calendar/hashicorp/local/install-nomad.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,20 @@
sudo apt-get update && sudo apt-get install wget gpg coreutils
wget -O- https://apt.releases.hashicorp.com/gpg | sudo gpg --dearmor -o /usr/share/keyrings/hashicorp-archive-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/hashicorp.list
sudo apt-get update && sudo apt-get install nomad
sudo apt-get update && sudo apt-get install nomad

# fix plugin error for working with consul
cd
curl -L -o cni-plugins.tgz "https://github.com/containernetworking/plugins/releases/download/v1.0.0/cni-plugins-linux-$( [ $(uname -m) = aarch64 ] && echo arm64 || echo amd64)"-v1.0.0.tgz
sudo mkdir -p /opt/cni/bin
sudo tar -C /opt/cni/bin -xzf cni-plugins.tgz

echo 1 | tee /proc/sys/net/bridge/bridge-nf-call-arptables
echo 1 | tee /proc/sys/net/bridge/bridge-nf-call-ip6tables
echo 1 | tee /proc/sys/net/bridge/bridge-nf-call-iptables

cd /etc/sysctl.d/ && sudo touch 10-bridge-nf-call-iptables.conf
echo "net.bridge.bridge-nf-call-arptables = 1" | sudo tee /etc/sysctl.d/10-bridge-nf-call-iptables.conf
echo "net.bridge.bridge-nf-call-ip6tables = 1" | sudo tee -a /etc/sysctl.d/10-bridge-nf-call-iptables.conf
echo "net.bridge.bridge-nf-call-iptables = 1" | sudo tee -a /etc/sysctl.d/10-bridge-nf-call-iptables.conf
sudo sysctl --system
65 changes: 0 additions & 65 deletions dapr-distributed-calendar/hashicorp/local/start-mac.sh

This file was deleted.

0 comments on commit e2bd24e

Please sign in to comment.