-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
results metrics exposed over https using kube-rbac-proxy
Signed-off-by: Satyam Bhardwaj <[email protected]>
- Loading branch information
1 parent
b712a84
commit c265f3a
Showing
11 changed files
with
154 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
operator/gitops/argocd/pipeline-service/tekton-results/api-kube-rbac-proxy.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: tekton-results-api | ||
namespace: tekton-pipelines | ||
spec: | ||
template: | ||
spec: | ||
containers: | ||
- name: kube-rbac-proxy | ||
image: registry.redhat.io/openshift4/ose-kube-rbac-proxy:v4.12 | ||
args: | ||
- "--secure-listen-address=0.0.0.0:9443" | ||
- "--upstream=http://127.0.0.1:9090/" | ||
- "--logtostderr=true" | ||
- "--v=10" | ||
securityContext: | ||
allowPrivilegeEscalation: false | ||
seccompProfile: | ||
type: RuntimeDefault | ||
capabilities: | ||
drop: | ||
- ALL | ||
ports: | ||
- containerPort: 9443 | ||
protocol: TCP | ||
name: metrics | ||
resources: | ||
limits: | ||
cpu: 500m | ||
memory: 128Mi | ||
requests: | ||
cpu: 5m | ||
memory: 64Mi |
10 changes: 10 additions & 0 deletions
10
operator/gitops/argocd/pipeline-service/tekton-results/api-service-patch.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- | ||
- op: replace | ||
path: /spec/ports/1/name | ||
value: metrics | ||
- op: replace | ||
path: /spec/ports/1/port | ||
value: 9443 | ||
- op: replace | ||
path: /spec/ports/1/targetPort | ||
value: metrics |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
operator/gitops/argocd/pipeline-service/tekton-results/watcher-cr-patch.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRole | ||
metadata: | ||
name: watcher | ||
rules: | ||
# Watcher needs to be able to create new and update existing results. | ||
- apiGroups: ["results.tekton.dev"] | ||
resources: ["logs", "results", "records"] | ||
verbs: ["create", "get", "update"] | ||
# Needed to read results and update annotations with Result ID. | ||
- apiGroups: ["tekton.dev"] | ||
resources: ["pipelineruns", "taskruns"] | ||
verbs: ["get", "list", "patch", "update", "watch", "delete"] | ||
# Watcher currently get config from APISever, so will | ||
# fail to start if it does not have this permission. | ||
- apiGroups: [""] | ||
resources: ["configmaps", "pods"] | ||
verbs: ["get", "list", "watch"] | ||
# Required to read logs, when logs API is enabled | ||
- apiGroups: [""] | ||
resources: ["pods/log"] | ||
verbs: ["get"] | ||
- apiGroups: ["tekton.dev"] | ||
resources: ["pipelines"] | ||
verbs: ["get"] | ||
# Required for enabling leader election. | ||
- apiGroups: ["coordination.k8s.io"] | ||
resources: ["leases"] | ||
verbs: ["get", "list", "create", "update", "delete", "patch", "watch"] | ||
# Watcher needs to be able to verify incoming auth tokens. | ||
- apiGroups: ["authentication.k8s.io"] | ||
resources: ["tokenreviews"] | ||
verbs: ["create"] | ||
# Watcher needs to be able to use RBAC to verify user authorization. | ||
- apiGroups: ["authorization.k8s.io"] | ||
resources: ["subjectaccessreviews"] | ||
verbs: ["create"] |
35 changes: 35 additions & 0 deletions
35
operator/gitops/argocd/pipeline-service/tekton-results/watcher-kube-rbac-proxy.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: tekton-results-watcher | ||
namespace: tekton-pipelines | ||
spec: | ||
template: | ||
spec: | ||
containers: | ||
- name: kube-rbac-proxy | ||
image: registry.redhat.io/openshift4/ose-kube-rbac-proxy:v4.12 | ||
args: | ||
- "--secure-listen-address=0.0.0.0:8443" | ||
- "--upstream=http://127.0.0.1:9090/" | ||
- "--logtostderr=true" | ||
- "--v=10" | ||
securityContext: | ||
allowPrivilegeEscalation: false | ||
seccompProfile: | ||
type: RuntimeDefault | ||
capabilities: | ||
drop: | ||
- ALL | ||
ports: | ||
- containerPort: 8443 | ||
protocol: TCP | ||
name: watchermetrics | ||
resources: | ||
limits: | ||
cpu: 500m | ||
memory: 128Mi | ||
requests: | ||
cpu: 5m | ||
memory: 64Mi |
10 changes: 10 additions & 0 deletions
10
operator/gitops/argocd/pipeline-service/tekton-results/watcher-service-patch.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- | ||
- op: replace | ||
path: /spec/ports/0/name | ||
value: watchermetrics | ||
- op: replace | ||
path: /spec/ports/0/port | ||
value: 8443 | ||
- op: add | ||
path: /spec/ports/0/targetPort | ||
value: watchermetrics |