on kube 1.9, if run “helm install” any package, will give error like “no available release name found”, the following cmd fixes it.

kubectl create serviceaccount --namespace kube-system tiller
kubectl create clusterrolebinding tiller-cluster-rule --clusterrole=cluster-admin --serviceaccount=kube-system:tiller
kubectl patch deploy --namespace kube-system tiller-deploy -p '{"spec":{"template":{"spec":{"serviceAccount":"tiller"}}}}'

you can customize helm chart by modify default chart parameters, using helm inspect stable/mysql can show you parameters allowed to be changed. Simply pick up the parameters you’d like to change and save them into mariadb.yaml. ==Don’t copy the entire downloaded parameter list, it won’t work. Only change content after —, only values after — are counted.==

then issue helm install stable/mariadb -f mariadb.yaml --namespace wow -n mariadb to install on namespace.

create a local pv with storageclass standard:

apiVersion: v1
  kind: PersistentVolume
  metadata:
    name: local-pv-1
    labels:
      type: local
  spec:
    capacity:
      storage: 5Gi
    accessModes:
      - ReadWriteOnce
    persistentVolumeReclaimPolicy: Recycle
    storageClassName: standard
    hostPath: 
      path: /tmp/data/pv-1

create a local storageclass standard

kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
  name: standard
provisioner: kubernetes.io/no-provisioner
volumeBindingMode: WaitForFirstConsumer

this will consume pv of which have storageclassname field as standard.

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
 name: mypvc
 namespace: default
spec:
 accessModes:
 - ReadWriteOnce
 resources:
   requests:
     storage: 10Gi
 storageClassName: standard

Storageclass is like a pool of volumes, like cinder’s volume type in openstack.

create a new role-binding for serviceaccount

kube create clusterrolebinding --serviceaccount=default:exposecontroller expose-rule --clusterrole=cluster-admin

Deploy pod on master

put following lines in chart’s values.yaml:

nodeSelector:
  kubernetes.io/hostname: k8s-master

tolerations:
  - effect: NoSchedule
    key: node-role.kubernetes.io/master

and this in deployment.yaml:

  spec
    {{- with .Values.nodeSelector }}
      nodeSelector:
{{ toYaml . | indent 8 }}
    {{- end }}
    {{- with .Values.tolerations }}
      tolerations:
{{ toYaml . | indent 8 }}
    {{- end }}