Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update recent bugs, fix kubernetes crd #39

Merged
merged 4 commits into from
Jun 18, 2020
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion cmd/manager/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,17 @@ func main() {
if err != nil {
log.Info("Could not create metrics Service", "error", err.Error())
}
//retrieve operator namespace
f41gh7 marked this conversation as resolved.
Show resolved Hide resolved
//only works at kubernetes cluster
operatorNamespace, err := k8sutil.GetOperatorNamespace()
if err != nil {
log.Info("Could not detect operator namespace, not in cluster?", "err", err.Error())
}

// CreateServiceMonitors will automatically create the prometheus-operator ServiceMonitor resources
// necessary to configure Prometheus to scrape metrics from this operator.
services := []*v1.Service{service}
_, err = metrics.CreateServiceMonitors(cfg, namespace, services)
_, err = metrics.CreateServiceMonitors(cfg, operatorNamespace, services)
if err != nil {
log.Info("Could not create ServiceMonitor object", "error", err.Error())
// If this operator is deployed to a cluster without the prometheus-operator running, it will return
Expand Down
7 changes: 0 additions & 7 deletions deploy/crds/monitoring.coreos.com_podmonitors_crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ spec:
items:
type: string
type: array
x-kubernetes-list-type: set
type: object
podMetricsEndpoints:
description: A list of endpoints allowed as part of this PodMonitor.
Expand Down Expand Up @@ -103,15 +102,13 @@ spec:
items:
type: string
type: array
x-kubernetes-list-type: set
targetLabel:
description: Label to which the resulting value is written
in a replace action. It is mandatory for replace actions.
Regex capture groups are available.
type: string
type: object
type: array
x-kubernetes-list-type: set
params:
additionalProperties:
items:
Expand Down Expand Up @@ -169,15 +166,13 @@ spec:
items:
type: string
type: array
x-kubernetes-list-type: set
targetLabel:
description: Label to which the resulting value is written
in a replace action. It is mandatory for replace actions.
Regex capture groups are available.
type: string
type: object
type: array
x-kubernetes-list-type: set
scheme:
description: HTTP scheme to use for scraping.
type: string
Expand All @@ -192,14 +187,12 @@ spec:
x-kubernetes-int-or-string: true
type: object
type: array
x-kubernetes-list-type: set
podTargetLabels:
description: PodTargetLabels transfers labels on the Kubernetes Pod
onto the target.
items:
type: string
type: array
x-kubernetes-list-type: set
sampleLimit:
description: SampleLimit defines per-scrape limit on number of scraped
samples that will be accepted.
Expand Down
2 changes: 0 additions & 2 deletions deploy/crds/monitoring.coreos.com_prometheusrules_crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,11 @@ spec:
- expr
type: object
type: array
x-kubernetes-list-type: set
required:
- name
- rules
type: object
type: array
x-kubernetes-list-type: set
type: object
required:
- spec
Expand Down
8 changes: 0 additions & 8 deletions deploy/crds/monitoring.coreos.com_servicemonitors_crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -154,15 +154,13 @@ spec:
items:
type: string
type: array
x-kubernetes-list-type: set
targetLabel:
description: Label to which the resulting value is written
in a replace action. It is mandatory for replace actions.
Regex capture groups are available.
type: string
type: object
type: array
x-kubernetes-list-type: set
params:
additionalProperties:
items:
Expand Down Expand Up @@ -220,15 +218,13 @@ spec:
items:
type: string
type: array
x-kubernetes-list-type: set
targetLabel:
description: Label to which the resulting value is written
in a replace action. It is mandatory for replace actions.
Regex capture groups are available.
type: string
type: object
type: array
x-kubernetes-list-type: set
scheme:
description: HTTP scheme to use for scraping.
type: string
Expand Down Expand Up @@ -370,7 +366,6 @@ spec:
type: object
type: object
type: array
x-kubernetes-list-type: set
jobLabel:
description: The label to use to retrieve the job name from.
type: string
Expand All @@ -387,15 +382,13 @@ spec:
items:
type: string
type: array
x-kubernetes-list-type: set
type: object
podTargetLabels:
description: PodTargetLabels transfers labels on the Kubernetes Pod
onto the target.
items:
type: string
type: array
x-kubernetes-list-type: set
sampleLimit:
description: SampleLimit defines per-scrape limit on number of scraped
samples that will be accepted.
Expand Down Expand Up @@ -450,7 +443,6 @@ spec:
items:
type: string
type: array
x-kubernetes-list-type: set
required:
- endpoints
- selector
Expand Down
10 changes: 0 additions & 10 deletions deploy/crds/victoriametrics.com_vmagents_crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -820,7 +820,6 @@ spec:
items:
type: string
type: array
x-kubernetes-list-type: set
containers:
description: Containers property allows to inject additions sidecars.
It can be useful for proxies, backup, etc.
Expand Down Expand Up @@ -1873,7 +1872,6 @@ spec:
- name
type: object
type: array
x-kubernetes-list-type: set
enforcedNamespaceLabel:
description: EnforcedNamespaceLabel enforces adding a namespace label
of origin for each alert and metric that is user created. The label
Expand Down Expand Up @@ -1994,7 +1992,6 @@ spec:
- name
type: object
type: array
x-kubernetes-list-type: set
ignoreNamespaceSelectors:
description: IgnoreNamespaceSelectors if set to true will ignore NamespaceSelector
settings from the podmonitor and servicemonitor configs, and they
Expand All @@ -2019,7 +2016,6 @@ spec:
type: string
type: object
type: array
x-kubernetes-list-type: set
initContainers:
description: 'InitContainers allows adding initContainers to the pod
definition. Those can be used to e.g. fetch secrets for injection
Expand Down Expand Up @@ -3079,7 +3075,6 @@ spec:
- name
type: object
type: array
x-kubernetes-list-type: set
logFormat:
description: LogFormat for VmAgent to be configured with.
enum:
Expand Down Expand Up @@ -3243,7 +3238,6 @@ spec:
- url
type: object
type: array
x-kubernetes-list-type: set
replicaCount:
description: ReplicaCount is the expected size of the VmAgent cluster.
The controller will eventually make the size of the running cluster
Expand Down Expand Up @@ -3295,7 +3289,6 @@ spec:
items:
type: string
type: array
x-kubernetes-list-type: set
securityContext:
description: SecurityContext holds pod-level security attributes and
common container settings. This defaults to the default PodSecurityContext.
Expand Down Expand Up @@ -3547,7 +3540,6 @@ spec:
type: string
type: object
type: array
x-kubernetes-list-type: set
version:
description: Version for VmAgent.
type: string
Expand Down Expand Up @@ -3598,7 +3590,6 @@ spec:
- name
type: object
type: array
x-kubernetes-list-type: set
volumes:
description: Volumes allows configuration of additional volumes on the
output deploy definition. Volumes specified will be appended to other
Expand Down Expand Up @@ -4791,7 +4782,6 @@ spec:
- name
type: object
type: array
x-kubernetes-list-type: set
required:
- serviceAccountName
type: object
Expand Down
Loading