Skip to content

Instantly share code, notes, and snippets.

:shipit:
https://bit.ly/IqT6zt

Anthony Lapenna deviantony

:shipit:
https://bit.ly/IqT6zt
Block or report user

Report or block deviantony

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@deviantony
deviantony / README.md
Last active Sep 3, 2018
Demo multi-cluster DO
View README.md

Instructions

These instructions show how to deploy two cluster on Digital Ocean and how to manage them via Portainer.

VM deployment

Deploy 3 nodes on DO:

  1. Click on Create > Droplets
  2. In the image selection, choose "One-click apps"
@deviantony
deviantony / README.md
Last active Mar 13, 2018
Portainer create image from HTTP API
View README.md

This document aims to help you use the Portainer HTTP API to build a Docker image on a specific environment.

Requirements

  • A Portainer instance
  • A Portainer user account
  • The environment where you want to build the image created as an endpoint inside the Portainer instance

Instructions

@deviantony
deviantony / README.md
Created Mar 8, 2018
Portainer admin password in a docker-compose environment
View README.md

Portainer compose deployment with admin password preset

This file aims to explain how to deploy Portainer inside a compose file with the admin password already set.

Generate the admin password

For this example, we'll use the password superpassword.

Use the following command to generate a hash for the password:

@deviantony
deviantony / AGENT_CLUSTER.md
Last active Nov 30, 2017
Swarm aggregation feature discussion
View AGENT_CLUSTER.md

Cluster of agents

This implementation rely on the fact that the agent is able to auto-discover other agents. Deployed as a global service inside a Swarm cluster, each agent automatically discover the other agents in the cluster and register them.

Portainer can then be plugged on any of these agents (either by using DNS-SRV records ensure high-availability or using the URL to a specific agent). To do so, a user would just need to create a new endpoint and add the IP:PORT to one of the agents in the cluster (or use the Swarm service name to be able to use DNS-SRV records).

The agent would be responsible for the following:

  • Aggregate the data of multiple nodes (list the containers available in the cluster for example)
  • Redirect requests to specific nodes in the cluster (inspect a container on a specific node or create a new secret via a cluster manager for example)
@deviantony
deviantony / docker-compose.yml
Created Sep 5, 2017
Docker Swarm cluster setup with Docker in Docker
View docker-compose.yml
version: "2"
services:
portainer:
image: portainer/portainer:latest
container_name: "portainer-app"
command: -H unix:///var/run/docker.sock
networks:
- portainer
volumes:
- /tmp/manager_run/docker.sock:/var/run/docker.sock
@deviantony
deviantony / README.md
Last active Nov 15, 2019
Portainer HTTP API by example
View README.md

Introduction

This document presents a simple way to manage your Docker resource by using Portainer as a gateway (HTTP queries against the Portainer API).

The API documentation is available here: https://app.swaggerhub.com/apis/deviantony/portainer/

WARNING: This documentation is valid for Portainer >= 1.18.0.

NOTE: I'm using httpie to execute HTTP queries from the CLI.

@deviantony
deviantony / install-latest-compose.sh
Created Jun 23, 2016
Install latest version of Docker Compose
View install-latest-compose.sh
#!/bin/bash
# get latest docker compose released tag
COMPOSE_VERSION=$(curl -s https://api.github.com/repos/docker/compose/releases/latest | grep 'tag_name' | cut -d\" -f4)
# Install docker-compose
sh -c "curl -L https://github.com/docker/compose/releases/download/${COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose"
chmod +x /usr/local/bin/docker-compose
sh -c "curl -L https://raw.githubusercontent.com/docker/compose/${COMPOSE_VERSION}/contrib/completion/bash/docker-compose > /etc/bash_completion.d/docker-compose"
@deviantony
deviantony / prom-node-exporter.service
Created Jun 21, 2016
Systemd script for Prometheus node_exporter
View prom-node-exporter.service
[Unit]
Description=Prometheus node exporter
After=local-fs.target network-online.target network.target
Wants=local-fs.target network-online.target network.target
[Service]
ExecStart=/opt/prometheus/node_exporter/node_exporter
Type=simple
[Install]
@deviantony
deviantony / local-persist-install-nosudo.sh
Last active Jun 21, 2016
Installation of the local-persist volume driver for docker without sudo
View local-persist-install-nosudo.sh
#!/usr/bin/env bash
set -e
VERSION="v1.2.1"
# uname -s, uname -m
# Deb 32: Linux i686
# Ubuntu 64: Linux x86_64
# FreeBSD: FreeBSD amd64
@deviantony
deviantony / convoy
Created May 6, 2016
Start the convoy daemon using the NFS driver with vfs.path=/var/nfs/volumes
View convoy
#!/bin/sh
### BEGIN INIT INFO
# Provides:
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start daemon at boot time
# Description: Enable service provided by daemon.
### END INIT INFO
You can’t perform that action at this time.