Skip to content

Commit

Permalink
Merge pull request #9 from stakater/add-rbac
Browse files Browse the repository at this point in the history
[STK-114] Add rbac
  • Loading branch information
hazim1093 authored Feb 27, 2018
2 parents 182d8c4 + c8b8ac9 commit 5c5d92b
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 12 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ kubectl apply -f rbac.yaml -n <namespace>
kubectl apply -f deployment.yaml -n <namespace>
```

*Note*: Before applying rbac.yaml, You need to modify the namespace in the `RoleBinding` subjects section to the namespace you want to apply rbac.yaml to.

## Adding support for a new Monitor

You can easily implement a new monitor and use it via the controller. First of all, you will need to create a new service struct that implements the following monitor service interface
Expand Down
2 changes: 1 addition & 1 deletion bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ echo "Building the controller"
go build -o ./out/main

echo "Running the controller"
./main
./out/main
12 changes: 2 additions & 10 deletions kubernetes-manifests/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,12 @@ spec:
fieldPath: metadata.namespace
- name: CONFIG_FILE_PATH
value: /etc/ingress-monitor-controller/config.yaml
# TODO: Update name
image: stakater/ingress-monitor-controller:implementation
imagePullPolicy: Always
# livenessProbe:
# exec:
# command:
# - cat
# - /tmp/restarteveryday
# initialDelaySeconds: 86164
image: stakater/ingress-monitor-controller:0.1
name: ingress-monitor-controller
volumeMounts:
- mountPath: /etc/ingress-monitor-controller
name: config-volume
# serviceAccountName: ingress-monitor-controller-svcaccount
serviceAccountName: ingressmonitorcontroller
volumes:
- configMap:
name: ingress-monitor-controller
Expand Down
39 changes: 38 additions & 1 deletion kubernetes-manifests/rbac.yaml
Original file line number Diff line number Diff line change
@@ -1 +1,38 @@
# Placeholder
apiVersion: v1
kind: ServiceAccount
metadata:
labels:
project: ingressmonitorcontroller
group: com.stakater
name: ingressmonitorcontroller
---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: Role
metadata:
name: ingressmonitorcontroller-role
rules:
- apiGroups:
- ""
- "extensions"
resources:
- ingresses
verbs:
- list
- get
- update
- patch
- watch
- delete
---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: RoleBinding
metadata:
name: ingressmonitorcontroller-role-binding
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: ingressmonitorcontroller-role
subjects:
- kind: ServiceAccount
name: ingressmonitorcontroller
namespace: test

0 comments on commit 5c5d92b

Please sign in to comment.