Skip to content

Commit

Permalink
Initial commit.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jason Carter committed May 22, 2018
0 parents commit 45fadfa
Show file tree
Hide file tree
Showing 22 changed files with 519 additions and 0 deletions.
Binary file added .DS_Store
Binary file not shown.
Binary file added 503.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added buzz.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added cluster_diagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docker.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file added example/.dockerignore
Empty file.
1 change: 1 addition & 0 deletions example/.ruby-gemset
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
noobernetes
1 change: 1 addition & 0 deletions example/.ruby-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2.3.7
11 changes: 11 additions & 0 deletions example/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM ruby:2.3.7

WORKDIR /app
ADD . /app

RUN cd /app && \
bundle install

EXPOSE 4567

CMD ["ruby", "web.rb"]
7 changes: 7 additions & 0 deletions example/Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# frozen_string_literal: true

source "https://rubygems.org"

git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }

gem 'sinatra'
22 changes: 22 additions & 0 deletions example/Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
GEM
remote: https://rubygems.org/
specs:
mustermann (1.0.2)
rack (2.0.4)
rack-protection (2.0.1)
rack
sinatra (2.0.1)
mustermann (~> 1.0)
rack (~> 2.0)
rack-protection (= 2.0.1)
tilt (~> 2.0)
tilt (2.0.8)

PLATFORMS
ruby

DEPENDENCIES
sinatra

BUNDLED WITH
1.16.1
23 changes: 23 additions & 0 deletions example/manifests/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: dog-tinder
spec:
template:
metadata:
name: dog-tinder
labels:
service: dog-tinder
spec:
containers:
- name: dog-tinder-container
image: dog-tinder:example
resources:
requests:
cpu: 200m
env:
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
restartPolicy: Always
12 changes: 12 additions & 0 deletions example/manifests/horizontal-pod-autoscaler.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: autoscaling/v1
kind: HorizontalPodAutoscaler
metadata:
name: dog-tinder-hpa
spec:
maxReplicas: 10
minReplicas: 1
scaleTargetRef:
apiVersion: extensions/v1beta1
kind: Deployment
name: dog-tinder
targetCPUUtilizationPercentage: 50
17 changes: 17 additions & 0 deletions example/manifests/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
apiVersion: v1
kind: Service
metadata:
labels:
service: dog-tinder
name: dog-tinder-service
spec:
type: NodePort
ports:
- name: dog-tinder-port
port: 4000
protocol: TCP
targetPort: 4567
nodePort: 30000
selector:
service: dog-tinder

18 changes: 18 additions & 0 deletions example/web.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# frozen_string_literal: true

require 'sinatra'

set :bind, '0.0.0.0'

def find_match_for_dog
100.times do |i|
100000.downto(1) do |j|
Math.sqrt(j) * i / 0.2
end
end
end

get '/' do
find_match_for_dog
"Your dog's match was found by #{ENV['POD_NAME']}"
end
Binary file added kubernetes.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pods.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 45fadfa

Please sign in to comment.