Skip to content

Commit 221927f

Browse files
Merge pull request #287 from artemlive/feature/pingdom-api-migrate
IMC pingdom api v3.1 support with small improvements and documentation fixes
2 parents 5a091a2 + b8d7266 commit 221927f

File tree

13 files changed

+236
-64
lines changed

13 files changed

+236
-64
lines changed

CONTRIBUTING.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -188,11 +188,11 @@ providers:
188188
username: <your-account-username>
189189
password: <your-account-password>
190190
- name: Pingdom
191-
apiKey: <your-api-key>
191+
apiToken: <your-api-token>
192192
apiURL: https://api.pingdom.com
193-
username: <your-account-username>
194-
password: <your-account-password>
195-
accountEmail: <multi-auth-account-email>
193+
alertIntegrations: "91166-10924"
194+
alertContacts: "1234567_8_9-9876543_2_1,1234567_8_9-9876543_2_2"
195+
teamAlertContacts: "1234567_8_9-9876543_2_1,1234567_8_9-9876543_2_2"
196196
enableMonitorDeletion: true
197197
monitorNameTemplate: "{{.Name}}-{{.Namespace}}"
198198
```

cmd/manager/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ func main() {
7676
os.Exit(1)
7777
}
7878
if len(namespace) == 0 {
79-
log.Info("Warning: WATCH_NAMESPACE is set to empty string, will monitor ingresses in all namespaces.")
79+
log.Info("Warning: WATCH_NAMESPACE is set to empty string, will check EndpointMonitors in all namespaces.")
8080
} else {
8181
log.Info("Watching Namespace: " + namespace)
8282
}

deploy/crds/endpointmonitor.stakater.com_endpointmonitors_crd.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,9 @@ spec:
9393
description: Comma separated set of tags to apply to check (e.g.
9494
"testing,aws")
9595
type: string
96+
teamAlertContacts:
97+
description: '`-` separated team id''s (e.g. "1234567_8_9-9876543_2_1")'
98+
type: string
9699
type: object
97100
providers:
98101
description: Comma separated list of providers
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
apiVersion: operators.coreos.com/v1alpha1
2+
kind: ClusterServiceVersion
3+
metadata:
4+
annotations:
5+
alm-examples: '[]'
6+
capabilities: Basic Install
7+
name: ingressmonitorcontroller.v2.0.5
8+
namespace: placeholder
9+
spec:
10+
apiservicedefinitions: {}
11+
customresourcedefinitions:
12+
owned:
13+
- description: EndpointMonitor is the Schema for the endpointmonitors API
14+
kind: EndpointMonitor
15+
name: endpointmonitors.endpointmonitor.stakater.com
16+
version: v1alpha1
17+
description: Placeholder description
18+
displayName: Ingress Monitor Controller
19+
install:
20+
spec:
21+
clusterPermissions:
22+
- rules:
23+
- apiGroups:
24+
- ""
25+
- extensions
26+
- route.openshift.io
27+
resources:
28+
- ingresses
29+
- routes
30+
- secrets
31+
verbs:
32+
- list
33+
- get
34+
- apiGroups:
35+
- ""
36+
resources:
37+
- events
38+
- services
39+
- configmaps
40+
- services/finalizers
41+
verbs:
42+
- create
43+
- delete
44+
- get
45+
- list
46+
- patch
47+
- update
48+
- watch
49+
- apiGroups:
50+
- apps
51+
resources:
52+
- deployments
53+
- daemonsets
54+
- replicasets
55+
- statefulsets
56+
verbs:
57+
- '*'
58+
- apiGroups:
59+
- monitoring.coreos.com
60+
resources:
61+
- servicemonitors
62+
verbs:
63+
- get
64+
- create
65+
- list
66+
- apiGroups:
67+
- apps
68+
resourceNames:
69+
- ingressmonitorcontroller
70+
resources:
71+
- deployments/finalizers
72+
verbs:
73+
- update
74+
- apiGroups:
75+
- ""
76+
resources:
77+
- pods
78+
verbs:
79+
- get
80+
- apiGroups:
81+
- endpointmonitor.stakater.com
82+
resources:
83+
- '*'
84+
verbs:
85+
- create
86+
- delete
87+
- get
88+
- list
89+
- patch
90+
- update
91+
- watch
92+
serviceAccountName: ingressmonitorcontroller
93+
deployments:
94+
- name: ingressmonitorcontroller
95+
spec:
96+
replicas: 1
97+
selector:
98+
matchLabels:
99+
name: ingressmonitorcontroller
100+
strategy: {}
101+
template:
102+
metadata:
103+
labels:
104+
name: ingressmonitorcontroller
105+
spec:
106+
containers:
107+
- command:
108+
- IngressMonitorController
109+
env:
110+
- name: WATCH_NAMESPACE
111+
valueFrom:
112+
fieldRef:
113+
fieldPath: metadata.annotations['olm.targetNamespaces']
114+
- name: POD_NAME
115+
valueFrom:
116+
fieldRef:
117+
fieldPath: metadata.name
118+
- name: OPERATOR_NAME
119+
value: ingressmonitorcontroller
120+
- name: CONFIG_SECRET_NAME
121+
value: imc-config
122+
- name: LOG_LEVEL
123+
value: info
124+
- name: LOG_FORMAT
125+
value: text
126+
image: stakater/ingressmonitorcontroller:v2.0.5
127+
imagePullPolicy: Always
128+
name: ingressmonitorcontroller
129+
resources: {}
130+
serviceAccountName: ingressmonitorcontroller
131+
strategy: deployment
132+
installModes:
133+
- supported: true
134+
type: OwnNamespace
135+
- supported: true
136+
type: SingleNamespace
137+
- supported: false
138+
type: MultiNamespace
139+
- supported: true
140+
type: AllNamespaces
141+
maturity: alpha
142+
provider: {}
143+
replaces: ingressmonitorcontroller.v0.0.0
144+
version: 2.0.5

deploy/operator.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ spec:
1515
serviceAccountName: ingressmonitorcontroller
1616
containers:
1717
- name: ingressmonitorcontroller
18-
image: stakater/ingressmonitorcontroller:v2.0.4
18+
image: stakater/ingressmonitorcontroller:v2.0.5
1919
command:
2020
- IngressMonitorController
2121
imagePullPolicy: Always

docs/pingdom-configuration.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,17 @@ in the [Configuration section of the README](../README.md#configuration):
99

1010
| Key | Description |
1111
|----------|--------------------------------------------------|
12-
| username | Account username for authentication with Pingdom |
13-
| password | Account password for authentication with Pingdom |
12+
| apiToken | Pingdom API Token generated inside My Pingdom |
1413

1514
## Optional
16-
The following optional property can be included for Pingdom accounts which require multi-user authentication.
17-
More information can be found [Here](https://www.pingdom.com/api/2.1/#multi-user+authentication)
15+
The following optional properties can be included if you want to declare some default options, without re-declaring them for each EndpointMonitor.
16+
You are able to override any of them via EndpointMonitor specific options.
1817

1918
| Key | Description |
2019
|-------------------|----------------------------------------------------------|
21-
| accountEmail | Email account for multi-user authentication with Pingdom |
22-
| alertIntegrations | Comma separated list of integration ids |
23-
20+
| alertIntegrations | `-` separated list of integration ids |
21+
| teamAlertContacts | `-` separated list of teams ids |
22+
| alertContacts | `-` separated list of alert contacts ids |
2423
## Advanced
2524

2625
Currently additional pingdom configurations can be added through these fields:
@@ -37,7 +36,7 @@ Currently additional pingdom configurations can be added through these fields:
3736
| Tags | Comma separated set of tags to apply to check (e.g. "testing,aws") |
3837
| AlertIntegrations | `-` separated set list of integrations ids (e.g. "91166-12168") |
3938
| AlertContacts | `-` separated contact id's (e.g. "1234567_8_9-9876543_2_1") to override the [default alertContacts](https://github.com/stakater/IngressMonitorController/blob/master/README.md#usage)|
40-
39+
| TeamAlertContacts | Teams to alert. `-` separated set list of teams ids (e.g. "1234567_8_9-9876543_2_1)|
4140

4241
### Basic Auth checks
4342

@@ -67,4 +66,5 @@ spec:
6766
tags: "testing,aws"
6867
alertIntegrations: "91166-12168"
6968
alertContacts: "1234567_8_9-9876543_2_1,1234567_8_9-9876543_2_2"
69+
teamAlertContacts: "1234567_8_9-9876543_2_1,1234567_8_9-9876543_2_2"
7070
```
Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
providers:
2-
- name: PingdomMulti
3-
apiURL: "https://api.pingdom.com/v2/"
4-
apiKey: "657a68d9ashdyasjdklkskuasd"
5-
username: "[email protected]"
6-
password: "SuperSecret"
7-
accountEmail: "[email protected]"
2+
- name: Pingdom
3+
apiURL: "https://api.pingdom.com/api/3.1"
4+
apiToken: "657a68d9ashdyasjdklkskuasd"
85
alertContacts: "0544483_0_0-2628365_0_0-2633263_0_0"
9-
alertIntegrations: "91166,10924"
6+
teamAlertContacts: "1234567_0_0-2628365_0_0-2633263_0_0"
7+
alertIntegrations: "91166-10924"
108
enableMonitorDeletion: true

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ require (
1212
github.com/kelseyhightower/envconfig v1.4.0
1313
github.com/openshift/api v0.0.0-20200526144822-34f54f12813a
1414
github.com/operator-framework/operator-sdk v0.19.0
15-
github.com/russellcardullo/go-pingdom v1.0.0
15+
github.com/russellcardullo/go-pingdom v1.3.0
1616
github.com/sirupsen/logrus v1.6.0
1717
github.com/stretchr/testify v1.5.1
1818
google.golang.org/api v0.14.0

go.sum

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -761,6 +761,7 @@ github.com/rs/cors v1.6.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU=
761761
github.com/rubenv/sql-migrate v0.0.0-20200212082348-64f95ea68aa3/go.mod h1:rtQlpHw+eR6UrqaS3kX1VYeaCxzCVdimDS7g5Ln4pPc=
762762
github.com/russellcardullo/go-pingdom v1.0.0 h1:onhnHzECEQI1r1Oel6F9piZ2hI8L339IDBKAQdbUAO4=
763763
github.com/russellcardullo/go-pingdom v1.0.0/go.mod h1:MbP0xrebNTkKp7dUsxfOJF+MvJ6eNmvj5y6gqXFbOaw=
764+
github.com/russellcardullo/go-pingdom v1.3.0/go.mod h1:y9hd/6P97iuRFi6VPGgLxsRQaJQll298jZ/qPQPfcXw=
764765
github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g=
765766
github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
766767
github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts=

pkg/apis/endpointmonitor/v1alpha1/endpointmonitor_types.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,10 @@ type PingdomConfig struct {
235235
// `-` separated contact id's (e.g. "1234567_8_9-9876543_2_1")
236236
// +optional
237237
AlertContacts string `json:"alertContacts,omitempty"`
238+
239+
// `-` separated team id's (e.g. "1234567_8_9-9876543_2_1")
240+
// +optional
241+
TeamAlertContacts string `json:"teamAlertContacts,omitempty"`
238242
}
239243

240244
// AppInsightsConfig defines the configuration for AppInsights Monitor Provider

0 commit comments

Comments
 (0)