{"id":16287975,"url":"https://github.com/valentin2105/k8s-mattermost","last_synced_at":"2025-03-20T03:30:31.718Z","repository":{"id":57593493,"uuid":"143968825","full_name":"valentin2105/k8s-mattermost","owner":"valentin2105","description":"Mattermost Bot to interact with Kubernetes","archived":false,"fork":false,"pushed_at":"2019-10-28T22:49:48.000Z","size":24,"stargazers_count":6,"open_issues_count":0,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-28T22:48:23.907Z","etag":null,"topics":["bot","go","golang","kubernetes","mattermost"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/valentin2105.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2018-08-08T06:14:06.000Z","updated_at":"2023-05-11T09:12:23.000Z","dependencies_parsed_at":"2022-08-24T14:57:13.138Z","dependency_job_id":null,"html_url":"https://github.com/valentin2105/k8s-mattermost","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/valentin2105%2Fk8s-mattermost","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/valentin2105%2Fk8s-mattermost/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/valentin2105%2Fk8s-mattermost/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/valentin2105%2Fk8s-mattermost/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/valentin2105","download_url":"https://codeload.github.com/valentin2105/k8s-mattermost/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244047608,"owners_count":20389205,"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":["bot","go","golang","kubernetes","mattermost"],"created_at":"2024-10-10T19:46:54.985Z","updated_at":"2025-03-20T03:30:31.400Z","avatar_url":"https://github.com/valentin2105.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# k8s-mattermost\n[![Go Report Card](https://goreportcard.com/badge/github.com/valentin2105/k8s-mattermost)](https://goreportcard.com/report/github.com/valentin2105/k8s-mattermost)\n[![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](https://github.com/dwyl/esta/issues)\n\n### What is it ?\n**k8s-mattermost** is a bot that connects to a Mattermost channel's websocket and watches for kubectl commands. \n\nBy default, you can trigger the bot with `!k \u003cnamespace\u003e \u003cverb\u003e \u003cressource\u003e` :\n\n```\n!k - get cs  # You can use \"-\" if ressource doesn't get namespace\n\n!k kube-system get deploy\n\n!k all get pod # You can use \"all\" to show all namespaces\n```\n\nThe configuration is located in the `config.toml.dist` file (you should rename it to `config.toml`) : \n\n```\n[general]\nbot_name = \"k8s-bot\"\nkubectl_path = \"/usr/local/bin/kubectl\"\n\n[mattermost]\nhost = \"your-mattermost.org\"\nchannel_name = \"kubernetes\"\nteam_name = \"your-team\"\nuser_login = \"bot@email.org\"\nuser_password = \"averystr0ngpassw0rd\"\n```\n\nYou can load a different config file using the `-c ` flag. \n\n\n### How can you run it ?\n\nYou can fetch the latest build for Linux with :\n```\nwget https://github.com/valentin2105/k8s-mattermost/releases/download/v0.1.1/k8s-mattermost\nchmod +x k8s-mattermost \n./k8s-mattermost -c config.toml\n```\n\nOr run it using Docker :\n\n```\ndocker run \\\n-e K8S_API=\"https://k8s-api.url:6443\" \\\n-e K8S_TOKEN=\"yourClusterToken\" \\\n-e TEAM=\"your-team\" \\\n-e LOGIN=\"bot@email.org\" \\\n-e PASSWORD=\"averystr0ngpassw0rd\" \\\n-e SERVER=\"your-mattermost.org\" \\\n-e CHANNEL=\"your-channel\" \\\nvalentinnc/k8s-mattermost\n```\n\nOr build it from source : \n\n```\n# install dep\ncurl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh\n\n# clone repo\nmkdir -p $GOPATH/src/github.com/valentin2105/ \u0026\u0026 cd $GOPATH/src/github.com/valentin2105/\ngit clone https://github.com/valentin2105/k8s-mattermost.git \u0026\u0026 cd k8s-mattermost \n\n# fetch dependencies\ndep ensure\n\n# build app\ngo build\n```\n\n### Screenshot\n![](https://i.imgur.com/6eFvItT.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvalentin2105%2Fk8s-mattermost","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvalentin2105%2Fk8s-mattermost","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvalentin2105%2Fk8s-mattermost/lists"}