Skip to content

Commit

Permalink
Merge pull request #26 from linkernetworks/phstsai/cadvisor
Browse files Browse the repository at this point in the history
DEV: Add cadvisor yaml, and modify other yamls
  • Loading branch information
John-Lin authored Jun 22, 2018
2 parents a36f188 + 71ad39a commit c1b0bfe
Show file tree
Hide file tree
Showing 6 changed files with 79 additions and 3 deletions.
19 changes: 19 additions & 0 deletions deploy/kubernetes/apps/monitoring/cadvisor/cadvisor-svc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
apiVersion: v1
kind: Service
metadata:
name: cadvisor
namespace: monitoring
labels:
name: cadvisor
annotations:
prometheus.io/scrape: 'true'
spec:
type: NodePort
ports:
- name: http-metrics
port: 8080
nodePort: 31194
targetPort: http-metrics
selector:
name: cadvisor

53 changes: 53 additions & 0 deletions deploy/kubernetes/apps/monitoring/cadvisor/cadvisor.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
apiVersion: extensions/v1beta1
kind: DaemonSet
metadata:
name: cadvisor
namespace: monitoring
spec:
selector:
matchLabels:
name: cadvisor
template:
metadata:
labels:
name: cadvisor
annotations:
prometheus.io.scrape: "true"
spec:
containers:
- name: cadvisor
image: google/cadvisor:latest
volumeMounts:
- name: rootfs
mountPath: /rootfs
readOnly: true
- name: var-run
mountPath: /var/run
readOnly: false
- name: sys
mountPath: /sys
readOnly: true
- name: docker
mountPath: /var/lib/docker
readOnly: true
ports:
- name: http-metrics
containerPort: 8080
protocol: TCP
args:
- --profiling
- --housekeeping_interval=1s
terminationGracePeriodSeconds: 30
volumes:
- name: rootfs
hostPath:
path: /
- name: var-run
hostPath:
path: /var/run
- name: sys
hostPath:
path: /sys
- name: docker
hostPath:
path: /var/lib/docker
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ spec:
metadata:
labels:
k8s-app: kube-state-metrics
annotations:
prometheus.io.scrape: "true"
spec:
serviceAccountName: default
containers:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ metadata:
name: node-exporter
labels:
app: node-exporter
annotations:
prometheus.io/scrape: 'true'
spec:
type: NodePort
ports:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ spec:
name: node-exporter
labels:
name: node-exporter
annotations:
prometheus.io.scrape: "true"
spec:
hostPID: true
containers:
Expand All @@ -20,3 +18,4 @@ spec:
privileged: true
ports:
- containerPort: 9100
hostNetwork: true
3 changes: 2 additions & 1 deletion developers/Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Vagrant.configure("2") do |config|
PROTOC_TARGET="${HOME}/protoc"
# Install ntp
sudo apt-get install ntp
sudo apt-get install -y ntp
# Install Docker
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
Expand Down Expand Up @@ -52,6 +52,7 @@ Vagrant.configure("2") do |config|
# setup golang dir
mkdir -p /home/$USER/go/src
rm -rf /home/$USER/go1.10.2.linux-amd64.tar.gz
# install protoc
if [ ! -d "${PROTOC_TARGET}" ]; then curl -fsSL "$PROTOC_RELEASE" > "${PROTOC_TARGET}.zip"; fi
if [ -f "${PROTOC_TARGET}.zip" ]; then unzip "${PROTOC_TARGET}.zip" -d "${PROTOC_TARGET}"; fi
Expand Down

0 comments on commit c1b0bfe

Please sign in to comment.