--- | |
apiVersion: v1 | |
kind: ConfigMap | |
metadata: | |
name: stunnel-script | |
namespace: kube-system | |
data: | |
stunnel.sh: | | |
#!/bin/sh | |
WAIT_TIME=60 # Time in seconds to wait before polling stunnel processes |
#!/usr/bin/env -S awk -f | |
# https://gist.github.com/yermulnik/7e0cf991962680d406692e1db1b551e6 | |
# Tested with GNU Awk 5.0.1, API: 2.0 (GNU MPFR 4.0.2, GNU MP 6.2.0) | |
# Usage: /path/to/tf_vars_sort.awk < variables.tf | tee sorted_variables.tf | |
# Note: "chmod +x /path/to/tf_vars_sort.awk" before use | |
# No licensing; yermulnik@gmail.com, 2021-2023 | |
{ | |
# skip blank lines at the beginning of file | |
if (!resource_type && length($0) == 0) next |
# Note: real path is inventory_plugins/dummy.py (adjacent to playbook) | |
from ansible.plugins.inventory import BaseInventoryPlugin | |
DOCUMENTATION = """ | |
name: dummy | |
author: Olvier Clavel (@zeitounator) | |
short_description: Dummy inventory demo plugin for https://stackoverflow.com/questions/66820243 | |
description: | |
- This is an inventory plugin for pure demo and test. | |
- Do not use in production. |
The following worked with Elastic Cloud, Elasticsearch & Kibana v7.6.0. It should be pretty close for other kinds of deployments. Before starting, make sure you have the right license level that allows SAML.
- Navigate to the SAML apps section of the admin console
- Click the Add button and choose to "Add custom SAML app"
- Write down the Entity ID and download the Idp metadata file
- Choose application name, description and add logo
- In the "Service Provider Details" screen add the following:
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) /
In testing environments, it is not always useful repeating tasks which can cost developers valuable time. Within a project its safe to assume that not all files are changed, so why rebuild?
This tutorial outlines a method to reduce unnecessarly build steps. Use your best judgement of course. It might be useful to add in a build on occassion to ensure third party dependencies are available and will not disrupt a production deployment.
The git plugin in Jenkins provides several useful environment variables which can be used to avoid build tasks. Make sure you setup the git plugin before going any further.
//maps.googleapis.com | |
//maps.gstatic.com | |
//fonts.googleapis.com | |
//fonts.gstatic.com | |
//ajax.googleapis.com | |
//apis.google.com | |
//google-analytics.com | |
//www.google-analytics.com | |
//ssl.google-analytics.com | |
//youtube.com |
/* | |
##Device = Desktops | |
##Screen = 1281px to higher resolution desktops | |
*/ | |
@media (min-width: 1281px) { | |
/* CSS */ | |
KEY=XXXXXXXXXXXX | |
HOST="https://metrics.crisidev.org" | |
mkdir -p dashboards && for dash in $(curl -k -H "Authorization: Bearer $KEY" $HOST/api/search\?query\=\& |tr ']' '\n' |cut -d "," -f 5 |grep slug |cut -d\" -f 4); do | |
curl -k -H "Authorization: Bearer $KEY" $HOST/api/dashboards/db/$dash > dashboards/$dash.json | |
done |