Skip to content

Commit

Permalink
Merge pull request #88 from linkernetworks/phstsai/helm
Browse files Browse the repository at this point in the history
VX-165 DEV: Initial the helm charts for vortex project
  • Loading branch information
Hung-Wei Chiu authored Jul 13, 2018
2 parents 8e02e46 + 17c7214 commit b4dd212
Show file tree
Hide file tree
Showing 55 changed files with 921 additions and 14 deletions.
5 changes: 5 additions & 0 deletions deploy/helm/apps/network-controller/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
apiVersion: v1
appVersion: "1.0"
description: A Helm chart for Kubernetes
name: network-controller
version: 0.1.0
37 changes: 37 additions & 0 deletions deploy/helm/apps/network-controller/templates/tcp-daemonset.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: network-controller-server-tcp
namespace: vortex
spec:
selector:
matchLabels:
name: network-controller-server-tcp
template:
metadata:
labels:
name: network-controller-server-tcp
spec:
tolerations:
- key: node-role.kubernetes.io/master
effect: NoSchedule
containers:
- name: network-controller-server-tcp
image: sdnvortex/network-controller:latest
securityContext:
privileged: true
command: ["/go/bin/server"]
args: ["-tcp=0.0.0.0:50051"]
volumeMounts:
- mountPath: /var/run/docker.sock
name: docker-sock
- mountPath: /var/run/openvswitch/db.sock
name: ovs-sock
volumes:
- name: docker-sock
hostPath:
path: /run/docker.sock
- name: ovs-sock
hostPath:
path: /run/openvswitch/db.sock
hostNetwork: true
48 changes: 48 additions & 0 deletions deploy/helm/apps/network-controller/templates/unix-daemonset.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: network-controller-server-unix
namespace: default
spec:
selector:
matchLabels:
name: network-controller-server-unix
template:
metadata:
labels:
name: network-controller-server-unix
spec:
tolerations:
- key: node-role.kubernetes.io/master
effect: NoSchedule
containers:
- name: network-controller-server-unix
image: sdnvortex/network-controller:latest
securityContext:
privileged: true
command: ["/go/bin/server"]
args: ["-unix=/tmp/vortex.sock", "-netlink-gc"]
volumeMounts:
- mountPath: /var/run/docker/netns:shared
name: docker-ns
#mountPropagation: Bidirectional
- mountPath: /var/run/docker.sock
name: docker-sock
- mountPath: /var/run/openvswitch/db.sock
name: ovs-sock
- mountPath: /tmp/
name: grpc-sock
volumes:
- name: docker-ns
hostPath:
path: /run/docker/netns
- name: docker-sock
hostPath:
path: /run/docker.sock
- name: ovs-sock
hostPath:
path: /run/openvswitch/db.sock
- name: grpc-sock
hostPath:
path: /tmp/vortex
hostNetwork: true
45 changes: 45 additions & 0 deletions deploy/helm/apps/network-controller/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Default values for network-controller.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.

replicaCount: 1

image:
repository: nginx
tag: stable
pullPolicy: IfNotPresent

service:
type: ClusterIP
port: 80

ingress:
enabled: false
annotations: {}
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
path: /
hosts:
- chart-example.local
tls: []
# - secretName: chart-example-tls
# hosts:
# - chart-example.local

resources: {}
# We usually recommend not to specify default resources and to leave this as a conscious
# choice for the user. This also increases chances charts run on environments with little
# resources, such as Minikube. If you do want to specify resources, uncomment the following
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
# limits:
# cpu: 100m
# memory: 128Mi
# requests:
# cpu: 100m
# memory: 128Mi

nodeSelector: {}

tolerations: []

affinity: {}
21 changes: 21 additions & 0 deletions deploy/helm/apps/prometheus/.helmignore
Original file line number Diff line number Diff line change
@@ -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
5 changes: 5 additions & 0 deletions deploy/helm/apps/prometheus/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
apiVersion: v1
appVersion: "1.0"
description: A Helm chart for Kubernetes
name: prometheus
version: 0.1.0
21 changes: 21 additions & 0 deletions deploy/helm/apps/prometheus/charts/cadvisor/.helmignore
Original file line number Diff line number Diff line change
@@ -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
5 changes: 5 additions & 0 deletions deploy/helm/apps/prometheus/charts/cadvisor/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
apiVersion: v1
appVersion: "1.0"
description: A Helm chart for Kubernetes
name: cadvisor
version: 0.1.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
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={{ .Values.config.housekeeping_interval }}
- --disable_metrics=disk
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
2 changes: 2 additions & 0 deletions deploy/helm/apps/prometheus/charts/cadvisor/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
config:
housekeeping_interval: 5s
21 changes: 21 additions & 0 deletions deploy/helm/apps/prometheus/charts/kube-state-metrics/.helmignore
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
apiVersion: v1
appVersion: "1.0"
description: A Helm chart for Kubernetes
name: kube-state-metrics
version: 0.1.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: rbac.authorization.k8s.io/v1
# kubernetes versions before 1.8.0 should use rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
metadata:
name: kube-state-metrics
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: kube-state-metrics
subjects:
- kind: ServiceAccount
name: default
namespace: monitoring

Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
apiVersion: rbac.authorization.k8s.io/v1
# kubernetes versions before 1.8.0 should use rbac.authorization.k8s.io/v1beta1
kind: ClusterRole
metadata:
name: kube-state-metrics
rules:
- apiGroups: [""]
resources:
- configmaps
- secrets
- nodes
- pods
- services
- resourcequotas
- replicationcontrollers
- limitranges
- persistentvolumeclaims
- persistentvolumes
- namespaces
- endpoints
verbs: ["list", "watch"]
- apiGroups: ["extensions"]
resources:
- daemonsets
- deployments
- replicasets
verbs: ["list", "watch"]
- apiGroups: ["apps"]
resources:
- statefulsets
verbs: ["list", "watch"]
- apiGroups: ["batch"]
resources:
- cronjobs
- jobs
verbs: ["list", "watch"]
- apiGroups: ["autoscaling"]
resources:
- horizontalpodautoscalers
verbs: ["list", "watch"]
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
apiVersion: apps/v1
# Kubernetes versions after 1.9.0 should use apps/v1
# Kubernetes versions before 1.8.0 should use apps/v1beta1 or extensions/v1beta1
kind: Deployment
metadata:
name: kube-state-metrics
namespace: monitoring
spec:
selector:
matchLabels:
k8s-app: kube-state-metrics
replicas: 1
template:
metadata:
labels:
k8s-app: kube-state-metrics
spec:
serviceAccountName: default
containers:
- name: kube-state-metrics
image: sdnvortex/kube-state-metrics:{{ .Values.image.tag }}
ports:
- name: http-metrics
containerPort: 8080
readinessProbe:
httpGet:
path: /healthz
port: 8080
initialDelaySeconds: 5
timeoutSeconds: 5
- name: addon-resizer
image: k8s.gcr.io/addon-resizer:1.7
resources:
limits:
cpu: 100m
memory: 30Mi
requests:
cpu: 100m
memory: 30Mi
env:
- name: MY_POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: MY_POD_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
command:
- /pod_nanny
- --container=kube-state-metrics
- --cpu=100m
- --extra-cpu=1m
- --memory=100Mi
- --extra-memory=2Mi
- --threshold=5
- --deployment=kube-state-metrics
Loading

0 comments on commit b4dd212

Please sign in to comment.