This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"builders": [{ | |
"type": "docker", | |
"image": "tiangolo/uwsgi-nginx:python3.8", | |
"commit": "true", | |
"changes": ["ENTRYPOINT /start.sh"] | |
}], | |
"provisioners": [ | |
{ | |
"type": "file", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"variables": { | |
"ansible_user": "ubuntu", | |
"name": "ubuntu_nginx_packer", | |
"source_ami": "ami-0d5d9d301c853a04a", | |
"access_key":"", | |
"secret_key":"", | |
"region":"us-east-2" | |
}, | |
"builders": [{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# | |
# Run this as root on the first master node. You must be able to ssh as the root user to each node via ssh keys | |
# installed at /root/.ssh/ on the first master node. The public ssh key MUST be in the /root/.ssh/authorized_keys | |
# file on ALL nodes including the first master. Use "ssh-keygen" to create an ssh keypair and use "ssh-copy-id NODE_IP" | |
# to distribute the public key to ALL nodes. | |
# | |
# The following commands are used to prepare a generic EC2 or GCE instance and run the script. | |
# # enter an interactive sudo session | |
# sudo -i |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
#This script will setup an RKE Kubernetes cluster with TungstenFabric as the CNI with one master and two worker nodes running Ubuntu 18.04 | |
# | |
#Run this as root from the initial control plane node | |
# | |
#You will need to create an ssh keypair and place them in /root/.ssh/ and then use ssh-copy-id to distribute the public key to all other nodes | |
# | |
#Set the control_plane_ip and worker_ip variables and update the embedded cluster.yml to the correct ip addresses for your environment | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- hosts: all | |
sudo: true | |
tasks: | |
- block: | |
- name: ping | |
ping: | |
- name: delete old moh files |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1) Install Ubuntu on nodes and set hostname and IP on all nodes | |
2) Prepare nodes. Run these commands as the root user on all nodes | |
#turn off swap | |
swapoff -a | |
#install packages | |
apt-get install -y ntp docker.io |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- hosts: all | |
sudo: true | |
tasks: | |
- name: install nginx for ubuntu | |
apt: name=nginx state=latest | |
when: ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu' | |
- name: install nginx for centos |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This will walk you through setting up KVM and a bridged network connection on an Ubuntu 16.04 host and installing a Tf-devstack guest VM. | |
This example uses the 192.168.1.0/24 subnet with 192.168.1.20 for the Ubuntu host and 192.168.1.21 for the Centos guest. | |
1) Install needed virtualization and network bridge packages with | |
sudo apt-get install qemu-kvm libvirt-bin virtinst bridge-utils virt-viewer | |
2) Next we need to make sure the CPU/MOBO has the virtuilizion extensions enabled with | |
sudo kvm-ok | |
3) Now we must setup a network bridge for our KVM guest. First backup the current network config with |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#RUN THIS AS ROOT! this script assumes you have installed Ubuntu 16.04 LTS or Centos 7 on your nodes and can ssh to each node as root | |
#scp ssh keys to /root/.ssh/ and scp kubespray-tf.sh to /root/ on first master | |
#edit k8s_api_ip variable and master_ip_list variable and then edit the inventory.ini to match your environment | |
#edit pod and service cidr or k8s version in k8s-cluster.yml file below to match your needs | |
#set this to the IP of your first k8s master. this will eventually need to be the ip of an haproxy pointing at the master_ip_list for the K8s API | |
k8s_api_ip="10.9.8.21" |