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

update instruction with agentSelector #166

Merged
merged 1 commit into from
Dec 14, 2023
Merged
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
3 changes: 2 additions & 1 deletion health-check/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export IMAGE_REGISTRY ?= ghcr.io/foundation-model-stack
export OPERATOR_NAMESPACE ?= multi-nic-cni-operator

IMAGE_TAG_BASE = $(IMAGE_REGISTRY)/multi-nic-cni
IMAGE_VERSION ?= 1.0.0
IMAGE_VERSION ?= 1.0.5
SIDECAR_IMG ?= $(IMAGE_TAG_BASE)-health-check-sidecar:v$(IMAGE_VERSION)
CHECKER_IMG ?= $(IMAGE_TAG_BASE)-health-checker:v$(IMAGE_VERSION)

Expand Down Expand Up @@ -47,5 +47,6 @@ deploy: deploy-agent

clean:
@kubectl delete -f ./checker/deployment.yaml && echo "Completely delete checkers" || echo "Failed to clean checkers"
@kubectl delete -f ./checker/configmap.yaml && echo "Completely delete configmap of checkers" || echo "Failed to clean configmap of checkers"
@kubectl delete -f ./checker/rbac.yaml && echo "Completely delete RBAC resource of checkers" || echo "Failed to clean RBAC resource of checkers"
@kubectl delete -f ./sidecar/manifest.yaml && echo "Completely delete agents" || echo "Failed to clean agents"
27 changes: 22 additions & 5 deletions health-check/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,29 @@ kubectl create ns multi-nic-cni-operator
kubectl label ns multi-nic-cni-operator openshift.io/cluster-monitoring=true
```

4. Run
4. Install health-check agents and checker

```bash
make deploy
```
4.1. (optional) specify node (agent) selector

- Modify `agentSelector` in `./checker/configmap.yaml`

4.2. run deploy script

- Cluster with only single multinicnetwork
```bash
make deploy
```

- Cluster with multiple multinicnetworks

```bash
# deploy health-check agents (used for all multinicnetwork)
make deploy-agent

# deploy checker (one deployment per multinicnetwork)
export NETWORK_NAME=<target multinicnetwork name>
./checker/script.sh deploy ${NETWORK_NAME}
```

```bash
# expected output
Expand Down Expand Up @@ -119,4 +137,3 @@ kubectl create ns multi-nic-cni-operator
```

![](./img/health-check-prom.png)

8 changes: 8 additions & 0 deletions health-check/checker/configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: multi-nic-cni-health-checker-cfg
namespace: multi-nic-cni-operator
data: {}
# agentSelector: |
# target=true
43 changes: 25 additions & 18 deletions health-check/checker/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,29 @@ spec:
serviceAccount: multi-nic-cni-health-checker-sa
serviceAccountName: multi-nic-cni-health-checker-sa
containers:
- name: checker
image: ghcr.io/foundation-model-stack/multi-nic-cni-health-checker:v1.0.5
imagePullPolicy: Always
ports:
- containerPort: 8080
name: http
env:
- name: CHECKER_NAME
valueFrom:
- name: checker
image: ghcr.io/foundation-model-stack/multi-nic-cni-health-checker:v1.0.5
imagePullPolicy: Always
ports:
- containerPort: 8080
name: http
env:
- name: CHECKER_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: CHECKER_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: TARGET_NETWORK
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: CHECKER_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: TARGET_NETWORK
valueFrom:
fieldRef:
fieldPath: metadata.annotations['k8s.v1.cni.cncf.io/networks']
fieldPath: metadata.annotations['k8s.v1.cni.cncf.io/networks']
volumeMounts:
- name: checker-config
mountPath: /etc/config
volumes:
- name: checker-config
configMap:
name: multi-nic-cni-health-checker-cfg
1 change: 1 addition & 0 deletions health-check/checker/script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ create_replacement() {
}

deploy() {
kubectl apply -f ./checker/configmap.yaml
kubectl apply -f ./checker/rbac.yaml
NETWORK_NAME=$1
if [ -z $1 ]; then
Expand Down
1 change: 1 addition & 0 deletions health-check/sidecar/patch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ apiVersion: apps/v1
kind: DaemonSet
metadata:
name: multi-nicd
namespace: multi-nic-cni-operator
spec:
template:
spec:
Expand Down
Loading