Skip to content

Commit

Permalink
modify kustomization for metric server listening address
Browse files Browse the repository at this point in the history
  • Loading branch information
卷石 committed Apr 14, 2023
1 parent acf3744 commit 8933db1
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 2 deletions.
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
IMG ?= openyurt/raven-agent:latest
VPN_DRIVER ?= libreswan
FORWARD_NODE_IP ?= false
METRIC_BIND_ADDR ?= ":8080"

BUILDPLATFORM ?= linux/amd64
TARGETOS ?= linux
Expand Down Expand Up @@ -64,7 +65,7 @@ docker-push: ## Push docker image with the agent.
##@ Deploy

gen-deploy-yaml:
bash hack/gen-yaml.sh ${IMG} ${VPN_DRIVER} ${FORWARD_NODE_IP}
bash hack/gen-yaml.sh ${IMG} ${VPN_DRIVER} ${FORWARD_NODE_IP} ${METRIC_BIND_ADDR}

deploy: gen-deploy-yaml ## Deploy agent daemon.
kubectl apply -f _output/yamls/raven-agent.yaml
Expand Down
5 changes: 5 additions & 0 deletions charts/raven-agent/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@ containerEnv:
configMapKeyRef:
key: forward-node-ip
name: raven-agent-config
- name: METRIC_BIND_ADDR
valueFrom:
configMapKeyRef:
key: metric-bind-addr
name: raven-agent-config
vpn:
driver: libreswan
forwardNodeIP: false
Expand Down
7 changes: 6 additions & 1 deletion config/raven-agent/agent/agent.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,9 @@ spec:
valueFrom:
configMapKeyRef:
name: agent-config
key: forward-node-ip
key: forward-node-ip
- name: METRIC_BIND_ADDR
valueFrom:
configMapKeyRef:
name: agent-config
key: metric-bind-addr
2 changes: 2 additions & 0 deletions hack/gen-yaml.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ gen_yaml() {
local IMG=$1
local VPN_DRIVER=$2
local FORWARD_NODE_IP=$3
local METRIC_BIND_ADDR=$4
local OUT_YAML_DIR=${YURT_ROOT}/_output/yamls
local BUILD_YAML_DIR=${OUT_YAML_DIR}/build
[ -f "${BUILD_YAML_DIR}" ] || mkdir -p "${BUILD_YAML_DIR}"
Expand All @@ -36,6 +37,7 @@ gen_yaml() {
[ -f "${BUILD_YAML_DIR}"/default/psk.env ] || echo "vpn-connection-psk=$(openssl rand -hex 64)" > "${BUILD_YAML_DIR}"/default/psk.env
[ -f "${BUILD_YAML_DIR}"/default/config.env ] || echo "vpn-driver=${VPN_DRIVER}" > "${BUILD_YAML_DIR}"/default/config.env
echo "forward-node-ip=${FORWARD_NODE_IP}" >> "${BUILD_YAML_DIR}"/default/config.env
echo "metric-bind-addr=${METRIC_BIND_ADDR}" >> "${BUILD_YAML_DIR}"/default/config.env
kustomize build "${BUILD_YAML_DIR}"/default > "${OUT_YAML_DIR}"/raven-agent.yaml
rm -Rf "${BUILD_YAML_DIR}"
}
Expand Down

0 comments on commit 8933db1

Please sign in to comment.