Skip to content

Instantly share code, notes, and snippets.

Avatar

Tim Nolet tnolet

View GitHub Profile
@tnolet
tnolet / simpleservice_marathon.json
Created Oct 18, 2017
simpleservice_marathon.json
View simpleservice_marathon.json
{
"id": "/simple-service-1.0.0",
"container": {
"type": "DOCKER",
"docker": {
"image": "magneticio/simpleservice:1.0.0",
"network": "BRIDGE",
"portMappings": [
{
"containerPort": 3000,
@tnolet
tnolet / vamp_vga_app.json
Created Oct 12, 2017
Vamp Gateway Agent Marathon JSON
View vamp_vga_app.json
{
"id": "/vamp/vamp-gateway-agent",
"cmd": null,
"cpus": 0.2,
"mem": 256,
"disk": 0,
"instances": 1,
"acceptedResourceRoles": [
"slave_public"
],
@tnolet
tnolet / canary_release_k8s_vamp2.sh
Created Oct 3, 2017
simple canary release on kubernetes with Vamp step 2
View canary_release_k8s_vamp2.sh
vamp merge simpleservice:1.1.0 simpleDep
@tnolet
tnolet / canary_release_k8s_vamp1.sh
Last active Oct 3, 2017
simple canary release on kubernetes with Vamp step 1
View canary_release_k8s_vamp1.sh
# Create two blueprint using the Vamp CLI
curl -s https://raw.githubusercontent.com/magneticio/simpleservice/master/blueprints/service_100.yml | vamp create blueprint --stdin
curl -s https://raw.githubusercontent.com/magneticio/simpleservice/master/blueprints/service_110.yml | vamp create blueprint --stdin
@tnolet
tnolet / install_vamp_k8s_acs.sh
Last active Oct 3, 2017
Install Kubernetes on Azure Container Service
View install_vamp_k8s_acs.sh
# Setup Azure Container Service with Kubernetes
az group create --name myVampResourceGroup --location westeurope
az acs create --orchestrator-type kubernetes --resource-group myVampResourceGroup --name myVampK8SCluster --generate-ssh-keys
az acs kubernetes install-cli
az acs kubernetes get-credentials --resource-group myVampResourceGroup --name myVampK8SCluster
# Install Vamp
curl -s https://raw.githubusercontent.com/magneticio/vamp.io/master/static/res/v0.9.5/vamp_kube_quickstart.sh | bash
@tnolet
tnolet / jenkins_pipeline4.groovy
Last active Sep 18, 2017
jenkins_pipeline4.groovy
View jenkins_pipeline4.groovy
#!groovy
node {
def nodeHome = tool name: '8.3.0', type: 'jenkins.plugins.nodejs.tools.NodeJSInstallation'
env.PATH = "${nodeHome}/bin:${env.PATH}"
// !! Replace these with your own settings !!
def gitRepo = 'https://github.com/magneticio/simpleservice/'
def dockerHub = 'https://registry.hub.docker.com'
def dockerHubCreds = 'docker-hub-login'
def dockerRepo = 'magneticio'
View jenkins_gateway_conditions.yaml
---
name: simpleservice/simpleservice/web
routes:
simpleservice/simpleservice/simpleservice:1.0.0/web:
weight: 100%
simpleservice/simpleservice/simpleservice:1.1.0/web:
condition:
ref: only_firefox
View jenkins_pipeline_delta3-2.groovy
#!groovy
stage('Deploy to Vamp') {
sh "curl -X POST --data-binary @vamp_blueprint.yml ${vampHost}/api/v1/blueprints -H 'Content-Type: application/x-yaml'"
sh "curl -X PUT --data-binary @vamp_blueprint.yml ${vampHost}/api/v1/deployments/simpleservice -H 'Content-Type: application/x-yaml'"
sh "curl -X PUT --data-binary @gateway.yml ${vampHost}/api/v1/gateways/simpleservice/simpleservice/web -H 'Content-Type: application/x-yaml'"
}
View jenkins_pipeline3.groovy
#!groovy
node {
def nodeHome = tool name: '8.3.0', type: 'jenkins.plugins.nodejs.tools.NodeJSInstallation'
env.PATH = "${nodeHome}/bin:${env.PATH}"
// !! Replace these with your own settings !!
def gitRepo = 'https://github.com/magneticio/simpleservice/'
def dockerHub = 'https://registry.hub.docker.com'
def dockerHubCreds = 'docker-hub-login'
def dockerRepo = 'magneticio'
View jenkins_pipeline_delta1-2.groovy
def vampDeploymentName = 'simpleservice'
def vampHost = 'http://10.0.1.134:3232'
stage('Deploy') {
sh "curl -X POST --data-binary @vamp_blueprint.yml ${vampHost}/api/v1/blueprints -H 'Content-Type: application/x-yaml'"
sh "curl -X PUT --data-binary @vamp_blueprint.yml ${vampHost}/api/v1/deployments/${vampDeploymentName} -H 'Content-Type: application/x-yaml'"
}
You can’t perform that action at this time.