-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rewrote entrypoint script. Now that environment variables are nativel…
…y supported, there is no need for templating the configuration file.
- Loading branch information
Showing
5 changed files
with
26 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
# Jetbrains IDE local configs | ||
/.idea/ | ||
.idea | ||
.vscode | ||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,6 @@ FROM ${ARCH}alpine:3.18 as container | |
WORKDIR /app | ||
COPY --from=builder /app/src/idrac_exporter /app/bin/ | ||
RUN apk add -U bash gettext | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
mrlhansen
Author
Owner
|
||
COPY idrac.yml.template /etc/prometheus/ | ||
COPY default-config.yml /etc/prometheus/idrac.yml | ||
COPY entrypoint.sh /app | ||
ENTRYPOINT /app/entrypoint.sh | ||
ENTRYPOINT ["/app/entrypoint.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
address: 0.0.0.0 | ||
port: 9348 | ||
hosts: | ||
default: | ||
username: root | ||
password: calvin | ||
metrics: | ||
system: true | ||
sensors: true | ||
power: true | ||
events: true | ||
storage: true | ||
memory: true | ||
network: true | ||
events: | ||
severity: warning | ||
maxage: 7d |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,9 @@ | ||
#!/bin/bash | ||
|
||
config=/etc/prometheus/idrac.yml | ||
|
||
if [[ ! -z "$IDRAC_USERNAME" ]] && [[ ! -z "$IDRAC_PASSWORD" ]]; then | ||
envsubst <${config}.template > /app/config/idrac.yml | ||
config=/app/config/idrac.yml | ||
elif [ ! -e "$config" ]; then | ||
auth_file=/authconfig/$NODE_NAME | ||
|
||
if [ ! -e "$auth_file" ]; then | ||
>&2 echo "$config not found _and_ $auth_file not found." | ||
else | ||
# auth_file contents are in the format: user=password | ||
export IDRAC_USERNAME=$(cut -f1 -d= $auth_file) | ||
export IDRAC_PASSWORD=$(cut -f2- -d= $auth_file) | ||
envsubst <${config}.template > /app/config/idrac.yml | ||
fi | ||
|
||
auth_file="/authconfig/$NODE_NAME" | ||
if [ -f "$auth_file" ]; then | ||
export CONFIG_DEFAULT_USERNAME=$(cut -f1 -d= $auth_file) | ||
export CONFIG_DEFAULT_PASSWORD=$(cut -f2- -d= $auth_file) | ||
fi | ||
|
||
exec bin/idrac_exporter -config="$config" | ||
exec bin/idrac_exporter "$@" |
This file was deleted.
Oops, something went wrong.
As far as I can see you do not need
gettext
any longer. It was installed forenvsubst
, right?