Implement web broker provider and a sample provider in Rust

This commit is contained in:
Rajasekharan Vengalil
2017-12-22 17:10:14 -08:00
parent e050fea889
commit a4e99c2133
18 changed files with 1679 additions and 10 deletions

View File

@@ -0,0 +1,21 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*~
# Various IDEs
.project
.idea/
*.tmproj

View File

@@ -0,0 +1,4 @@
name: virtual-kubelet-web
version: 0.1.0
description: a Helm chart to install virtual kubelet in Kubernetes setup with a web provider

View File

@@ -0,0 +1,5 @@
The virtual kubelet is getting deployed on your cluster.
To verify that virtual kubelet has started, run:
kubectl --namespace={{ .Release.Namespace }} get pods -l "app={{ template "virtual-kubelet-web.fullname" . }}"

View File

@@ -0,0 +1,16 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "virtual-kubelet-web.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
*/}}
{{- define "virtual-kubelet-web.fullname" -}}
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}

View File

@@ -0,0 +1,42 @@
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: {{ template "virtual-kubelet-web.fullname" . }}
labels:
app: {{ template "virtual-kubelet-web.name" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
replicas: 1
selector:
matchLabels:
app: {{ template "virtual-kubelet-web.name" . }}
template:
metadata:
labels:
app: {{ template "virtual-kubelet-web.name" . }}
release: {{ .Release.Name }}
spec:
containers:
- name: rustwebprovider
image: "{{ .Values.rustwebimage.repository }}:{{ .Values.rustwebimage.tag }}"
imagePullPolicy: {{ .Values.rustwebimage.pullPolicy }}
ports:
- containerPort: {{ .Values.rustwebimage.port }}
livenessProbe:
httpGet:
path: /
port: {{ .Values.rustwebimage.port }}
readinessProbe:
httpGet:
path: /
port: {{ .Values.rustwebimage.port }}
- name: virtualkubelet
image: "{{ .Values.vkimage.repository }}:{{ .Values.vkimage.tag }}"
imagePullPolicy: {{ .Values.vkimage.pullPolicy }}
env:
- name: WEB_ENDPOINT_URL
value: http://localhost:{{ .Values.rustwebimage.port }}
command: ["virtual-kubelet"]
args: ["--provider", "web", "--nodename", {{ default "web-provider" .Values.env.nodeName | quote }}]

View File

@@ -0,0 +1,11 @@
rustwebimage:
repository: avranju/rust-web-provider
tag: latest
pullPolicy: Always
port: 3000
vkimage:
repository: avranju/virtual-kubelet
tag: latest
pullPolicy: Always
env:
nodeName: virtual-kubelet-web