Twelve Go Best Practices
Francesc Campoy Flores Gopher at Google @francesc http://campoy.cat/+
- Best practices
| #!/usr/bin/env python | |
| """A simple python script template. | |
| """ | |
| from __future__ import print_function | |
| import os | |
| import sys | |
| import argparse |
Twelve Go Best Practices
Francesc Campoy Flores Gopher at Google @francesc http://campoy.cat/+
| #!/usr/bin/python | |
| """ | |
| Usage: | |
| python swagger-yaml-to-html.py < /path/to/api.yaml > doc.html | |
| """ | |
| import yaml, json, sys | |
| TEMPLATE = """ |
| Step by step how to pull a private DockerHub hosted image in a Kubernetes YML. | |
| export DOCKER_REGISTRY_SERVER=https://index.docker.io/v1/ | |
| export DOCKER_USER=Type your dockerhub username, same as when you `docker login` | |
| export DOCKER_EMAIL=Type your dockerhub email, same as when you `docker login` | |
| export DOCKER_PASSWORD=Type your dockerhub pw, same as when you `docker login` | |
| kubectl create secret docker-registry myregistrykey \ | |
| --docker-server=$DOCKER_REGISTRY_SERVER \ | |
| --docker-username=$DOCKER_USER \ |
| { | |
| "AWSTemplateFormatVersion": "2010-09-09", | |
| "Description": "Launches a Jenkins server.", | |
| "Parameters": { | |
| "InstanceType": { | |
| "Description": "EC2 instance type", | |
| "Type": "String", | |
| "Default": "t2.small", | |
| "AllowedValues": [ | |
| "t1.micro", |
Helper setup to edit .yaml files with Vim:
List of general purpose commands for Kubernetes management:
Link to these links: https://git.io/vKSVZ
Module 1:
jenkins -jar jenkins.wardocker run -d \
--restart unless-stopped \
--name jenkins \