Skip to content

Instantly share code, notes, and snippets.

View allthingsclowd's full-sized avatar
🎲
42

Graham Land allthingsclowd

🎲
42
View GitHub Profile
@allthingsclowd
allthingsclowd / inputs.yml
Created June 16, 2017 14:05
MongoDB HEAT Stack Input Parameters
# Input parameters
parameters:
k5_ubuntu_image:
type: string
label: Image name or ID
description: Image to be used for compute instance
default: "Ubuntu Server 14.04 LTS (English) 02"
flavor:
type: string
label: Flavor
@allthingsclowd
allthingsclowd / MongoDB_Heat.yml
Created June 16, 2017 14:02
Simple OpenStack heat template that deploys Mongodb 3.4 to Fujitsu K5 IaaS Ubuntu 14.04 image
heat_template_version: 2013-05-23
# Author: Graham Land
# Date: 16/06/2017
# Purpose: Deploy MongoDB on Ubuntu 14.04 on Fujitsu's Cloud Service K5 IaaS Platform
# NOTE: Includes hardcoded user accounts and passwords - please change these
# and add TLS if considering use cases other than test/dev.
#
# Twitter: @allthingsclowd
# Blog: https://allthingscloud.eu
#
@allthingsclowd
allthingsclowd / Kubectl.txt
Created May 26, 2017 22:31
Useful Kubernetes Commands for Fujitsu K5 Kubernetes Deployment Stack
# check version
kubectl version
# list kube nodes
kubectl get nodes
# list pods
kubectl get pods --all-namespaces
# check docker
@allthingsclowd
allthingsclowd / K5_HA_Kubernetes.yml
Created May 26, 2017 21:28
Fujitsu K5 HA Kubernetes Deployment - this HEAT Template has K5 specific enhancements and will not run on native OpenStack without minor modifications
heat_template_version: 2013-05-23
# Author: Graham Land
# Date: 26/05/2017
# Purpose: Deploy Kubernetes on Fujitsu's K5 IaaS Platform
#
# Twitter: @allthingsclowd
# Blog: https://allthingscloud.eu
#
#
@allthingsclowd
allthingsclowd / K5-Kubernetes-Non-HA.yml
Last active May 26, 2017 21:09
Fujitsu K5 Kubernetes HEAT Stack (this should also work on native OpenStack)
heat_template_version: 2013-05-23
# Author: Graham Land
# Date: 26/05/2017
# Purpose: Deploy Kubernetes on Fujitsu's K5 IaaS Platform
#
# Twitter: @allthingsclowd
# Blog: https://allthingscloud.eu
# Gist: https://gist.github.com/allthingsclowd/4814fb3895ef5842befbb90cdf93244e
#
@allthingsclowd
allthingsclowd / K5_Terraform_Provider.tf
Created May 17, 2017 18:48
K5_Terraform_Example_Provider_Complete
# Openstack Provider
provider "openstack" {
user_name = "landg"
password = "ThisIsMySecretPasswordTellNoOne"
tenant_name = "Project_B"
domain_name = "YssmW1yI"
auth_url = "https://identity.uk-1.cloud.global.fujitsu.com/v3"
@allthingsclowd
allthingsclowd / terraform_fujitsu_k5_provider.tf
Last active May 17, 2017 18:32
Fujitsu K5 Terraform Example Provider
# Openstack Provider
provider "openstack" {
user_name = "1. Enter K5 Username"
password = "2. Enter K5 Password"
tenant_name = "3. Enter K5 Target Project Name"
domain_name = "4. Enter K5 Contract Name"
# 5. Change the "uk-1" region below to match your target region
auth_url = "https://identity.uk-1.cloud.global.fujitsu.com/v3"
@allthingsclowd
allthingsclowd / Angular2_OpenStack.md
Created March 24, 2017 17:10
Angular 2, OpenStack & CORS: The application simply takes your K5 credentials and makes a request to Keystone, the backend K5 authentication (identity) endpoint, and if these credentials are valid it presents your token back to you.

K5_Angular_2_Example_Login

Update - 23/03/2017 - Angular 2 and K5 CORS challenge resolved...by using a lightweight CORS PROXY Server

See the cors_proxy_service.js for the solution.

https://github.com/allthingsclowd/K5_Angular_2_Example_Login

This repo has been put together to demonstrate how to work-around the CORS authentication challenges when building an Angular 2 SPA (Single Page Application) for Fujitsu's K5 platform.

@allthingsclowd
allthingsclowd / cors_proxy_service.js
Created March 24, 2017 16:23
A simple NodeJS application that acts as a CORS proxy server
// Heroku defines the environment variable PORT, and requires the binding address to be 0.0.0.0
var host = process.env.PORT ? '0.0.0.0' : '127.0.0.1';
var port = process.env.PORT || 2337;
var cors_proxy = require('cors-anywhere');
cors_proxy.createServer({
originWhitelist: [], // Allow all origins
//requireHeader: ['origin', 'x-subject-token'],
}).listen(port, host, function() {
console.log('Running CORS Anywhere on ' + host + ':' + port);
@allthingsclowd
allthingsclowd / K5_Object_Storage_Demo.py
Last active May 26, 2017 15:57
Fujitsu K5 Swift Object Storage Example Script
#!/usr/bin/python
""" Fujitsu K5 ObjectStorage Demo Application
This script shows how to create a new object storage container in OpenStack Swift
that is publically available and then upload files to that container
Author: Graham Land
Date: 10/03/17