Uipathctl tool does not appear to be able to correctly set require_tls.
Issue Description:
When following the documentation to set up Alertmanager alert email receiver, there is no direct option to set require-tls to false based on customer requirements.
It is required to do this manually by editing the alertmanager secret.
Steps to set up email alerts with require-tls set to false:
- Using uipathctl run the command to configure alert email receiver.
- Example for no authentication:
- uipathctl config alerts add-email --name test --to "admin@example.com" --from "admin@example.com" --smtp "server.mycompany.com:25"
- Example for authentication:
- uipathctl config alerts add-email --name test --to "admin@example.com" --from "admin@example.com" --smtp "server.mycompany.com:587" --username admin --password "somepassword"
- Reset alert manager sts so config is enabled:
kubectl -n cattle-monitoring-system rollout restart sts alertmanager-rancher-monitoring-alertmanager
- Check alertmanager config via secret:
kubectl -n cattle-monitoring-system get secret alertmanager-config -ojson | jq -r '.data."alertmanager.yaml"' | base64 -d
- On Review, it is observed that require-tls is set to true as this is set by default, regardless of the flag used.
- Backup alertmanager-config secret
kubectl -n cattle-monitoring-system get secret alertmanager-config -oyaml > alertmanager-config.yaml
- Get the relevant config from alertmanager-config secret
kubectl -n cattle-monitoring-system get secret alertmanager-config -ojson | jq -r '.data."alertmanager.yaml"' | base64 -d > alertmanager.yaml
- Update the alertmanager.yaml to set require_tls to false
vi alertmanager.yaml
- On the require_tls under the email receiver that has been set up, change it from true to false
- name: test
email_configs:
- send_resolved: true
to:
from:
hello: uipath
smarthost: :
auth_username:
auth_password:
require_tls: false
- Apply changes to file using :wq!
- To apply the change to kubernetes, run the following command
updated_alertmanager_config=$(cat alertmanager.yaml | base64 -w0) kubectl -n cattle-monitoring-system patch secret alertmanager-config --type='json' -p='[{"op" : "replace", "path" : "/data/alertmanager.yaml", "value" : "'"${updated_alertmanager_config}"'"}]'
- Run the following command to confirm that the change was successfully applied
kubectl -n cattle-monitoring-system get secret alertmanager-config -ojson | jq -r '.data."alertmanager.yaml"' | base64 -d
- Validate that the require-tls setting is set to false.
- Validate in logs if alertmanager has alerts enabled by checking logs or if there were issues by checking the alertmanager logs.
kubectl -n cattle-monitoring-system logs alertmanager-rancher-monitoring-alertmanager-0
- If there are no errors then this should be set up correctly and alerts should be received via the email receiver.
Note: If still there are errors, capture the errors, gather a support bundle and open a support ticket with UiPath Product Support Team.