Added cloud9 templates for catlle and k8s

This commit is contained in:
Raul Sanchez
2016-12-15 18:30:20 +01:00
parent 98ac20439d
commit e6d3d6e3f3
12 changed files with 344 additions and 0 deletions
+23
View File
@@ -0,0 +1,23 @@
# Cloud9 (Experimental)
### Info:
This template deploys a cloud9 sdk.
### Usage:
Select cloud9 from catalog.
Change the following cloud9 default parameters, if you need:
- cloud9_user=test # Basic auth user
- cloud9_pass=test1234 # Basic auth password
- cloud9_port=8080 # Port to listen
- cloud9_repo="" # Optional: Git repo to sync in your environment
- cloud9_domain=dev.local # Ingress service domain
Click deploy.
Cloud9 can now be accessed over the Rancher network.
@@ -0,0 +1,13 @@
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: ${cloud9_name}
namespace: ${cloud9_namespace}
spec:
rules:
- host: ${cloud9_name}.${cloud9_domain}
http:
paths:
- backend:
serviceName: ${cloud9_name}
servicePort: ${cloud9_port}
@@ -0,0 +1,51 @@
apiVersion: v1
kind: ReplicationController
metadata:
name: "${cloud9_name}"
namespace: "${cloud9_namespace}"
labels:
name: "${cloud9_name}"
spec:
replicas: 1
selector:
name: "${cloud9_name}"
template:
metadata:
labels:
name: "${cloud9_name}"
annotations:
spec:
containers:
- name: "cloud9-sdk"
image: "rawmind/cloud9-sdk:0.3.0-2"
env:
- name: GIT_REPO
value: "${cloud9_repo}"
volumeMounts:
- mountPath: "/var/run/docker.sock"
name: "docker-socket"
- mountPath: "/bin/docker"
name: "docker-exec"
- mountPath: "/workspace"
name: "cloud9-data"
ports:
- containerPort: ${cloud9_port}
name: "cloud9-port"
protocol: "TCP"
args:
- --listen 0.0.0.0
- --port ${cloud9_port}
- -w /workspace
- --collab
- --auth ${cloud9_user}:${cloud9_pass}
imagePullPolicy: "IfNotPresent"
restartPolicy: "Always"
volumes:
- name: "cloud9-data"
emptyDir: {}
- name: "docker-socket"
hostPath:
path: "/var/run/docker.sock"
- name: "docker-exec"
hostPath:
path: "/usr/local/bin/docker"
@@ -0,0 +1,15 @@
apiVersion: v1
kind: Service
metadata:
name: "${cloud9_name}"
namespace: "${cloud9_namespace}"
labels:
name: "${cloud9_name}"
spec:
ports:
- port: ${cloud9_port}
targetPort: ${cloud9_port}
name: "cloud9-port"
protocol: "TCP"
selector:
name: "${cloud9_name}"
@@ -0,0 +1,63 @@
.catalog:
name: Cloud9
description: |
(Experimental) Cloud 9 SDK
version: 3.0-k8s1
minimum_rancher_version: v1.0.0
maintainer: "Raul Sanchez <rawmind@gmail.com>"
uuid: cloud9-0
questions:
- variable: "cloud9_name"
description: "Name of cloud9 rc and service."
label: "K8s rc name:"
required: true
default: "cloud9"
type: "string"
- variable: "cloud9_namespace"
description: "Name of cloud9 namespace."
label: "K8s namespace:"
required: true
default: "default"
type: "string"
- variable: "cloud9_user"
description: |
Username.
label: "Username:"
default: "test"
required: true
type: "string"
- variable: "cloud9_pass"
description: |
Password.
label: "Password:"
default: "test1234"
required: true
type: "string"
- variable: "cloud9_port"
description: "Port to listen"
label: "Port:"
required: true
default: "8080"
type: "int"
- variable: "cloud9_repo"
description: "Git repo to sync"
label: "Git repo:"
required: false
default: ""
type: "string"
- variable: "cloud9_domain"
description: "Ingress service domain"
label: "Ingress domain:"
required: true
default: "dev.local"
type: "string"
cloud9-sdk:
scale: 1
retain_ip: true
health_check:
port: ${cloud9_port}
interval: 5000
unhealthy_threshold: 3
request_line: ''
healthy_threshold: 2
response_timeout: 5000