{"id":13521728,"url":"https://github.com/topfreegames/fluxcloud","last_synced_at":"2025-03-31T20:32:36.365Z","repository":{"id":40400034,"uuid":"263698745","full_name":"topfreegames/fluxcloud","owner":"topfreegames","description":"Slack notifications for Weave Flux without Weave Cloud","archived":false,"fork":true,"pushed_at":"2022-05-10T21:30:39.000Z","size":3340,"stargazers_count":36,"open_issues_count":7,"forks_count":16,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-11-02T05:32:58.369Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"oliviabarrick/fluxcloud","license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/topfreegames.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-05-13T17:29:09.000Z","updated_at":"2023-01-16T21:36:24.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/topfreegames/fluxcloud","commit_stats":null,"previous_names":[],"tags_count":31,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/topfreegames%2Ffluxcloud","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/topfreegames%2Ffluxcloud/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/topfreegames%2Ffluxcloud/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/topfreegames%2Ffluxcloud/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/topfreegames","download_url":"https://codeload.github.com/topfreegames/fluxcloud/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246536210,"owners_count":20793404,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T06:00:37.574Z","updated_at":"2025-03-31T20:32:35.983Z","avatar_url":"https://github.com/topfreegames.png","language":"Go","funding_links":[],"categories":["Ancillary Tools"],"sub_categories":["Notifications"],"readme":"Fluxcloud is a tool to receive events from the [Weave flux](https://github.com/fluxcd/flux).\n\n[![Actions Status](https://github.com/topfreegames/fluxcloud/workflows/Test/badge.svg)](https://github.com/topfreegames/fluxcloud/actions)\n\nWeave Flux is a useful tool for managing the state of your Kubernetes cluster.\n\nFluxcloud is a valid upstream for Weave, allowing you to send Flux events to Slack or a\nwebhook without using Weave Cloud.\n\n# Docker\nImages are available at [DockerHub](https://hub.docker.com/r/tfgco/fluxcloud) and [Quay](https://quay.io/repository/tfgco/fluxcloud)\n\n\n# Setup\n\nPlease see the [Weave Flux setup documentation](https://github.com/fluxcd/flux/blob/master/site/standalone/installing.md) for setting up Flux.\n\nTo use Fluxcloud, you can deploy fluxcloud as either a sidecar to Flux or a seperate deployment.\n\nTo deploy as a sidecar, see `examples/flux-deployment-sidecar.yaml`.\nTo deploy independently, see `examples/fluxcloud.yaml`.\n\nSet the following environment variables in your chosen deployment:\n\n* `SLACK_URL`: the Slack [webhook URL](https://api.slack.com/incoming-webhooks) to use.\n* `SLACK_USERNAME`: the Slack username to use when sending messages.\n* `SLACK_TOKEN` (optional): legacy Slack API token to use.\n* `SLACK_CHANNEL`: the Slack channel to send messages to.\n* `SLACK_ICON_EMOJI`: the Slack emoji to use as the icon.\n* `MATTERMOST_URL`: the Mattermost [webhook URL](https://docs.mattermost.com/developer/webhooks-incoming.html) to use.\n* `MATTERMOST_USERNAME`: the Mattermost username to use when sending messages.\n* `MATTERMOST_CHANNEL`: the Mattermost channel to send messages to.\n* `MATTERMOST_ICON_URL`: the Mattermost Icon URL to use as the icon.\n* `DATADOG_API_KEY`: the Datadog API key used to push events.\n* `DATADOG_APP_KEY`: the Datadog APP key used to push events.\n* `DATADOG_ADITIONAL_TAGS`: Datadog aditional tags to be added to the generated event.\n* `MSTEAMS_URL`: the Microsoft Teams [webhook URL](https://docs.microsoft.com/en-us/outlook/actionable-messages/send-via-connectors#sending-actionable-messages-via-office-365-connectors) to use\n* `GITHUB_URL`: the URL to the Github repository that Flux uses, used for Slack links.\n* `WEBHOOK_URL`: if the exporter is \"webhook\", then the URL to use for the webhook.\n* `EXPORTER_TYPE` (optional): The types of exporter to use in comma delimited form. (Ex: `slack,webhook`) (Choices: slack, msteams, datadog, webhook, Default: slack)\n* `JAEGER_ENDPOINT` (optional): endpoint to report Jaeger traces to.\n\nAnd then apply the configuration:\n\n```\nkubectl apply -f examples/fluxcloud.yaml\n```\n\nSet the `--connect` flag on Flux to `--connect=ws://fluxcloud`.\n\n# Exporters\n\nThere are multiple exporters that you can use with fluxcloud. If there is not a suitable\none already, feel free to contribute one by implementing the [exporter interface](https://github.com/topfreegames/fluxcloud/blob/master/pkg/exporters/exporter.go)!\n\n# Formatters\n\n## Templates\n\nThe default formatter uses go templates for the three different sections that compose an event: the title, the body and the commit message.\n\nThere are default values for all these templates, but it's possible to redefine them, you only need to ensure there is a `templates/` folder in the working directory of FluxCloud with the files:\n* `body.tmpl`\n* `title.tmpl`\n* `commit.tmpl`\n\nNot all the three files are required to exist, you may define only a subset.\n\nThe values passed to the templates are defined by the `tplValues` struct of the `pkg/formatters/default.go` file. You may also look the passed functions at the `tplFuncMap` function map.\n\nBefore using the defaults, the templates are also fetched from these environment variables:\n* `BODY_TEMPLATE`\n* `TITLE_TEMPLATE`\n* `COMMIT_TEMPLATE`\n\nThe files have precedence over the environment variables.\n\n### Formatting commit links\n\nBy default, commit links are formatted for Github. It is possible to format them\nfor another VCS system, such as Bitbucket, by overriding the commit template.\n\nThe commit template is a go template that supports two variables:\n\n* `VCSLink`: which is the GITHUB_URL configuration option.\n* `Commit`: which is the commit id.\n\nThe default is:\n\n```\n{{ .VCSLink }}/commit/{{ .Commit }}\n```\n\nFor example, to override to work for Bitbucket, set the `COMMIT_TEMPLATE` environment\nvariable to:\n\n```\n{{ .VCSLink }}/commits/{{ .Commit }}\n```\n\n## Slack\n\nThe default exporter to use is Slack. To use the Slack exporter, set the `SLACK_URL`,\n`SLACK_USERNAME`, and `SLACK_CHANNEL` environment variables to\nuse. You can also optionally set the `EXPORTER_TYPE` to \"slack\".\n\n### Sending notifications to multiple channels\n\nIf sending notifications to only one channel is unsufficient for your use case you can\nconfigure fluxcloud to send them to multiple channels based upon the namespace(s) from\nthe created and/or updated resources. This is done by setting a comma separated\n`\u003cchannel\u003e=\u003cnamespace\u003e` string as the `SLACK_CHANNEL` environment variable.\n\nIf you for example want to send notifications of all events to `#k8s-events` but only\nevents from namespace `team-b` to `#teamb` you would set the following string:\n`SLACK_CHANNEL=#k8s-events=*,#team-b=team-b`.\n\n## Microsoft Teams\n\nSet the environment variable `MSTEAMS_URL` to the URL generated on activation of an\nIncoming Webhook in a Microsoft Teams channel.\n\n## Mattermost\n\nTo use the Mattermost exporter, set the `MATTERMOST_URL`,\n`MATTERMOST_USERNAME`, and `MATTERMOST_CHANNEL` environment variables to\nuse. You can also optionally set the `EXPORTER_TYPE` to \"mattermost\".\n\n## Datadog\n\nEvents can be sent to Datadog by adding \"datadog\" to to `EXPORTER_TYPE` and then setting\nthe `DATADOG_API_KEY` and the `DATADOG_APP_KEY`. More information about generating those\nkeys can be found in [Datadog documentation](https://docs.datadoghq.com/account_management/api-app-keys/).\n\nYou can also add additional tags to the event by setting `DATADOG_ADDITIONAL_TAGS`.\n\n## Webhooks\n\nEvents can be sent to an arbitrary webhook by setting the `EXPORTER_TYPE` to \"webhook\" and\nthen setting the `WEBHOOK_URL` to the URL to send the webhook to.\n\nFluxcloud will send a POST request to the provided URL with [the encoded event](https://github.com/topfreegames/fluxcloud/blob/master/pkg/msg/msg.go) as the payload.\n\n# Versioning\n\nFluxcloud follows semver for versioning, but also publishes development images tagged\nwith `$BRANCH-$COMMIT`.\n\nTo track release images:\n\n```\nfluxctl policy -c kube-system:deployment/fluxcloud --tag-all='v0*'\n```\n\nTo track the latest pre-release images:\n\n```\nfluxctl policy -c kube-system:deployment/fluxcloud --tag-all='master-*'\n```\n\nAnd then you can automate it:\n\n```\nfluxctl automate -c kube-system:deployment/fluxcloud\n```\n\n# Build\n\nTo build fluxcloud, you can either use go:\n\n```\ngo build -o fluxcloud ./cmd/\n```\n\nOr, to run a full CI build, download [hone](https://github.com/topfreegames/hone):\n\n```\nhone\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftopfreegames%2Ffluxcloud","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftopfreegames%2Ffluxcloud","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftopfreegames%2Ffluxcloud/lists"}