This repository has been archived by the owner on Apr 18, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #29 from flanksource/add-prometheus-metrics-and-ev…
…ents Add prometheus metrics and events
- Loading branch information
Showing
19 changed files
with
607 additions
and
75 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,139 @@ | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: template-operator-manager | ||
namespace: platform-system | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: Role | ||
metadata: | ||
name: template-operator-leader-election-role | ||
namespace: platform-system | ||
rules: | ||
- apiGroups: | ||
- "" | ||
resources: | ||
- configmaps | ||
verbs: | ||
- get | ||
- list | ||
- watch | ||
- create | ||
- update | ||
- patch | ||
- delete | ||
- apiGroups: | ||
- "" | ||
resources: | ||
- configmaps/status | ||
verbs: | ||
- get | ||
- update | ||
- patch | ||
- apiGroups: | ||
- "" | ||
resources: | ||
- events | ||
verbs: | ||
- create | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRole | ||
metadata: | ||
creationTimestamp: null | ||
name: template-operator-manager-role | ||
rules: | ||
- apiGroups: | ||
- '*' | ||
resources: | ||
- '*' | ||
verbs: | ||
- '*' | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: RoleBinding | ||
metadata: | ||
name: template-operator-leader-election-rolebinding | ||
namespace: platform-system | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: Role | ||
name: template-operator-leader-election-role | ||
subjects: | ||
- kind: ServiceAccount | ||
name: template-operator-manager | ||
namespace: platform-system | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRoleBinding | ||
metadata: | ||
name: template-operator-manager-rolebinding | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: ClusterRole | ||
name: template-operator-manager-role | ||
subjects: | ||
- kind: ServiceAccount | ||
name: template-operator-manager | ||
namespace: platform-system | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
annotations: | ||
prometheus.io/scrape: "true" | ||
labels: | ||
control-plane: template-operator | ||
name: template-operator-template-operator | ||
namespace: platform-system | ||
spec: | ||
ports: | ||
- name: prometheus | ||
port: 8080 | ||
protocol: TCP | ||
selector: | ||
control-plane: template-operator | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
labels: | ||
control-plane: template-operator | ||
name: template-operator-controller-manager | ||
namespace: platform-system | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
control-plane: template-operator | ||
template: | ||
metadata: | ||
labels: | ||
control-plane: template-operator | ||
spec: | ||
containers: | ||
- args: | ||
- --metrics-addr=0.0.0.0:8080 | ||
- --enable-leader-election | ||
- --sync-period=20s | ||
image: flanksource/template-operator:v1 | ||
name: manager | ||
resources: | ||
limits: | ||
cpu: 100m | ||
memory: 130Mi | ||
requests: | ||
cpu: 100m | ||
memory: 120Mi | ||
- args: | ||
- --secure-listen-address=0.0.0.0:8443 | ||
- --upstream=http://127.0.0.1:8080/ | ||
- --logtostderr=true | ||
- --v=10 | ||
image: gcr.io/kubebuilder/kube-rbac-proxy:v0.5.0 | ||
name: kube-rbac-proxy | ||
ports: | ||
- containerPort: 8443 | ||
name: https | ||
serviceAccount: template-operator-manager | ||
terminationGracePeriodSeconds: 10 |
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,53 @@ | ||
# Adds namespace to all resources. | ||
namespace: platform-system | ||
|
||
namePrefix: template-operator- | ||
|
||
bases: | ||
- ../rbac | ||
- ../manager | ||
|
||
# patchesStrategicMerge: | ||
# Protect the /metrics endpoint by putting it behind auth. | ||
# If you want your controller-manager to expose the /metrics | ||
# endpoint w/o any authn/z, please comment the following line. | ||
# - ../default/manager_auth_proxy_patch.yaml | ||
|
||
# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix including the one in | ||
# crd/kustomization.yaml | ||
#- manager_webhook_patch.yaml | ||
|
||
# [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER'. | ||
# Uncomment 'CERTMANAGER' sections in crd/kustomization.yaml to enable the CA injection in the admission webhooks. | ||
# 'CERTMANAGER' needs to be enabled to use ca injection | ||
#- webhookcainjection_patch.yaml | ||
|
||
# the following config is for teaching kustomize how to do var substitution | ||
vars: | ||
# [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER' prefix. | ||
#- name: CERTIFICATE_NAMESPACE # namespace of the certificate CR | ||
# objref: | ||
# kind: Certificate | ||
# group: cert-manager.io | ||
# version: v1alpha2 | ||
# name: serving-cert # this name should match the one in certificate.yaml | ||
# fieldref: | ||
# fieldpath: metadata.namespace | ||
#- name: CERTIFICATE_NAME | ||
# objref: | ||
# kind: Certificate | ||
# group: cert-manager.io | ||
# version: v1alpha2 | ||
# name: serving-cert # this name should match the one in certificate.yaml | ||
#- name: SERVICE_NAMESPACE # namespace of the service | ||
# objref: | ||
# kind: Service | ||
# version: v1 | ||
# name: webhook-service | ||
# fieldref: | ||
# fieldpath: metadata.namespace | ||
#- name: SERVICE_NAME | ||
# objref: | ||
# kind: Service | ||
# version: v1 | ||
# name: webhook-service |
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 was deleted.
Oops, something went wrong.
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
Oops, something went wrong.