Set this up as an "Origin Response" Cloudfront Trigger.
A lot of people land when trying to find out how to calculate CPU usage metric correctly in prometheus, myself included! So I'll post what I eventually ended up using as I think it's still a little difficult trying to tie together all the snippets of info here and elsewhere.
This is specific to k8s and containers that have CPU limits set.
To show CPU usage as a percentage of the limit given to the container, this is the Prometheus query we used to create nice graphs in Grafana:
sum(rate(container_cpu_usage_seconds_total{name!~".*prometheus.*", image!="", container_name!="POD"}[5m])) by (pod_name, container_name) /
import React from "react"; | |
import { makeStyles, createStyles, Theme } from '@material-ui/core/styles'; | |
import Paper from '@material-ui/core/Paper'; | |
import Grid from '@material-ui/core/Grid'; | |
import Box from '@material-ui/core/Box'; | |
import TextField from '@material-ui/core/TextField'; | |
import Typography from '@material-ui/core/Typography'; | |
import { Button } from '@material-ui/core'; | |
import { useForm } from 'react-hook-form'; | |
import * as yup from 'yup'; |
#!/bin/bash | |
# | |
# By Zibri (2019) | |
# | |
# Usage: gitclean username password giturl | |
# | |
gitclean () | |
{ | |
odir=$PWD; | |
if [ "$#" -ne 3 ]; then |
⚠️ Note 2023-01-21
Some things have changed since I originally wrote this in 2016. I have updated a few minor details, and the advice is still broadly the same, but there are some new Cloudflare features you can (and should) take advantage of. In particular, pay attention to Trevor Stevens' comment here from 22 January 2022, and Matt Stenson's useful caching advice. In addition, Backblaze, with whom Cloudflare are a Bandwidth Alliance partner, have published their own guide detailing how to use Cloudflare's Web Workers to cache content from B2 private buckets. That is worth reading,
package kubernetes | |
name = input.metadata.name | |
kind = input.kind | |
is_service { | |
kind = "Service" | |
} |
Prow is a Kubernetes based CI/CD system. Jobs can be triggered by various types of events and report their status to many different services. In addition to job execution, Prow provides GitHub automation in the form of policy enforcement, chat-ops via /foo style commands, and automatic PR merging.
NOTE|WARNING: In order to make Prow work fine with your repo, the Kubernetes cluster MUST be reachable by GitHub Webhook.
- Readme file: https://github.com/kubernetes/test-infra/blob/master/prow/README.md
- Command Help: https://prow.k8s.io/command-help
Nginx can be configured to route to a backend, based on the server's domain name, which is included in the SSL/TLS handshake (Server Name Indication, SNI).
This works for http upstream servers, but also for other protocols, that can be secured with TLS.
- at least nginx 1.15.9 to use variables in ssl_certificate and ssl_certificate_key.
- check
nginx -V
for the following:... TLS SNI support enabled
receivers: | |
################################################### | |
## Slack Receivers | |
- name: slack-code-owners | |
slack_configs: | |
- channel: '#{{- template "slack.monzo.code_owner_channel" . -}}' | |
send_resolved: true | |
title: '{{ template "slack.monzo.title" . }}' | |
icon_emoji: '{{ template "slack.monzo.icon_emoji" . }}' | |
color: '{{ template "slack.monzo.color" . }}' |
#Spin up Kubernetes control plane as part of before_script, and destroys it using after_script | |
#Some custom logic to get to the right ip address | |
#Requres the gitlab docker runner, with "pass-thru" to the host docker socket. | |
stages: | |
- test | |
image: python:3.6.6 #the docker image you run in needs Docker installed, and access to the host docker socket. | |
test_integration_k8s: | |
tags: |