Skip to content

Commit

Permalink
fixing the fluent-bit (#407)
Browse files Browse the repository at this point in the history
Signed-off-by: Rajat <[email protected]>
  • Loading branch information
Rajat0002 authored Dec 19, 2023
1 parent 55f7a58 commit 4cc6d82
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 12 deletions.
10 changes: 5 additions & 5 deletions community_images/fluent-bit/ironbank/image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ runtimes:
tag: "FLUENT_BIT_IMAGE_TAG"
- type: k8s
script: k8s_coverage.sh
helm:
repo: fluent
repo_url: https://fluent.github.io/helm-charts
chart: fluent-bit
use_helm: False
wait_time_sec: 120
image_keys:
fluent-bit-ib:
repository: "image.repository"
tag: "image.tag"
override_file: "overrides.yml"
override_file: "overrides.yml"
readiness_wait_pod_name_suffix:
- ""
11 changes: 6 additions & 5 deletions community_images/fluent-bit/ironbank/k8s_coverage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,18 @@ SCRIPTPATH="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"

JSON_PARAMS="$1"

#JSON=$(cat "$JSON_PARAMS")
JSON=$(cat "$JSON_PARAMS")
echo "Json params for k8s coverage = $JSON"
NAMESPACE=$(jq -r '.namespace_name' < "$JSON_PARAMS")
RELEASE_NAME=$(jq -r '.release_name' < "$JSON_PARAMS")
echo "NAMESPACE: $NAMESPACE"
echo "RELEASE_NAME: $RELEASE_NAME"

sleep 10
CONTAINER_NAME=$(kubectl get pods -n "$NAMESPACE" -l "app.kubernetes.io/instance=$RELEASE_NAME" -o jsonpath='{.items[0].metadata.name}')
# copy over the script to the pod
kubectl cp "${SCRIPTPATH}"/config/fluent-bit.config "${CONTAINER_NAME}":/tmp/fluent-bit.config -n "${NAMESPACE}"
kubectl exec "${CONTAINER_NAME}" -n "${NAMESPACE}" -- /bin/bash -c "nohup /fluent-bit/bin/fluent-bit -c /tmp/fluent-bit.config" &

CONTAINER_NAME="$RELEASE_NAME"

kubectl exec -n "${NAMESPACE}" "${CONTAINER_NAME}" -- /bin/bash -c "/fluent-bit/bin/fluent-bit -c /etc/fluent-bit.conf" &
sleep 10
# Check if the process is still running and terminate it if needed
if ps -p $! > /dev/null; then
Expand Down
2 changes: 0 additions & 2 deletions community_images/fluent-bit/ironbank/overrides.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ containerSecurityContext:
allowPrivilegeEscalation: true
capabilities:
add: ["SYS_PTRACE"]
resourceType: deployment
replicaCount: 1
extraEnvVars:
- name: "RF_VERBOSE"
value: "0"
Expand Down

0 comments on commit 4cc6d82

Please sign in to comment.