Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/galleybytes/terraform-operator-remote-controller
TFO tf resource event watcher
https://github.com/galleybytes/terraform-operator-remote-controller
Last synced: 8 days ago
JSON representation
TFO tf resource event watcher
- Host: GitHub
- URL: https://github.com/galleybytes/terraform-operator-remote-controller
- Owner: GalleyBytes
- License: apache-2.0
- Created: 2023-03-04T05:22:06.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2024-08-23T17:51:00.000Z (4 months ago)
- Last Synced: 2024-08-23T19:36:33.543Z (4 months ago)
- Language: Go
- Size: 115 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Terraform Operator Remote Controller
This is another controller that listens to tf resource events. Add and update events will transmit the tf manifest to a TFO-API server.
## Usage
Set up the following environment vars for the API server:
```bash
CLIENT_NAME=foo-k8s-cluster
TFO_API_PROTOCOL=http
TFO_API_HOST=localhost
TFO_API_PORT=5001
TFO_API_LOGIN_USER=username
TFO_API_LOGIN_PASSWORD=password
```Make sure you're connected to a cluster:
```bash
KUBECONFIG=~/.kube/config
```> InCluster configuration is automatically configured when this binary runs in a kubernetes pod.
### RBAC
This will require `get` and `list` permissions to `terraforms` resources:
```yaml
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: tforc
rules:
- apiGroups:
- tf.galleybytes.com
resources:
- terraforms
verbs:
- get
- list
```Additional rules can be added when defining a post job to run after a successful terraform workflow.
```yaml
# ADDITIONAL RULES
- apiGroups:
- batch
resources:
- jobs
verbs:
- '*'
- apiGroups:
- ""
resources:
- serviceaccounts
verbs:
- create
- get
- list
- apiGroups:
- rbac.authorization.k8s.io
resources:
- clusterrolebindings
verbs:
- create
- get
- list
- apiGroups:
- ""
resources:
- configmaps
verbs:
- '*'
```And run the binary or run an in-cluster container:
```bash
go run main.go
```