$ docker compose -f acmesh.yaml up -dACME_HOME_DIR=./acme.sh| aggregationRule: | |
| clusterRoleSelectors: | |
| - matchLabels: | |
| rbac.authorization.k8s.io/aggregate-to-admin: "true" | |
| apiVersion: rbac.authorization.k8s.io/v1 | |
| kind: ClusterRole | |
| metadata: | |
| annotations: | |
| rbac.authorization.kubernetes.io/autoupdate: "true" | |
| labels: |
| # API Key 可以在以下頁面建立: | |
| # https://max.maicoin.com/api_tokens/new | |
| # | |
| MAX_API_KEY= | |
| MAX_API_SECRET= |
| #!/bin/sh | |
| # Author: https://github.com/AlexCzar | |
| # License: Apache 2.0 | |
| # This script can be used as a launcher for alacritty-inside-tabbed | |
| # It monitors window manager events and when detects that tabbed has | |
| # lost focus, script will minimize tabbed. | |
| # If alacritty-in-tabbed is not running, it will launch it, if it is | |
| # running but isn't focused, script will give it focus, if it is running | |
| # and is focused, script will minimize it. |
| package main | |
| import ( | |
| "github.com/prometheus/client_golang/prometheus" | |
| "github.com/prometheus/client_golang/prometheus/promhttp" | |
| "log" | |
| "math/rand" | |
| "net/http" | |
| "time" |
Let's start by creating entry for server in docker-compose.yaml:
version: '2'
# version 2 of docker-compose is not "old" version, it's the actual version,
# see below for explanation:
# https://stackoverflow.com/a/53636006/961092
services:As written by Susan Fowler.
| pre required SSH access | |
| ## Download and install acme.sh | |
| acme.sh is a full implementation of a LetsEncrypt client but that doesn't depend on Python/pip/virtualenv/etc, and that doesn't require root -- exactly what we need, since we don't have root an a shared GoDaddy server, and we can't install new software outside of our home directory. | |
| `curl https://get.acme.sh | sh` | |
| Now log out and SSH back in so acme.sh's install is complete in every way (include the Bash alias). | |
| ##Get GoDaddy API Key | |
| Visit `https://developer.godaddy.com/keys/` |
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) /