Install k3s on master node:
curl -sfL https://get.k3s.io | sh -
# get token
cat /var/lib/rancher/k3s/server/node-token
Install k3s on worker nodes as agents:
""" | |
This script uses the GraphQL API to create discussions programatically using Python and Requests. | |
""" | |
import os | |
import time | |
import json | |
import requests | |
def url_builder(path): |
#!/usr/bin/env python3 | |
# docs: https://grafana.com/docs/loki/latest/api/#post-lokiapiv1push | |
import requests | |
import time | |
# variables | |
LOKI_USERNAME="x" | |
LOKI_PASSWORD="x" | |
LOKI_ENDPOINT="https://loki-api.example.com/loki/api/v1/push" |
Install k3s on master node:
curl -sfL https://get.k3s.io | sh -
# get token
cat /var/lib/rancher/k3s/server/node-token
Install k3s on worker nodes as agents:
$ curl http://localhost:5000/metrics
# HELP python_gc_objects_collected_total Objects collected during gc
# TYPE python_gc_objects_collected_total counter
python_gc_objects_collected_total{generation="0"} 317.0
python_gc_objects_collected_total{generation="1"} 71.0
python_gc_objects_collected_total{generation="2"} 0.0
# HELP python_gc_objects_uncollectable_total Uncollectable object found during GC
# TYPE python_gc_objects_uncollectable_total counter
python_gc_objects_uncollectable_total{generation="0"} 0.0
Errors like this appear when you start elasticsearch in a container:
$ journalctl -xe
Dec 27 16:50:17 elasticsearch-03 mount[62]: mount: /sys/kernel/config: cannot mount configfs read-only.
Dec 27 16:50:17 elasticsearch-03 systemd-sysctl[63]: Couldn't write '262144' to 'vm/max_map_count', ignoring: Read-only file system
Dec 27 16:50:17 elasticsearch-03 systemd-sysctl[63]: Couldn't write '1' to 'fs/protected_hardlinks', ignoring: Read-only file system
Dec 27 16:50:17 elasticsearch-03 systemd-sysctl[63]: Couldn't write '1' to 'fs/protected_symlinks', ignoring: Read-only file system
$ /etc/init.d/elasticsearch status
# https://github.com/andrewcooke/simple-crypt | |
import base64 | |
import argparse | |
from flata import Flata, Query, where | |
from flata.storages import JSONStorage | |
from simplecrypt import encrypt, decrypt | |
from getpass import getpass | |
db_init = Flata('mydb.json', storage=JSONStorage) |
import argparse | |
import simplecrypt | |
import nacl.secret | |
import nacl.utils | |
import nacl.pwhash | |
import base64 | |
import random | |
import uuid | |
import sys |
Use Vault API to create a user and allow that user to write/read kv pairs from a give path.