Aptly Real-Live example
$ echo 'deb http://repo.aptly.info/ squeeze main' > /etc/apt/sources.list.d/aptly.list && wget -qO - https://www.aptly.info/pubkey.txt | sudo apt-key add -
$ apt-get update && apt-get install -y -f aptly
#!/bin/bash | |
# configures bash prompt based on current kubernetes cluster context and namespace | |
# based on https://pracucci.com/display-the-current-kubelet-context-in-the-bash-prompt.html | |
__kube_ps1() | |
{ | |
CONTEXT=$(kubectl config view | grep current-context | awk '{ print $NF }' | awk -F '.' '{ print $1 }') | |
NS=$(kubectl config view $(kubectl config current-context) | grep namespace | awk '{ print $2 }') | |
if [ -n "$CONTEXT" ]; then | |
echo "[${CONTEXT}][${NS}]" |
$ echo 'deb http://repo.aptly.info/ squeeze main' > /etc/apt/sources.list.d/aptly.list && wget -qO - https://www.aptly.info/pubkey.txt | sudo apt-key add -
$ apt-get update && apt-get install -y -f aptly
[Unit] | |
Description=Mount EBS volume at /var/lib/etcd2 | |
Requires=format-etcd-ebs.service | |
After=format-etcd-ebs.service | |
Before=etcd2.service | |
[Mount] | |
DirectoryMode=0777 | |
Type=ext4 | |
What=/dev/xvdb |
apiVersion: v1 | |
kind: Service | |
metadata: | |
name: minio | |
labels: | |
app: minio | |
spec: | |
clusterIP: None | |
ports: | |
- port: 9000 |
# lib/authentications/authentication.rb | |
# @api auth | |
# Authentication base class | |
# | |
module Authentication | |
def self.included(base) | |
base.class_eval do | |
before :authenticate! | |
expose :current_user |
This uses terraform's template_file
resource to generate a yaml properties file for serverspec to use.
spec
directory and put spec_helper.rb
in ittemplates/properties.tmpl.yml
fileserverspec.tf
terraform apply
Tests will be matched based on roles defined for a given node.
#cloud-config | |
--- | |
coreos: | |
units: | |
- name: update-fleet-metadata.service | |
command: start | |
content: |- | |
[Unit] | |
Description=Update Fleet metadata tag | |
Before=fleet.service |
apiVersion: extensions/v1beta1 | |
kind: DaemonSet | |
metadata: | |
labels: | |
name: etcd | |
name: etcd | |
spec: | |
template: | |
metadata: | |
labels: |
Unit files to deploy an ElasticSearch cluster on CoreOS via Fleet.
Service discovery & registration is done via etcd.
[email protected] provides a dumb discovery service by registering an elasticsearch host if it should be up. [email protected] registers the service only if it is running.
A service & timer unit for elasticsearch curator is provided which does some housekeeping.
This script will pull down an S3 remote configuration before running any terraform actions. Assumes the following structure:
main.tf
terraform.cfg
env/dev/vars
env/staging/vars
env/whatever/vars
env/whatever/somefile.tf