Skip to content

Instantly share code, notes, and snippets.

View leanderjanssen's full-sized avatar

Leander Janssen leanderjanssen

View GitHub Profile
@leanderjanssen
leanderjanssen / install.sh
Last active September 12, 2018 15:08
deploy centos7 docker vm
#!/bin/sh
set -xe
FQDN="node"
DOCKERURL=https://storebits.docker.com/ee/centos/sub-2df29a12-742a-461b-893c-9c1aca7aa714
USERPASS=DockerAmazic1805
# hostname
echo "$FQDN" > /etc/hostname
sed -i "1 c\\127.0.0.1 $FQDN localhost" /etc/hosts
@leanderjanssen
leanderjanssen / packer.json
Created August 17, 2018 12:19
packer.json with ansible provisioner
{
"variables": {
"unique_id": "{{env `UNIQUE_ID`}}",
"ansible_path": "{{env `ANSIBLE_ROLES_PATH`}}",
"playbook_path": "{{env `ANSIBLE_PLAYBOOK_PATH`}}",
"ami": "{{ env `AMI`}}",
"subnet_id": "{{env `SUBNET`}}",
"vpc_id": "{{env `VPC`}}",
"owner": "{{env `OWNER`}}",
"ami_name": "{{env `AMI_NAME`}}",
version: '3.3'
services:
minio:
image: training/minio:demo
volumes:
- minio-data:/export
ports:
- "9001:9000"
networks:
UCP_IP=$(curl -s http://169.254.169.254/latest/meta-data/public-ipv4)
UCP_FQDN=$(curl -s http://169.254.169.254/latest/meta-data/public-hostname)
DTR_FQDN=${UCP_FQDN}
docker run -it --rm docker/dtr:2.5.0 install \
--ucp-node ucp-manager-0 \
--ucp-username admin \
--ucp-password adminadmin \
--ucp-url https://${UCP_IP} \
--ucp-insecure-tls \
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: default-http-backend
labels:
app: default-http-backend
namespace: ingress-nginx
spec:
replicas: 1
template:
@leanderjanssen
leanderjanssen / install-ucp.sh
Created March 22, 2018 04:40
install-ucp.sh
UCP_IP=$(curl -s http://169.254.169.254/latest/meta-data/public-ipv4)
UCP_FQDN=$(curl -s http://169.254.169.254/latest/meta-data/public-hostname)
docker container run -it --rm --name ucp \
-v /var/run/docker.sock:/var/run/docker.sock \
docker/ucp:2.2.6 install \
--swarm-port 3376 \
--admin-username admin \
--admin-password adminadmin \
--san ${UCP_IP} \
@leanderjanssen
leanderjanssen / dockercoins.yml
Created February 14, 2018 11:39
Dockercoins compose
version: "3.1"
services:
rng:
image: training/dockercoins_rng:1.0
networks:
- dockercoins
ports:
- "8001:80"
hasher:
@leanderjanssen
leanderjanssen / org.svg
Last active December 4, 2017 15:27
Solution for Access Control in UCP
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@leanderjanssen
leanderjanssen / ucp.sh
Last active December 5, 2017 14:19
Create UCP environment + DTR using docker-machine and virtualbox
#!/bin/bash
# DDC set up with Docker Machine
echo Test $0 $1 $2 $3
if [ "$1" == "" ]; then
echo "Usage setup.sh <number of UCP nodes> <number of DTR nodes> <number of worker node>"
exit 1
fi
if [ "$UCP_ADMIN" == "" ]; then
UCP_ADMIN="moby"
@leanderjanssen
leanderjanssen / check-kernel-config.sh
Created September 22, 2017 09:26
Script to verify kernel configuration
#!/usr/bin/env bash
set -e
EXITCODE=0
# bits of this were adapted from lxc-checkconfig
# see also https://github.com/lxc/lxc/blob/lxc-1.0.2/src/lxc/lxc-checkconfig.in
possibleConfigs=(
'/proc/config.gz'