I hereby claim:
- I am jiang-wei on github.
- I am wei_jiang (https://keybase.io/wei_jiang) on keybase.
- I have a public key ASDqhgP4u5dw0bBrDACNgK9079KhOj7WTWN0eR3sf4Fw4go
To claim this, I am signing this object:
#!/usr/bin/env python3 | |
############# | |
# save to ~/bin/decode-secret-yaml | |
# chmod +x ~/bin/decode-secret-yaml | |
# | |
# usage: | |
# ~/bin/decode-secret-yaml foo.yaml | |
# kubectl get secret foo -o yaml | ~/bin/decode-secret-yaml | |
################# |
#!/usr/bin/env python | |
# | |
# save to $PATH as "jslog" | |
# and use as: | |
# kubectl logs xxx | jslog | |
# | |
import sys |
# cat prometheus.yaml | |
"alerting": | |
"alertmanagers": | |
- "kubernetes_sd_configs": # discovery of alert manager from EP in namespace monitoring | |
- "namespaces": | |
"names": | |
- "monitoring" | |
"role": "endpoints" | |
"path_prefix": "/" | |
"relabel_configs": |
$ cat alerts.yaml | |
"groups": | |
- "name": "kubernetes-absent" | |
"rules": | |
- "alert": "AlertmanagerDown" | |
"annotations": | |
"message": "Alertmanager has disappeared from Prometheus target discovery." | |
"runbook_url": "https://github.com/kubernetes-monitoring/kubernetes-mixin/tree/master/runbook.md#alert-name-alertmanagerdown" | |
"expr": | | |
absent(up{job="alertmanager"} == 1) |
这是从 GKE market place 里安装的Prometheus server 的 rules 配置 | |
当做 rules 样例学习 | |
$ cat rules.yaml | |
"groups": | |
- "name": "k8s.rules" | |
"rules": | |
- "expr": | | |
sum(rate(container_cpu_usage_seconds_total{job="cadvisor", image!=""}[5m])) by (namespace) | |
"record": "namespace:container_cpu_usage_seconds_total:sum_rate" |
I hereby claim:
To claim this, I am signing this object:
Don't use the API as described in http://docs.grafana.org/http_api/dashboard/ | |
Use the undocumented `import` interface | |
* remove .dashboard.id | |
----------------------- | |
data = getDashboard(DA_API_URL, uid, daAuthHeader) | |
def createDashboard(apiUrl, uid, authHeader, data): | |
del data['meta'] | |
data['overwrite'] = True |
containers: | |
- name: main | |
image: gcr.io/some/image:latest | |
command: ["/bin/bash", "-c"] | |
args: | |
- | | |
trap "touch /tmp/pod/main-terminated" EXIT | |
/my-batch-job/bin/main --config=/config/my-job-config.yaml | |
volumeMounts: | |
- mountPath: /tmp/pod |
{ | |
"id": "f0310b9c-3ed2-4b43-88f2-cf7fa1f6867a", | |
"name": "open google.ca", | |
"url": "https://www.google.ca", | |
"tests": [{ | |
"id": "e9662b73-483b-4db9-9b84-b9a9652145b2", | |
"name": "Untitled", | |
"commands": [{ | |
"id": "a2fffec4-2464-4d1b-a767-595da262e200", | |
"comment": "", |
const {Builder, By, until} = require('selenium-webdriver'); | |
let driver = new Builder() | |
.forBrowser('firefox') | |
.build(); | |
driver.get('http://www.google.com/ncr'); | |
driver.findElement(By.name('q')).sendKeys('webdriver'); | |
driver.findElement(By.name('btnK')).click(); | |
driver.wait(until.titleIs('webdriver - Google Search'), 1000); |