Microservice Deployment - yibinericxia/documents GitHub Wiki

Helm

Helm is a management tool for Kubernetes packages which hold charts to create instances of Kubernetes applications to run microservices.

Helm chart is a collection of files that describe Kubernetes rresource relationship for deployment. Its file directory structure normally contains Chart.yaml, values.yaml and the templates/ directory for templates used for Kubernetes manifest file generation with values.yaml.

The sample Chart.yaml is below:

apiVersion: API_version
name: chart_name
version: SemVer_2_version
description: simple_sentence
dependencies:
,,,

The values.yaml contains the default values for template files under templates/. A sample template deployment.yaml is as follows:

apiVersion: 
kind: Deployment
metadata:
  name "{{ .Release.Name }}"
spec:
  replicas: {{ .Values.replica }}"
  template:
    metadata:
      labels:
        key: {{ .Release.Name }}
    spec:
      containers:
        - name: name_string
          image: "{{ .Values.image }}:{{ .Values.tag }}
          imagePullPolicy: {{ .Values.pullPolicy }}
          ports:
            - containerPorrt: {{ .Values.service.internalPort }}
          env:
            - name: BUILD_ENV_ID
              value: "{{ .Values.timestamp }}"
...

and the values.yaml

image: image_host/app
tag: latest
pullPolicy: Always
service:
  internalPort: 8123
...

Verification

If docker container is used, we can access the it via "kubectl exec -it podName -n namespaceName -- /bin/sh" and do some basic checks, such as OS version, server configurations, etc

cat /etc/os-release

Please refer to the Design Considerations for more details.