From 730182fb42f5725265b3943ea464a6129560f486 Mon Sep 17 00:00:00 2001 From: Waseem Hassan Date: Tue, 27 Feb 2018 16:21:53 +0500 Subject: [PATCH 1/4] Update docker image version --- kubernetes-manifests/deployment.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/kubernetes-manifests/deployment.yaml b/kubernetes-manifests/deployment.yaml index 5ac87b6b..f6ad552b 100644 --- a/kubernetes-manifests/deployment.yaml +++ b/kubernetes-manifests/deployment.yaml @@ -29,8 +29,7 @@ spec: - name: CONFIG_FILE_PATH value: /etc/ingress-monitor-controller/config.yaml # TODO: Update name - image: stakater/ingress-monitor-controller:implementation - imagePullPolicy: Always + image: stakater/ingress-monitor-controller:1.0 # livenessProbe: # exec: # command: From d0b5c22d560da03d89a42232b6f6f71dcffa5998 Mon Sep 17 00:00:00 2001 From: Waseem Hassan Date: Tue, 27 Feb 2018 17:00:52 +0500 Subject: [PATCH 2/4] Add rbac --- README.md | 2 ++ kubernetes-manifests/deployment.yaml | 8 +----- kubernetes-manifests/rbac.yaml | 39 +++++++++++++++++++++++++++- 3 files changed, 41 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index e2c6d279..d6ef2fec 100644 --- a/README.md +++ b/README.md @@ -56,6 +56,8 @@ kubectl apply -f rbac.yaml -n kubectl apply -f deployment.yaml -n ``` +*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 diff --git a/kubernetes-manifests/deployment.yaml b/kubernetes-manifests/deployment.yaml index f6ad552b..8e15d15b 100644 --- a/kubernetes-manifests/deployment.yaml +++ b/kubernetes-manifests/deployment.yaml @@ -30,17 +30,11 @@ spec: value: /etc/ingress-monitor-controller/config.yaml # TODO: Update name image: stakater/ingress-monitor-controller:1.0 -# livenessProbe: -# exec: -# command: -# - cat -# - /tmp/restarteveryday -# initialDelaySeconds: 86164 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 diff --git a/kubernetes-manifests/rbac.yaml b/kubernetes-manifests/rbac.yaml index 867e2c84..e8b3c263 100644 --- a/kubernetes-manifests/rbac.yaml +++ b/kubernetes-manifests/rbac.yaml @@ -1 +1,38 @@ -# Placeholder \ No newline at end of file +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 \ No newline at end of file From 1d95f5b7ed638a45aa8e5c90e7eb0068a7adfb2c Mon Sep 17 00:00:00 2001 From: Waseem Hassan Date: Tue, 27 Feb 2018 17:04:04 +0500 Subject: [PATCH 3/4] Fix script --- bootstrap.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bootstrap.sh b/bootstrap.sh index cba94566..f08cf631 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -15,4 +15,4 @@ echo "Building the controller" go build -o ./out/main echo "Running the controller" -./main \ No newline at end of file +./out/main \ No newline at end of file From c8b8ac928db85b3ef9cd0c263f860f151acd4fc2 Mon Sep 17 00:00:00 2001 From: Waseem Hassan Date: Tue, 27 Feb 2018 17:07:05 +0500 Subject: [PATCH 4/4] Update version --- kubernetes-manifests/deployment.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/kubernetes-manifests/deployment.yaml b/kubernetes-manifests/deployment.yaml index 8e15d15b..51c22643 100644 --- a/kubernetes-manifests/deployment.yaml +++ b/kubernetes-manifests/deployment.yaml @@ -28,8 +28,7 @@ spec: fieldPath: metadata.namespace - name: CONFIG_FILE_PATH value: /etc/ingress-monitor-controller/config.yaml -# TODO: Update name - image: stakater/ingress-monitor-controller:1.0 + image: stakater/ingress-monitor-controller:0.1 name: ingress-monitor-controller volumeMounts: - mountPath: /etc/ingress-monitor-controller