-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add helm charts * update README
- Loading branch information
Showing
7 changed files
with
215 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# 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 | ||
*.orig | ||
*~ | ||
# Various IDEs | ||
.project | ||
.idea/ | ||
*.tmproj | ||
.vscode/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
apiVersion: v2 | ||
name: linux-command | ||
description: A Helm chart for Kubernetes | ||
# A chart can be either an 'application' or a 'library' chart. | ||
# | ||
# Application charts are a collection of templates that can be packaged into versioned archives | ||
# to be deployed. | ||
# | ||
# Library charts provide useful utilities or functions for the chart developer. They're included as | ||
# a dependency of application charts to inject those utilities and functions into the rendering | ||
# pipeline. Library charts do not define any templates and therefore cannot be deployed. | ||
type: application | ||
# This is the chart version. This version number should be incremented each time you make changes | ||
# to the chart and its templates, including the app version. | ||
# Versions are expected to follow Semantic Versioning (https://semver.org/) | ||
version: 0.1.0 | ||
# This is the version number of the application being deployed. This version number should be | ||
# incremented each time you make changes to the application. Versions are not expected to | ||
# follow Semantic Versioning. They should reflect the version the application is using. | ||
# It is recommended to use it with quotes. | ||
appVersion: "0.1.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# linux-command | ||
|
||
linux-command 的 Helm 图表。该图表使用 Helm 软件包管理器在 Kubernetes 集群上引导部署 linux-command。 | ||
|
||
## 安装 Chart | ||
|
||
``` | ||
$ helm install linux-command ./linux-command --namespace linux-command --create-namespace | ||
``` | ||
|
||
## 卸载 Chart | ||
|
||
``` | ||
$ helm -n linux-command uninstall linux-command | ||
``` | ||
|
||
这会删除与图表相关的所有 Kubernetes 组件,并删除发布。 | ||
|
||
## 配置参数 | ||
|
||
下表列出了 linux-command 图表的可配置参数及其默认值。 | ||
|
||
| Key | Type | Default | Description | | ||
| ------------------------------------------------------------ | ------ | ------------------------- | ----------- | | ||
| linuxCommand.linuxCommandContainer.image.repository | string | `"wcjiang/linux-command"` | | | ||
| linuxCommand.linuxCommandContainer.image.tag | string | `"latest"` | | | ||
| linuxCommand.linuxCommandContainer.imagePullPolicy | string | `"IfNotPresent"` | | | ||
| linuxCommand.linuxCommandContainer.resources.limits.cpu | string | `"100m"` | | | ||
| linuxCommand.linuxCommandContainer.resources.limits.memory | string | `"50Mi"` | | | ||
| linuxCommand.linuxCommandContainer.resources.requests.cpu | string | `"100m"` | | | ||
| linuxCommand.linuxCommandContainer.resources.requests.memory | string | `"50Mi"` | | | ||
| linuxCommand.replicas | int | `1` | | | ||
| service.ports[0].port | int | `9665` | | | ||
| service.ports[0].protocol | string | `"TCP"` | | | ||
| service.ports[0].targetPort | int | `3000` | | | ||
| service.type | string | `"NodePort"` | | | ||
|
||
使用`-set key=value[,key=value]`参数为`helm install`指定每个参数。 | ||
|
||
或者,也可以在安装图表时提供指定参数值的 YAML 文件。例如 | ||
|
||
``` | ||
helm install <release-name> -f values.yaml ./linux-command | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
{{/* | ||
Expand the name of the chart. | ||
*/}} | ||
{{- define "linux-command.name" -}} | ||
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create a default fully qualified app name. | ||
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). | ||
If release name contains chart name it will be used as a full name. | ||
*/}} | ||
{{- define "linux-command.fullname" -}} | ||
{{- if .Values.fullnameOverride }} | ||
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} | ||
{{- else }} | ||
{{- $name := default .Chart.Name .Values.nameOverride }} | ||
{{- if contains $name .Release.Name }} | ||
{{- .Release.Name | trunc 63 | trimSuffix "-" }} | ||
{{- else }} | ||
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
{{- end }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create chart name and version as used by the chart label. | ||
*/}} | ||
{{- define "linux-command.chart" -}} | ||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
|
||
{{/* | ||
Common labels | ||
*/}} | ||
{{- define "linux-command.labels" -}} | ||
helm.sh/chart: {{ include "linux-command.chart" . }} | ||
{{ include "linux-command.selectorLabels" . }} | ||
{{- if .Chart.AppVersion }} | ||
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} | ||
{{- end }} | ||
app.kubernetes.io/managed-by: {{ .Release.Service }} | ||
{{- end }} | ||
|
||
{{/* | ||
Selector labels | ||
*/}} | ||
{{- define "linux-command.selectorLabels" -}} | ||
app.kubernetes.io/name: {{ include "linux-command.name" . }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create the name of the service account to use | ||
*/}} | ||
{{- define "linux-command.serviceAccountName" -}} | ||
{{- if .Values.serviceAccount.create }} | ||
{{- default (include "linux-command.fullname" .) .Values.serviceAccount.name }} | ||
{{- else }} | ||
{{- default "default" .Values.serviceAccount.name }} | ||
{{- end }} | ||
{{- end }} |
32 changes: 32 additions & 0 deletions
32
deploy/helm/charts/linux-command/templates/deployment.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: {{ include "linux-command.fullname" . }}-linux-command | ||
labels: | ||
app: linux-command | ||
{{- include "linux-command.labels" . | nindent 4 }} | ||
spec: | ||
replicas: {{ .Values.linuxCommand.replicas }} | ||
selector: | ||
matchLabels: | ||
app: linux-command | ||
{{- include "linux-command.selectorLabels" . | nindent 6 }} | ||
template: | ||
metadata: | ||
labels: | ||
app: linux-command | ||
{{- include "linux-command.selectorLabels" . | nindent 8 }} | ||
spec: | ||
containers: | ||
- env: | ||
- name: KUBERNETES_CLUSTER_DOMAIN | ||
value: {{ quote .Values.kubernetesClusterDomain }} | ||
image: {{ .Values.linuxCommand.linuxCommandContainer.image.repository }}:{{ .Values.linuxCommand.linuxCommandContainer.image.tag | ||
| default .Chart.AppVersion }} | ||
imagePullPolicy: {{ .Values.linuxCommand.linuxCommandContainer.imagePullPolicy | ||
}} | ||
name: linux-command-container | ||
ports: | ||
- containerPort: 3000 | ||
resources: {{- toYaml .Values.linuxCommand.linuxCommandContainer.resources | nindent | ||
10 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: {{ include "linux-command.fullname" . }}-service | ||
labels: | ||
{{- include "linux-command.labels" . | nindent 4 }} | ||
spec: | ||
type: {{ .Values.service.type }} | ||
selector: | ||
app: linux-command | ||
{{- include "linux-command.selectorLabels" . | nindent 4 }} | ||
ports: | ||
{{- .Values.service.ports | toYaml | nindent 2 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
linuxCommand: | ||
linuxCommandContainer: | ||
image: | ||
repository: wcjiang/linux-command | ||
tag: latest | ||
imagePullPolicy: IfNotPresent | ||
resources: | ||
limits: | ||
cpu: 100m | ||
memory: 50Mi | ||
requests: | ||
cpu: 100m | ||
memory: 50Mi | ||
replicas: 1 | ||
service: | ||
ports: | ||
- port: 9665 | ||
protocol: TCP | ||
targetPort: 3000 | ||
type: NodePort |