Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
kubernetes
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cloud
bundles
kubernetes
Commits
2a3607e7
Commit
2a3607e7
authored
7 years ago
by
Giuseppe Attardi
Browse files
Options
Downloads
Patches
Plain Diff
Added autoscaler.
parent
81d90958
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
README.md
+48
-1
48 additions, 1 deletion
README.md
bundle.yaml
+101
-25
101 additions, 25 deletions
bundle.yaml
loadgenerator.yaml
+15
-0
15 additions, 0 deletions
loadgenerator.yaml
with
164 additions
and
26 deletions
README.md
+
48
−
1
View file @
2a3607e7
...
...
@@ -5,7 +5,7 @@
## Overview
This is a
scaled-out
Kubernetes cluster composed of the following components and features:
This is a
n autoscale
Kubernetes cluster composed of the following components and features:
-
Kubernetes (automated deployment, operations, and scaling)
-
Kubernetes cluster with one master and three worker nodes.
...
...
@@ -19,6 +19,12 @@ This is a scaled-out Kubernetes cluster composed of the following components and
to the requesting units of the cluster.
-
Etcd (distributed key value store)
-
Three node cluster for reliability.
-
CharmScaler
-
allows scaling the number of k8 nodes according to the CPU loads.
-
Telegraf
-
colletcs usage data.
-
Inflixdb
-
stores series data on the use of resources.
# Usage
...
...
@@ -520,6 +526,7 @@ documentation for more information.
-
[
Official Bundle
](
https://api.jujucharms.com/charmstore/v5/canonical-kubernetes/archive/bundle.yaml
)
-
[
Bundle Source
](
https://github.com/juju-solutions/bundle-canonical-kubernetes
)
-
[
Bug tracker
](
https://github.com/juju-solutions/bundle-canonical-kubernetes/issues
)
-
[
Autoscaled Kubernetes Bundle
](
https://jujucharms.com/u/elastisys/autoscaled-kubernetes/bundle/0
)
# Flannel
...
...
@@ -554,3 +561,43 @@ on `Juju 2.0+` controllers.
-
[
Flannel Charm Resource
](
https://jujucharms.com/u/containers/flannel/
)
-
[
Flannel Homepage
](
https://coreos.com/flannel/docs/latest/flannel-config.html
)
# Autoscaling
Configure the CharmScaler to give it access to the Juju model.
*
For more details on the CharmScaler setup process,
[
read this
](
https://github.com/elastisys/layer-charmscaler#quickstart
)
*
Minimal config.yaml example:
charmscaler:
juju_api_endpoint: "[API address]:17070"
juju_model_uuid: "[uuid]"
juju_username: "[username]"
juju_password: "[password]"
Apply the configuration
juju config charmscaler --file config.yaml
Wait for the deployment to settle
watch -c juju status --color
Fetch the Kubernetes config and the
`kubectl`
binary
mkdir ~/.kube
juju scp kubernetes-master/0:config ~/.kube/config
juju scp kubernetes-master/0:kubectl ./kubectl
Make sure things are running
./kubectl cluster-info
./kubectl get nodes
-----------------------
For more details read the documentation of the
[
Kubernetes core bundle
](
https://jujucharms.com/kubernetes-core/
)
and the
[
CharmScaler
](
https://jujucharms.com/u/elastisys/charmscaler/
)
.
\ No newline at end of file
This diff is collapsed.
Click to expand it.
bundle.yaml
+
101
−
25
View file @
2a3607e7
...
...
@@ -2,11 +2,24 @@
# The server nodes to be used should be tagged as kubernetes.
# At least one of them should also be tagged as ip-pub, to denote a machine configured with
# a public IP.
# The server nodes with GPUs should be tagged as gpu.
##
series
:
xenial
description
:
A nine-machine Kubernetes cluster, appropriate for production. Includes a three-machine etcd cluster and three Kubernetes worker nodes.
# ----------------------------------------------------------------------
machines
:
"
0"
:
series
:
xenial
constraints
:
"
tags=kubernetes"
"
1"
:
series
:
xenial
constraints
:
"
tags=kubernetes"
"
2"
:
series
:
xenial
constraints
:
"
tags=kubernetes"
# ----------------------------------------------------------------------
services
:
...
...
@@ -17,6 +30,34 @@ services:
charm
:
cs:~containers/easyrsa
num_units
:
1
constraints
:
tags=kubernetes
to
:
-
"
lxd:charmscaler/0"
charmscaler
:
charm
:
"
cs:~elastisys/charmscaler-5"
num_units
:
1
annotations
:
gui-x
:
"
400"
gui-y
:
"
600"
to
:
-
"
0"
telegraf
:
charm
:
"
cs:telegraf"
annotations
:
gui-x
:
"
170"
gui-y
:
"
600"
to
:
-
"
0"
influxdb
:
charm
:
"
cs:~chris.macnaughton/influxdb-6"
num_units
:
1
annotations
:
gui-x
:
"
100"
gui-y
:
"
700"
to
:
-
"
0"
etcd
:
annotations
:
...
...
@@ -25,12 +66,18 @@ services:
charm
:
cs:~containers/etcd
num_units
:
3
constraints
:
tags=kubernetes
to
:
-
"
0"
-
"
1"
-
"
2"
flannel
:
annotations
:
gui-x
:
'
450'
gui-y
:
'
750'
charm
:
cs:~containers/flannel
to
:
-
"
0"
kubeapi-load-balancer
:
annotations
:
...
...
@@ -40,16 +87,21 @@ services:
expose
:
true
num_units
:
1
constraints
:
tags=kubernetes
to
:
-
"
1"
kubernetes-master
:
annotations
:
gui-x
:
'
800'
gui-y
:
'
850'
charm
:
cs:~containers/kubernetes-master
# charm: "cs:~tvansteenburgh/kubernetes-master"
num_units
:
1
constraints
:
tags=kubernetes,ip-pub
options
:
channel
:
1.8/stable
to
:
-
"
1"
kubernetes-worker
:
annotations
:
...
...
@@ -62,30 +114,54 @@ services:
options
:
channel
:
1.8/stable
# kubernetes-worker-gpu:
# charm: "cs:~tvansteenburgh/kubernetes-worker"
# num_units: 1
# expose: true
# annotations:
# gui-x: "520"
# gui-y": "226"
# constraints: cores=4 mem=4G tags=kubernetes,gpu
# ----------------------------------------------------------------------
relations
:
-
-
kubernetes-master:kube-api-endpoint
-
kubeapi-load-balancer:apiserver
-
-
kubernetes-master:loadbalancer
-
kubeapi-load-balancer:loadbalancer
-
-
kubernetes-master:kube-control
-
kubernetes-worker:kube-control
-
-
kubernetes-master:certificates
-
easyrsa:client
-
-
etcd:certificates
-
easyrsa:client
-
-
kubernetes-master:etcd
-
etcd:db
-
-
kubernetes-worker:certificates
-
easyrsa:client
-
-
kubernetes-worker:kube-api-endpoint
-
kubeapi-load-balancer:website
-
-
kubeapi-load-balancer:certificates
-
easyrsa:client
-
-
flannel:etcd
-
etcd:db
-
-
flannel:cni
-
kubernetes-master:cni
-
-
flannel:cni
-
kubernetes-worker:cni
# - [ "kubernetes-master:ceph-storage", "ceph-mon:admin" ]
-
-
kubernetes-master:kube-api-endpoint
-
kubeapi-load-balancer:apiserver
-
-
kubernetes-master:loadbalancer
-
kubeapi-load-balancer:loadbalancer
-
-
kubernetes-master:kube-control
-
kubernetes-worker:kube-control
-
-
kubernetes-master:certificates
-
easyrsa:client
-
-
etcd:certificates
-
easyrsa:client
-
-
kubernetes-master:etcd
-
etcd:db
-
-
kubernetes-worker:certificates
-
easyrsa:client
-
-
kubernetes-worker:kube-api-endpoint
-
kubeapi-load-balancer:website
-
-
kubeapi-load-balancer:certificates
-
easyrsa:client
-
-
flannel:etcd
-
etcd:db
-
-
flannel:cni
-
kubernetes-master:cni
-
-
flannel:cni
-
kubernetes-worker:cni
-
-
"
charmscaler:db-api"
-
"
influxdb:api"
-
-
"
telegraf:influxdb-api"
-
"
influxdb:api"
-
-
"
charmscaler:scalable-charm"
-
"
kubernetes-worker:juju-info"
# - [ "kubernetes-master:ceph-storage", "ceph-mon:admin" ]
# - - "kubernetes-worker-gpu:cni"
# - "flannel:cni"
# - - "kubernetes-worker-gpu:certificates"
# - "easyrsa:client"
# - - "kubernetes-master:kube-control"
# - "kubernetes-worker-gpu:kube-control"
# - - "kubernetes-master:kube-api-endpoint"
# - "kubernetes-worker-gpu:kube-api-endpoint"
This diff is collapsed.
Click to expand it.
loadgenerator.yaml
0 → 100644
+
15
−
0
View file @
2a3607e7
apiVersion
:
v1
kind
:
ReplicationController
metadata
:
name
:
loadgenerator
spec
:
replicas
:
1
template
:
metadata
:
labels
:
app
:
stress
spec
:
containers
:
-
name
:
stress
image
:
elastisys/stress
imagePullPolicy
:
IfNotPresent
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment