Install rancher on k3os with centralized datastore on mysql cluster.
- Host: Ubuntu 18.04.4 Desktop (32gb ram 4 cpu)
- Virtualisation: kvm/qemu (virtual machine manager)
- Local network: 192.168.0.0/16
- Gateway: 192.168.0.1
# Source: https://gist.github.com/baaf4adb25e9efaba886c17a2ad722a5 | |
######################################################## | |
# How To Auto-Scale Kubernetes Clusters With Karpenter # | |
# https://youtu.be/C-2v7HT-uSA # | |
######################################################## | |
# Referenced videos: | |
# - Karpenter: https://karpenter.sh | |
# - GKE Autopilot - Fully Managed Kubernetes Service From Google: https://youtu.be/Zztufl4mFQ4 |
# MASTER PRE-REQS | |
# Install docker, docker-compose | |
# mkdir -p ~/{jenkins,jnlp_slave} | |
# master | |
# docker run -d \ | |
# -u root \ | |
# --name=jenkins \ | |
# -e TZ=America/Denver \ |
UPDATE (March 2020, thanks @ic): I don't know the exact AMI version but yum install docker
now works on the latest Amazon Linux 2. The instructions below may still be relevant depending on the vintage AMI you are using.
Amazon changed the install in Linux 2. One no-longer using 'yum' See: https://aws.amazon.com/amazon-linux-2/release-notes/
sudo amazon-linux-extras install docker
sudo service docker start
import boto3 | |
from boto3.session import Session | |
def assume_role(arn, session_name): | |
"""aws sts assume-role --role-arn arn:aws:iam::00000000000000:role/example-role --role-session-name example-role""" | |
client = boto3.client('sts') | |
account_id = client.get_caller_identity()["Account"] | |
print(account_id) |
Example on how to run locally an AWS Lambda via API Gateway using localstack.
Based on...
#!/usr/bin/ruby | |
#usage: youtube-to-mp3 <youtube-url> | |
#example: youtube-to-mp3 http://www.youtube.com/playlist?list=PL398CE05652474A1E | |
#desc: downloads a single youtube vid or a playlist, then converts to mp3. | |
# Requires youtube-dl and ffmpeg | |
url = ARGV[0] | |
system("youtube-dl -citA #{url}") |
Create file /etc/systemd/system/[email protected]
. SystemD calling binaries using an absolute path. In my case is prefixed by /usr/local/bin
, you should use paths specific for your environment.
[Unit]
Description=%i service with docker compose
PartOf=docker.service
After=docker.service
import boto3 | |
def role_arn_to_session(**args): | |
""" | |
Usage : | |
session = role_arn_to_session( | |
RoleArn='arn:aws:iam::012345678901:role/example-role', | |
RoleSessionName='ExampleSessionName') | |
client = session.client('sqs') | |
""" |
# -*- coding: utf-8 -*- | |
import os | |
import uuid | |
from flask import Flask, render_template, redirect, url_for, request | |
from flask_uploads import UploadSet, configure_uploads, IMAGES, patch_request_class | |
from flask_wtf import FlaskForm | |
from flask_wtf.file import FileField, FileRequired, FileAllowed | |
from wtforms import SubmitField |