Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
d00cdf75
Commit
d00cdf75
authored
Jun 21, 2016
by
Jerzy Szczepkowski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Influxdb migrated to PetSet and PersistentVolumes.
Influxdb migrated to PetSet and PersistentVolumes.
parent
ecfd4aa1
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
90 additions
and
83 deletions
+90
-83
influxdb-claim.yaml
...er/addons/cluster-monitoring/influxdb/influxdb-claim.yaml
+15
-0
influxdb-grafana-petset.yaml
.../cluster-monitoring/influxdb/influxdb-grafana-petset.yaml
+5
-7
influxdb-pv.yaml
cluster/addons/cluster-monitoring/influxdb/influxdb-pv.yaml
+20
-0
configure-vm.sh
cluster/gce/configure-vm.sh
+1
-0
influxdb-grafana-controller.yaml
...ster-monitoring/influxdb/influxdb-grafana-controller.yaml
+0
-74
configure-helper.sh
cluster/gce/gci/configure-helper.sh
+6
-0
util.sh
cluster/gce/util.sh
+22
-0
kube-addon-manager.yaml
cluster/saltbase/salt/kube-addons/kube-addon-manager.yaml
+1
-1
monitoring.go
test/e2e/monitoring.go
+20
-1
No files found.
cluster/addons/cluster-monitoring/influxdb/influxdb-claim.yaml
0 → 100644
View file @
d00cdf75
kind
:
PersistentVolumeClaim
apiVersion
:
v1
metadata
:
name
:
influxdb-claim
namespace
:
kube-system
labels
:
kubernetes.io/cluster-service
:
"
true"
spec
:
accessModes
:
-
ReadWriteOnce
resources
:
requests
:
storage
:
10Gi
volumeName
:
influxdb-pv
cluster/addons/cluster-monitoring/influxdb/influxdb-grafana-
controller
.yaml
→
cluster/addons/cluster-monitoring/influxdb/influxdb-grafana-
petset
.yaml
View file @
d00cdf75
apiVersion
:
v
1
kind
:
ReplicationController
apiVersion
:
apps/v1alpha
1
kind
:
PetSet
metadata
:
name
:
monitoring-influxdb-grafana-v3
namespace
:
kube-system
...
...
@@ -9,9 +9,6 @@ metadata:
kubernetes.io/cluster-service
:
"
true"
spec
:
replicas
:
1
selector
:
k8s-app
:
influxGrafana
version
:
v3
template
:
metadata
:
labels
:
...
...
@@ -68,7 +65,8 @@ spec:
mountPath
:
/var
volumes
:
-
name
:
influxdb-persistent-storage
emptyDir
:
{}
persistentVolumeClaim
:
claimName
:
influxdb-claim
-
name
:
grafana-persistent-storage
emptyDir
:
{}
serviceName
:
monitoring-influxdb
cluster/addons/cluster-monitoring/influxdb/influxdb-pv.yaml
0 → 100644
View file @
d00cdf75
{
%
set pd_prefix = pillar.get('master_name'
,
'
'
) -%
}
{
%
set pd_name = pd_prefix + '-influxdb-pd') -%
}
kind
:
PersistentVolume
apiVersion
:
v1
metadata
:
name
:
influxdb-pv
namespace
:
kube-system
labels
:
kubernetes.io/cluster-service
:
"
true"
spec
:
capacity
:
storage
:
10Gi
accessModes
:
-
ReadWriteOnce
-
ReadOnlyMany
gcePersistentDisk
:
pdName
:
{{
pd_name
}}
fsType
:
ext4
persistentVolumeReclaimPolicy
:
Delete
cluster/gce/configure-vm.sh
View file @
d00cdf75
...
...
@@ -451,6 +451,7 @@ network_policy_provider: '$(echo "$NETWORK_POLICY_PROVIDER" | sed -e "s/'/''/g")
enable_manifest_url: '
$(
echo
"
${
ENABLE_MANIFEST_URL
:-}
"
|
sed
-e
"s/'/''/g"
)
'
manifest_url: '
$(
echo
"
${
MANIFEST_URL
:-}
"
|
sed
-e
"s/'/''/g"
)
'
manifest_url_header: '
$(
echo
"
${
MANIFEST_URL_HEADER
:-}
"
|
sed
-e
"s/'/''/g"
)
'
master_name: '
$(
echo
"
${
MASTER_NAME
:-}
"
|
sed
-e
"s/'/''/g"
)
'
num_nodes:
$(
echo
"
${
NUM_NODES
:-}
"
|
sed
-e
"s/'/''/g"
)
e2e_storage_test_environment: '
$(
echo
"
$E2E_STORAGE_TEST_ENVIRONMENT
"
|
sed
-e
"s/'/''/g"
)
'
kube_uid: '
$(
echo
"
${
KUBE_UID
}
"
|
sed
-e
"s/'/''/g"
)
'
...
...
cluster/gce/coreos/kube-manifests/addons/cluster-monitoring/influxdb/influxdb-grafana-controller.yaml
deleted
100644 → 0
View file @
ecfd4aa1
apiVersion
:
v1
kind
:
ReplicationController
metadata
:
name
:
monitoring-influxdb-grafana-v3
namespace
:
kube-system
labels
:
k8s-app
:
influxGrafana
version
:
v3
kubernetes.io/cluster-service
:
"
true"
spec
:
replicas
:
1
selector
:
k8s-app
:
influxGrafana
version
:
v3
template
:
metadata
:
labels
:
k8s-app
:
influxGrafana
version
:
v3
kubernetes.io/cluster-service
:
"
true"
spec
:
containers
:
-
image
:
gcr.io/google_containers/heapster_influxdb:v0.5
name
:
influxdb
resources
:
# keep request = limit to keep this container in guaranteed class
limits
:
cpu
:
100m
memory
:
500Mi
requests
:
cpu
:
100m
memory
:
500Mi
ports
:
-
containerPort
:
8083
-
containerPort
:
8086
volumeMounts
:
-
name
:
influxdb-persistent-storage
mountPath
:
/data
-
image
:
gcr.io/google_containers/heapster_grafana:v2.6.0-2
name
:
grafana
env
:
resources
:
# keep request = limit to keep this container in guaranteed class
limits
:
cpu
:
100m
memory
:
100Mi
requests
:
cpu
:
100m
memory
:
100Mi
env
:
# This variable is required to setup templates in Grafana.
-
name
:
INFLUXDB_SERVICE_URL
value
:
http://monitoring-influxdb:8086
# The following env variables are required to make Grafana accessible via
# the kubernetes api-server proxy. On production clusters, we recommend
# removing these env variables, setup auth for grafana, and expose the grafana
# service using a LoadBalancer or a public IP.
-
name
:
GF_AUTH_BASIC_ENABLED
value
:
"
false"
-
name
:
GF_AUTH_ANONYMOUS_ENABLED
value
:
"
true"
-
name
:
GF_AUTH_ANONYMOUS_ORG_ROLE
value
:
Admin
-
name
:
GF_SERVER_ROOT_URL
value
:
/api/v1/proxy/namespaces/kube-system/services/monitoring-grafana/
volumeMounts
:
-
name
:
grafana-persistent-storage
mountPath
:
/var
volumes
:
-
name
:
influxdb-persistent-storage
emptyDir
:
{}
-
name
:
grafana-persistent-storage
emptyDir
:
{}
cluster/gce/gci/configure-helper.sh
View file @
d00cdf75
...
...
@@ -821,6 +821,12 @@ function start-kube-addons {
sed
-i
-e
"s@{{ *nanny_memory *}}@
${
nanny_memory
}
@g"
"
${
controller_yaml
}
"
sed
-i
-e
"s@{{ *metrics_cpu_per_node *}}@
${
metrics_cpu_per_node
}
@g"
"
${
controller_yaml
}
"
fi
if
[[
"
${
ENABLE_CLUSTER_MONITORING
:-}
"
==
"influxdb"
]]
;
then
pv_yaml
=
"
${
dst_dir
}
/
${
file_dir
}
/influxdb-pv.yaml"
pd_name
=
"
${
INSTANCE_PREFIX
}
-influxdb-pd"
remove-salt-config-comments
"
${
pv_yaml
}
"
sed
-i
-e
"s@{{ *pd_name *}}@
${
pd_name
}
@g"
"
${
pv_yaml
}
"
fi
if
[[
"
${
ENABLE_CLUSTER_DNS
:-}
"
==
"true"
]]
;
then
setup-addon-manifests
"addons"
"dns"
local
-r
dns_rc_file
=
"
${
dst_dir
}
/dns/skydns-rc.yaml"
...
...
cluster/gce/util.sh
View file @
d00cdf75
...
...
@@ -693,6 +693,14 @@ function create-master() {
--size
"
${
CLUSTER_REGISTRY_DISK_SIZE
}
"
&
fi
# Create disk for influxdb if enabled
if
[[
"
${
ENABLE_CLUSTER_MONITORING
:-}
"
==
"influxdb"
]]
;
then
gcloud compute disks create
"
${
INSTANCE_PREFIX
}
-influxdb-pd"
\
--project
"
${
PROJECT
}
"
\
--zone
"
${
ZONE
}
"
\
--size
"10GiB"
&
fi
# Generate a bearer token for this cluster. We push this separately
# from the other cluster variables so that the client (this
# computer) can forget it later. This should disappear with
...
...
@@ -1076,6 +1084,15 @@ function kube-down {
"
${
MASTER_NAME
}
-ip"
fi
# Delete persistent disk for influx-db.
if
gcloud compute disks describe
"
${
INSTANCE_PREFIX
}
"
-influxdb-pd
--zone
"
${
ZONE
}
"
--project
"
${
PROJECT
}
"
&>/dev/null
;
then
gcloud compute disks delete
\
--project
"
${
PROJECT
}
"
\
--quiet
\
--zone
"
${
ZONE
}
"
\
"
${
INSTANCE_PREFIX
}
"
-influxdb-pd
fi
export
CONTEXT
=
"
${
PROJECT
}
_
${
INSTANCE_PREFIX
}
"
clear-kubeconfig
set
-e
...
...
@@ -1132,6 +1149,11 @@ function check-resources {
return
1
fi
if
gcloud compute disks describe
--project
"
${
PROJECT
}
"
"
${
INSTANCE_PREFIX
}
-influxdb-pd"
--zone
"
${
ZONE
}
"
&>/dev/null
;
then
KUBE_RESOURCE_FOUND
=
"Persistent disk
${
INSTANCE_PREFIX
}
-influxdb-pd"
return
1
fi
# Find out what minions are running.
local
-a
minions
minions
=(
$(
gcloud compute instances list
\
...
...
cluster/saltbase/salt/kube-addons/kube-addon-manager.yaml
View file @
d00cdf75
...
...
@@ -10,7 +10,7 @@ spec:
hostNetwork
:
true
containers
:
-
name
:
kube-addon-manager
image
:
gcr.io/google-containers/kube-addon-manager:v
4
image
:
gcr.io/google-containers/kube-addon-manager:v
5
resources
:
requests
:
cpu
:
5m
...
...
test/e2e/monitoring.go
View file @
d00cdf75
...
...
@@ -110,7 +110,11 @@ func verifyExpectedRcsExistAndGetExpectedPods(c *client.Client) ([]string, error
if
err
!=
nil
{
return
nil
,
err
}
if
(
len
(
rcList
.
Items
)
+
len
(
deploymentList
.
Items
))
!=
1
{
psList
,
err
:=
c
.
Apps
()
.
PetSets
(
api
.
NamespaceSystem
)
.
List
(
options
)
if
err
!=
nil
{
return
nil
,
err
}
if
(
len
(
rcList
.
Items
)
+
len
(
deploymentList
.
Items
)
+
len
(
psList
.
Items
))
!=
1
{
return
nil
,
fmt
.
Errorf
(
"expected to find one replica for RC or deployment with label %s but got %d"
,
rcLabel
,
len
(
rcList
.
Items
))
}
...
...
@@ -144,6 +148,21 @@ func verifyExpectedRcsExistAndGetExpectedPods(c *client.Client) ([]string, error
expectedPods
=
append
(
expectedPods
,
string
(
pod
.
UID
))
}
}
// And for pet sets.
for
_
,
ps
:=
range
psList
.
Items
{
selector
:=
labels
.
Set
(
ps
.
Spec
.
Selector
.
MatchLabels
)
.
AsSelector
()
options
:=
api
.
ListOptions
{
LabelSelector
:
selector
}
podList
,
err
:=
c
.
Pods
(
api
.
NamespaceSystem
)
.
List
(
options
)
if
err
!=
nil
{
return
nil
,
err
}
for
_
,
pod
:=
range
podList
.
Items
{
if
pod
.
DeletionTimestamp
!=
nil
{
continue
}
expectedPods
=
append
(
expectedPods
,
string
(
pod
.
UID
))
}
}
}
return
expectedPods
,
nil
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment