This file contains hidden or 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
//! A leader election library backed by NATS | |
//! | |
//! This module implements a basic leader election backed by a NATS KV bucket with a TTL set. | |
//! | |
//! ## How to use | |
//! | |
//! At its most basic, you can do leader election and run a loop with a single command | |
//! | |
//! ```rust,no_run | |
//! use std::time::Duration; |
This file contains hidden or 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
--- | |
apiVersion: v1 | |
kind: Service | |
metadata: | |
labels: | |
app: cassandra | |
# Allows service to connect to containers that aren't in a ready state | |
# This is needed so the cluster can actually spin up | |
annotations: | |
service.alpha.kubernetes.io/tolerate-unready-endpoints: "true" |
This file contains hidden or 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
def check_pods(get_pods_json): | |
problemPods = list() | |
for pod in get_pods_json['items']: | |
isBad = False | |
if pod['status']['phase'] != 'Running' and pod['status']['phase'] != 'Completed': | |
isBad = True | |
else: | |
for container_status in pod['status']['containerStatuses']: | |
if not container_status['ready']: | |
isBad = True |
This file contains hidden or 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
# Alert when the rate of events exceeds a threshold | |
# (Required) | |
# Rule name, must be unique | |
name: jenkins-severe-exceptions | |
# (Required) | |
# Type of alert. | |
# the frequency rule type alerts when num_events events occur with timeframe time | |
type: frequency |
This file contains hidden or 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
stream | |
// The following stream alerts based on changes in cpu/usage | |
// Every minute the rate of change for the cpu/usage is calculated | |
// Alerts are sent out when that rate is unusually high | |
|from() | |
.measurement('cpu/usage') | |
.where(lambda: "type" == 'node' AND "nodename" =~/.*cassandra.*/) | |
.groupBy('nodename') | |
|derivative('value') | |
.unit(60s) |
This file contains hidden or 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
- include_vars: "group_vars/secrets/secrets_{{ k8s_environment }}_{{ jenkins_type }}.yml" | |
- name: "Jenkins specs directory" | |
file: | |
dest: "./build/{{ k8s_environment }}/" | |
state: directory | |
- name: "Jenkins environment directory" | |
file: | |
dest: "./build/{{ k8s_environment }}/jenkins" | |
state: directory | |
- name: "Set path where specs go" |
This file contains hidden or 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
#!/bin/bash | |
if [ $# -lt 2 ]; then | |
echo 'Expects 2 arguments: ./populate.sh APPLICATION K8S_ENVIRONMENT' | |
exit 1 | |
fi | |
extra_vars="--extra-vars @group_vars/secrets.yml" | |
application=$1 | |
k8s_environment=$2 |
This file contains hidden or 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
--- | |
apiVersion: extensions/v1beta1 | |
kind: Deployment | |
metadata: | |
name: test | |
spec: | |
replicas: 1 | |
template: | |
spec: | |
containers: |
This file contains hidden or 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
--- | |
apiVersion: v1 | |
kind: ConfigMap | |
metadata: | |
name: alert-rules | |
data: | |
foo-file: | | |
foo: bar | |
whiz: bang | |
special.conf: | |
NewerOlder