mirror of
https://github.com/emqx/neuron.git
synced 2026-10-29 15:09:11 +08:00
Merge pull request #628 from brianbinbin/feature/deploy-charts
Feature/deploy charts
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
name: Check helm version
|
||||
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- deploy/charts/neuron/templates/**
|
||||
pull_request:
|
||||
paths:
|
||||
- deploy/charts/neuron/templates/**
|
||||
|
||||
jobs:
|
||||
check-helm-version:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- run: minikube start
|
||||
- uses: actions/checkout@v2
|
||||
- name: Update helm
|
||||
run: |
|
||||
helm repo add emqx https://repos.emqx.io/charts
|
||||
helm repo update
|
||||
- name: Check helm version
|
||||
run: |
|
||||
old=$(helm show chart emqx/neuron |egrep "^version" | sed -r 's|^version:[[:space:]]([0-9]+.[0-9]+.[0-9]+)$|\1|g')
|
||||
now=$(egrep "^version" deploy/charts/neuron/Chart.yaml | sed -r 's|^version:[[:space:]]([0-9]+.[0-9]+.[0-9]+)$|\1|g')
|
||||
if [ "$old" = "$now" ];then
|
||||
echo "Need update version for Chart.yaml"
|
||||
exit 1
|
||||
fi
|
||||
@@ -0,0 +1,42 @@
|
||||
name: Release neuron
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- "*"
|
||||
|
||||
jobs:
|
||||
release:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Check appVersion for helm
|
||||
run: |
|
||||
appVersion=$(egrep "^appVersion" deploy/charts/neuron/Chart.yaml | sed -r 's|^appVersion:[[:space:]]([0-9]+.[0-9]+.[0-9]+)$|\1|g')
|
||||
if [ "$appVersion" != "${GITHUB_REF##*/}" ]; then
|
||||
echo "Need update appVersion for Chart.yaml"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
helm:
|
||||
runs-on: self-hosted
|
||||
if: github.repository_owner == 'emqx'
|
||||
needs:
|
||||
- release
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Check appVersion for helm
|
||||
working-directory: deploy/charts/neuron
|
||||
run: |
|
||||
appVersion=$(egrep "^appVersion" Chart.yaml | sed -r 's|^appVersion:[[:space:]]([0-9]+.[0-9]+.[0-9]+)$|\1|g')
|
||||
if [ "$appVersion" != "${GITHUB_REF##*/}" ]; then
|
||||
echo "Need update appVersion for Chart.yaml"
|
||||
exit 1
|
||||
fi
|
||||
- name: Create helm package
|
||||
working-directory: deploy/charts/neuron
|
||||
run: helm package .
|
||||
- name: Update helm repo
|
||||
run: |
|
||||
sudo mv $(find deploy/charts/neuron -name "*.tgz") /repos/charts
|
||||
sudo helm repo index /repos/charts
|
||||
@@ -0,0 +1,59 @@
|
||||
name: Test helm
|
||||
inputs:
|
||||
repository:
|
||||
description: "neuron image repository"
|
||||
required: true
|
||||
default: "emqx/neuron"
|
||||
tag:
|
||||
description: "neuron image tag"
|
||||
required: true
|
||||
default: "2.0.1"
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- "*"
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- run: minikube start --kubernetes-version="v1.23.0"
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-go@v2
|
||||
with:
|
||||
go-version: '1.18.3'
|
||||
- name: install kubebuilder
|
||||
run: |
|
||||
OS=$(uname -s | tr '[:upper:]' '[:lower:]')
|
||||
ARCH=$(uname -m | sed 's/x86_64/amd64/')
|
||||
curl -fsL "https://storage.googleapis.com/kubebuilder-tools/kubebuilder-tools-1.16.4-${OS}-${ARCH}.tar.gz" -o kubebuilder-tools
|
||||
tar -zxvf kubebuilder-tools
|
||||
sudo mv kubebuilder/ /usr/local/kubebuilder
|
||||
- run: make test
|
||||
|
||||
deployment:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- run: minikube start --kubernetes-version="v1.23.0"
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-go@v2
|
||||
with:
|
||||
go-version: '1.18.3'
|
||||
- name: Deploy neuron by helm
|
||||
shell: bash
|
||||
run: |
|
||||
helm install neuron deploy/charts/neuron\
|
||||
--set image.repository=${{ inputs.repository }} \
|
||||
--set image.tag=${{ inputs.tag }}
|
||||
- name: Check deployment
|
||||
run: |
|
||||
while [ "$(kubectl get Deployment -l app.kubernetes.io/name=neuron -o jsonpath='{.items[0].status.replicas}')" \
|
||||
!= "$(kubectl get Deployment -l app.kubernetes.io/name=neuron -o jsonpath='{.items[0].status.readyReplicas}')" ]; do
|
||||
echo "=============================="
|
||||
kubectl get pods
|
||||
echo "=============================="
|
||||
echo "waiting neuron started"
|
||||
sleep 10
|
||||
done
|
||||
@@ -16,3 +16,4 @@ tmp
|
||||
*.deb
|
||||
*.rpm
|
||||
neuron-sdk
|
||||
.vscode
|
||||
@@ -0,0 +1,24 @@
|
||||
apiVersion: v2
|
||||
name: neuron
|
||||
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: 1.0.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: "2.0.1"
|
||||
@@ -0,0 +1,69 @@
|
||||
# neuron
|
||||
|
||||
  
|
||||
|
||||
A Helm chart for Kubernetes
|
||||
|
||||
## Install the Chart
|
||||
|
||||
- From Github
|
||||
```
|
||||
git clone https://github.com/emqx/neuron.git
|
||||
cd deploy/charts/neuron
|
||||
helm install my-neuron .
|
||||
```
|
||||
|
||||
## Uninstall Chart
|
||||
```
|
||||
helm uninstall my-neuron
|
||||
```
|
||||
|
||||
## Values
|
||||
|
||||
| Key | Type | Default | Description |
|
||||
|-----|------|---------|-------------|
|
||||
| affinity | object | `{}` | |
|
||||
| autoscaling.enabled | bool | `false` | |
|
||||
| autoscaling.maxReplicas | int | `100` | |
|
||||
| autoscaling.minReplicas | int | `1` | |
|
||||
| autoscaling.targetCPUUtilizationPercentage | int | `80` | |
|
||||
| clusterDomain | string | `"cluster.local"` | Kubernetes Cluster Domain |
|
||||
| containerPorts | object | `{"api":7001,"web":7000}` | Container Ports |
|
||||
| containerPorts.api | int | `7001` | containerPorts.api |
|
||||
| containerPorts.web | int | `7000` | containerPorts.web |
|
||||
| fullnameOverride | string | `""` | |
|
||||
| hostPorts | object | `{"api":30371,"enabled":false,"web":30370}` | only for kubeedge deployment |
|
||||
| image.pullPolicy | string | `"IfNotPresent"` | |
|
||||
| image.repository | string | `"emqx/neuron"` | |
|
||||
| image.tag | string | `""` | Overrides the image tag whose default is the chart appVersion. |
|
||||
| imagePullSecrets | list | `[]` | |
|
||||
| ingress.annotations | object | `{}` | |
|
||||
| ingress.className | string | `""` | |
|
||||
| ingress.enabled | bool | `false` | |
|
||||
| ingress.hosts[0].host | string | `"chart-example.local"` | |
|
||||
| ingress.hosts[0].paths[0].path | string | `"/"` | |
|
||||
| ingress.hosts[0].paths[0].pathType | string | `"ImplementationSpecific"` | |
|
||||
| ingress.tls | list | `[]` | |
|
||||
| nameOverride | string | `""` | |
|
||||
| nodeSelector | object | `{}` | |
|
||||
| persistence.enabled | bool | `false` | |
|
||||
| persistence.existingClaim | string | `""` | Existing PersistentVolumeClaims The value is evaluated as a template So, for example, the name can depend on .Release or .Chart |
|
||||
| podAnnotations | object | `{}` | |
|
||||
| readinessProbe.enabled | bool | `true` | |
|
||||
| readinessProbe.initialDelaySeconds | int | `5` | |
|
||||
| readinessProbe.periodSeconds | int | `5` | |
|
||||
| resources | object | `{}` | |
|
||||
| service.annotations | object | `{}` | Provide any additional annotations which may be required. Evaluated as a template |
|
||||
| service.enabled | bool | `true` | |
|
||||
| service.loadBalancerSourceRanges | list | `[]` | loadBalancerSourceRanges: - 10.10.10.0/24 |
|
||||
| service.nodePorts | object | `{"api":null,"web":null}` | Specify the nodePort(s) value for the LoadBalancer and NodePort service types. ref: https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport |
|
||||
| service.ports | object | `{"api":{"name":"api","port":7001},"web":{"name":"web","port":7000}}` | Service ports |
|
||||
| service.ports.api.name | string | `"api"` | Neuron API port name |
|
||||
| service.ports.api.port | int | `7001` | Neuron API port |
|
||||
| service.ports.web.name | string | `"web"` | Neuron Dashboard port name |
|
||||
| service.ports.web.port | int | `7000` | Neuron Dashboard port |
|
||||
| service.type | string | `"ClusterIP"` | |
|
||||
| serviceAccount.annotations | object | `{}` | Annotations to add to the service account |
|
||||
| serviceAccount.create | bool | `true` | Specifies whether a service account should be created |
|
||||
| serviceAccount.name | string | `""` | The name of the service account to use. If not set and create is true, a name is generated using the fullname template |
|
||||
| tolerations | list | `[]` | |
|
||||
@@ -0,0 +1,69 @@
|
||||
{{/*
|
||||
Expand the name of the chart.
|
||||
*/}}
|
||||
{{- define "neuron.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 "neuron.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 "neuron.chart" -}}
|
||||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Common labels
|
||||
*/}}
|
||||
{{- define "neuron.labels" -}}
|
||||
helm.sh/chart: {{ include "neuron.chart" . }}
|
||||
{{ include "neuron.selectorLabels" . }}
|
||||
{{- if .Chart.AppVersion }}
|
||||
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
|
||||
{{- end }}
|
||||
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Selector labels
|
||||
*/}}
|
||||
{{- define "neuron.selectorLabels" -}}
|
||||
app.kubernetes.io/name: {{ include "neuron.name" . }}
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Create the name of the service account to use
|
||||
*/}}
|
||||
{{- define "neuron.serviceAccountName" -}}
|
||||
{{- if .Values.serviceAccount.create }}
|
||||
{{- default (include "neuron.fullname" .) .Values.serviceAccount.name }}
|
||||
{{- else }}
|
||||
{{- default "default" .Values.serviceAccount.name }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Get the TLS secret.
|
||||
*/}}
|
||||
{{- define "neuron.tlsSecretName" -}}
|
||||
{{- printf "%s-certs" (include "neuron.fullname" .) -}}
|
||||
{{- end -}}
|
||||
@@ -0,0 +1,87 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: {{ include "neuron.fullname" . }}
|
||||
namespace: {{ .Release.Namespace }}
|
||||
labels:
|
||||
{{- include "neuron.labels" . | nindent 4 }}
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
{{- include "neuron.selectorLabels" . | nindent 6 }}
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
{{- include "neuron.selectorLabels" . | nindent 8 }}
|
||||
spec:
|
||||
serviceAccountName: {{ include "neuron.serviceAccountName" . }}
|
||||
volumes:
|
||||
- name: neuron-persistence
|
||||
{{- if .Values.persistence.enabled }}
|
||||
persistentVolumeClaim:
|
||||
claimName: {{ (tpl .Values.persistence.existingClaim $) | default (include "neuron.fullname" .) }}
|
||||
{{- else }}
|
||||
emptyDir: {}
|
||||
{{- end }}
|
||||
{{- if .Values.tls.enabled }}
|
||||
- name: certs
|
||||
secret:
|
||||
secretName: {{ include "neuron.tlsSecretName" . }}
|
||||
items:
|
||||
- key: neuron.pem
|
||||
path: neuron.pem
|
||||
- key: neuron.key
|
||||
path: neuron.key
|
||||
{{- end}}
|
||||
containers:
|
||||
- name: neuron
|
||||
image: "{{ .Values.image.repository }}:{{ .Chart.AppVersion }}"
|
||||
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
||||
{{- if .Values.readinessProbe.enabled }}
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
port: {{ .Values.service.web | default 7000 }}
|
||||
initialDelaySeconds: 5
|
||||
periodSeconds: 5
|
||||
{{- end }}
|
||||
ports:
|
||||
- name: web
|
||||
containerPort: {{ .Values.containerPorts.web | default 7000 }}
|
||||
{{- if .Values.hostPorts.enabled }}
|
||||
hostPort: {{ .Values.hostPorts.web | default 7000 }}
|
||||
{{- end}}
|
||||
- name: api
|
||||
containerPort: {{ .Values.containerPorts.api | default 7001 }}
|
||||
{{- if .Values.hostPorts.enabled }}
|
||||
hostPort: {{ .Values.hostPorts.api | default 7001 }}
|
||||
{{- end}}
|
||||
volumeMounts:
|
||||
- name: neuron-persistence
|
||||
mountPath: "/opt/neuron/persistence"
|
||||
{{- if .Values.tls.enabled }}
|
||||
- name: certs
|
||||
mountPath: "/opt/neuron/config/neuron.pem"
|
||||
subPath: "neuron.pem"
|
||||
readOnly: true
|
||||
- name: certs
|
||||
mountPath: "/opt/neuron/config/neuron.key"
|
||||
subPath: "neuron.key"
|
||||
readOnly: true
|
||||
{{- end }}
|
||||
resources:
|
||||
{{- toYaml .Values.resources | nindent 12 }}
|
||||
{{- with .Values.nodeSelector }}
|
||||
nodeSelector:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with .Values.affinity }}
|
||||
affinity:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with .Values.tolerations }}
|
||||
tolerations:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
{{- if .Values.ingress.enabled -}}
|
||||
{{- $fullName := include "neuron.fullname" . -}}
|
||||
{{- $svcPort := .Values.service.port -}}
|
||||
{{- if and .Values.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }}
|
||||
{{- if not (hasKey .Values.ingress.annotations "kubernetes.io/ingress.class") }}
|
||||
{{- $_ := set .Values.ingress.annotations "kubernetes.io/ingress.class" .Values.ingress.className}}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}}
|
||||
apiVersion: networking.k8s.io/v1
|
||||
{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}}
|
||||
apiVersion: networking.k8s.io/v1beta1
|
||||
{{- else -}}
|
||||
apiVersion: extensions/v1beta1
|
||||
{{- end }}
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: {{ $fullName }}
|
||||
labels:
|
||||
{{- include "neuron.labels" . | nindent 4 }}
|
||||
{{- with .Values.ingress.annotations }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
{{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }}
|
||||
ingressClassName: {{ .Values.ingress.className }}
|
||||
{{- end }}
|
||||
{{- if .Values.ingress.tls }}
|
||||
tls:
|
||||
{{- range .Values.ingress.tls }}
|
||||
- hosts:
|
||||
{{- range .hosts }}
|
||||
- {{ . | quote }}
|
||||
{{- end }}
|
||||
secretName: {{ .secretName }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
rules:
|
||||
{{- range .Values.ingress.hosts }}
|
||||
- host: {{ .host | quote }}
|
||||
http:
|
||||
paths:
|
||||
{{- range .paths }}
|
||||
- path: {{ .path }}
|
||||
{{- if and .pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }}
|
||||
pathType: {{ .pathType }}
|
||||
{{- end }}
|
||||
backend:
|
||||
{{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }}
|
||||
service:
|
||||
name: {{ $fullName }}
|
||||
port:
|
||||
number: {{ $svcPort }}
|
||||
{{- else }}
|
||||
serviceName: {{ $fullName }}
|
||||
servicePort: {{ $svcPort }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,12 @@
|
||||
{{- if .Values.serviceAccount.create -}}
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
name: {{ include "neuron.serviceAccountName" . }}
|
||||
labels:
|
||||
{{- include "neuron.labels" . | nindent 4 }}
|
||||
{{- with .Values.serviceAccount.annotations }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,40 @@
|
||||
{{- if .Values.service.enabled }}
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ include "neuron.fullname" . }}
|
||||
namespace: {{ .Release.Namespace }}
|
||||
labels:
|
||||
{{- include "neuron.labels" . | nindent 4 }}
|
||||
spec:
|
||||
type: {{ .Values.service.type }}
|
||||
{{- if eq .Values.service.type "LoadBalancer" }}
|
||||
{{- if .Values.service.loadBalancerIP }}
|
||||
loadBalancerIP: {{ .Values.service.loadBalancerIP }}
|
||||
{{- end }}
|
||||
{{- if .Values.service.loadBalancerSourceRanges }}
|
||||
loadBalancerSourceRanges: {{- toYaml .Values.service.loadBalancerSourceRanges | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
ports:
|
||||
- name: {{ .Values.service.ports.web.name }}
|
||||
port: {{ .Values.service.ports.web.port | default 7000 }}
|
||||
protocol: TCP
|
||||
targetPort: web
|
||||
{{- if and (or (eq .Values.service.type "NodePort") (eq .Values.service.type "LoadBalancer")) (not (empty .Values.service.nodePorts.web)) }}
|
||||
nodePort: {{ .Values.service.nodePorts.web }}
|
||||
{{- else if eq .Values.service.type "ClusterIP" }}
|
||||
nodePort: null
|
||||
{{- end }}
|
||||
- name: {{ .Values.service.ports.api.name }}
|
||||
port: {{ .Values.service.ports.api.port | default 7001 }}
|
||||
protocol: TCP
|
||||
targetPort: api
|
||||
{{- if and (or (eq .Values.service.type "NodePort") (eq .Values.service.type "LoadBalancer")) (not (empty .Values.service.nodePorts.api)) }}
|
||||
nodePort: {{ .Values.service.nodePorts.api }}
|
||||
{{- else if eq .Values.service.type "ClusterIP" }}
|
||||
nodePort: null
|
||||
{{- end }}
|
||||
selector:
|
||||
{{- include "neuron.selectorLabels" . | nindent 4 }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,15 @@
|
||||
apiVersion: v1
|
||||
kind: Pod
|
||||
metadata:
|
||||
name: "{{ include "neuron.fullname" . }}-test-connection"
|
||||
labels:
|
||||
{{- include "neuron.labels" . | nindent 4 }}
|
||||
annotations:
|
||||
"helm.sh/hook": test
|
||||
spec:
|
||||
containers:
|
||||
- name: wget
|
||||
image: busybox
|
||||
command: ['wget']
|
||||
args: ['{{ include "neuron.fullname" . }}:{{ .Values.service.port }}']
|
||||
restartPolicy: Never
|
||||
@@ -0,0 +1,15 @@
|
||||
{{- if .Values.tls.enabled }}
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: {{ include "neuron.fullname" . }}-certs
|
||||
namespace: {{ .Release.Namespace }}
|
||||
labels:
|
||||
{{- include "neuron.labels" . | nindent 4 }}
|
||||
type: Opaque
|
||||
data:
|
||||
{{- if and .Values.tls.publicKey .Values.tls.privateKey }}
|
||||
neuron.pem: {{ required "A valid .Values.tls.publicKey entry required!" .Values.tls.publicKey | b64enc | quote }}
|
||||
neuron.key: {{ required "A valid .Values.tls.privateKey entry required!" .Values.tls.privateKey | b64enc | quote }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,191 @@
|
||||
# Default values for neuron.
|
||||
# This is a YAML-formatted file.
|
||||
# Declare variables to be passed into your templates.
|
||||
|
||||
|
||||
image:
|
||||
repository: emqx/neuron
|
||||
pullPolicy: IfNotPresent
|
||||
# -- Overrides the image tag whose default is the chart appVersion.
|
||||
tag: ""
|
||||
|
||||
imagePullSecrets: []
|
||||
nameOverride: ""
|
||||
fullnameOverride: ""
|
||||
|
||||
serviceAccount:
|
||||
# -- Specifies whether a service account should be created
|
||||
create: true
|
||||
# -- Annotations to add to the service account
|
||||
annotations: {}
|
||||
# -- The name of the service account to use.
|
||||
# If not set and create is true, a name is generated using the fullname template
|
||||
name: ""
|
||||
|
||||
podAnnotations: {}
|
||||
|
||||
# @ignored
|
||||
podSecurityContext: {}
|
||||
# fsGroup: 2000
|
||||
|
||||
# @ignored
|
||||
securityContext: {}
|
||||
# capabilities:
|
||||
# drop:
|
||||
# - ALL
|
||||
# readOnlyRootFilesystem: true
|
||||
# runAsNonRoot: true
|
||||
# runAsUser: 1000
|
||||
|
||||
service:
|
||||
enabled: true
|
||||
type: ClusterIP
|
||||
|
||||
# -- Service ports
|
||||
ports:
|
||||
web:
|
||||
# -- Neuron Dashboard port name
|
||||
name: "web"
|
||||
# -- Neuron Dashboard port
|
||||
port: 7000
|
||||
api:
|
||||
# -- Neuron API port name
|
||||
name: "api"
|
||||
# -- Neuron API port
|
||||
port: 7001
|
||||
|
||||
# -- Specify the nodePort(s) value for the LoadBalancer and NodePort service types.
|
||||
# ref: https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport
|
||||
nodePorts:
|
||||
web:
|
||||
api:
|
||||
## Set the LoadBalancer service type to internal only.
|
||||
## ref: https://kubernetes.io/docs/concepts/services-networking/service/#internal-load-balancer
|
||||
##
|
||||
# loadBalancerIP:
|
||||
## Load Balancer sources
|
||||
## ref: https://kubernetes.io/docs/tasks/access-application-cluster/configure-cloud-provider-firewall/#restrict-access-for-loadbalancer-service
|
||||
## Example:
|
||||
|
||||
# -- loadBalancerSourceRanges:
|
||||
# - 10.10.10.0/24
|
||||
#
|
||||
loadBalancerSourceRanges: []
|
||||
# -- Provide any additional annotations which may be required. Evaluated as a template
|
||||
annotations: {}
|
||||
|
||||
ingress:
|
||||
enabled: false
|
||||
className: ""
|
||||
annotations: {}
|
||||
# kubernetes.io/ingress.class: nginx
|
||||
# kubernetes.io/tls-acme: "true"
|
||||
hosts:
|
||||
- host: chart-example.local
|
||||
paths:
|
||||
- path: /
|
||||
pathType: ImplementationSpecific
|
||||
tls: []
|
||||
# - secretName: chart-example-tls
|
||||
# hosts:
|
||||
# - chart-example.local
|
||||
|
||||
|
||||
persistence:
|
||||
enabled: false
|
||||
# -- Existing PersistentVolumeClaims
|
||||
# The value is evaluated as a template
|
||||
# So, for example, the name can depend on .Release or .Chart
|
||||
existingClaim: ""
|
||||
|
||||
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
|
||||
|
||||
autoscaling:
|
||||
enabled: false
|
||||
minReplicas: 1
|
||||
maxReplicas: 100
|
||||
targetCPUUtilizationPercentage: 80
|
||||
# targetMemoryUtilizationPercentage: 80
|
||||
|
||||
nodeSelector: {}
|
||||
|
||||
tolerations: []
|
||||
|
||||
affinity: {}
|
||||
|
||||
# -- Kubernetes Cluster Domain
|
||||
clusterDomain: cluster.local
|
||||
|
||||
# @ignored
|
||||
tls:
|
||||
enabled: false
|
||||
# -- neuron public key
|
||||
publicKey: |
|
||||
-----BEGIN PUBLIC KEY-----
|
||||
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAzrO7FUz4GGKl4nP5lwKM
|
||||
h5uageJAAHnLZpVxTR1wXA9E870sU03gHnPWsh2bXCCx85ymYaiu/5VlptgnU0rQ
|
||||
B1I3xGRG8eHmHPrhHNWDRKpY6oY8AnTPqXvfa/Z4u+njJzDSqi4qM8Gwfqlgpjlg
|
||||
8DUF+sheLx8hL+x9XFzovTxafrmyJRRAVQTkhB7esKKqRF8BMjdOdYZxJEv9jxa0
|
||||
BwXcjprPDlj5TV6k3wJqbq4UtnEEVbjEQKqFVkfY4FuJ5NSPHpGEix94PGQGRsiW
|
||||
kGX0vx5udHJ0SlXM6qpMLny18FhWbwKNX3urc3mImn/j3zcJ5x1d+FlXAXs1NBSe
|
||||
TQIDAQAB
|
||||
-----END PUBLIC KEY-----
|
||||
# -- neuron private key
|
||||
privateKey: |
|
||||
-----BEGIN RSA PRIVATE KEY-----
|
||||
MIIEpAIBAAKCAQEAzrO7FUz4GGKl4nP5lwKMh5uageJAAHnLZpVxTR1wXA9E870s
|
||||
U03gHnPWsh2bXCCx85ymYaiu/5VlptgnU0rQB1I3xGRG8eHmHPrhHNWDRKpY6oY8
|
||||
AnTPqXvfa/Z4u+njJzDSqi4qM8Gwfqlgpjlg8DUF+sheLx8hL+x9XFzovTxafrmy
|
||||
JRRAVQTkhB7esKKqRF8BMjdOdYZxJEv9jxa0BwXcjprPDlj5TV6k3wJqbq4UtnEE
|
||||
VbjEQKqFVkfY4FuJ5NSPHpGEix94PGQGRsiWkGX0vx5udHJ0SlXM6qpMLny18FhW
|
||||
bwKNX3urc3mImn/j3zcJ5x1d+FlXAXs1NBSeTQIDAQABAoIBAQDJOT8PZXbAhohn
|
||||
A/AeimS0P08S0mbsD6VroGBEajxP4q2FeswD7PQZsTt4+kmcTlfuiLmQqN50AcSL
|
||||
wDHIbDRIbEnN7rECGKAj5jfwEgtQdWVKKpOQ8JaYr/a466BtjyuLo4PyGC8NY6mm
|
||||
JM3qBEHSlkvT7+uAhBWSye7gU7JfRPoCeFRpaMMC3Ad0DaIt/Pdt9CddNwj56+9j
|
||||
gl//blNnBImjvA7/kh9gL69SYVrQoG9vm/UgFbdIwd+w2hhhpx6kuHjRJ21xIV/y
|
||||
Yh9k4QhPr7zIkhQ8yn11ZhyZkMC8XAMy7NKCmAFIPNJ8jwvgBkunPEk2aYBeDUaq
|
||||
a30VwlIhAoGBAOnm8DW5DROcfSj4Q8zsvgmvhGM0zzF5zmA+4E+tEbf4t6sDUjSs
|
||||
ADo2EaiJZz75vLsD7UZHKzFEV/wnuT7SiNCbrJafx8Tp2UgijTkW8gEhAWREJDn5
|
||||
FS375RKFdEcpmVHWgsuz4z/0L3BGxmyYWQxx5pD2NL49ZpTIHAHm/XETAoGBAOI6
|
||||
8Y08TmM2bnXbL/MggYMJlqOyv27ueVYz9of3FYFAMIe7ebSgrlSCOwsoDZYmegBM
|
||||
OrowR3AAnoP4fjGNbIPjNYbiv1qLOdtnvPxYotEz+ZaUBSn9V/gUEVFlgrKxgTKr
|
||||
sqi/QMyyJplBTUkUuqYRDuv6TZ3OWKiDUoXTdv8fAoGBAIbbyf+PlESMY3Vtvtm2
|
||||
XdODyRbR6ewiyKShW/9UT/T8iBknrwwDZ5YoeoHrxwV+RBynpPRyMCsVto0B8kKQ
|
||||
bKWqPBYURb/4/Hgkw7v4yMtx1jWTPDfYryd2JptJKsOk7mtK/Nqp+wpypa9cfyc5
|
||||
p44PVdqauco96Jk7zzohjlrVAoGAfjQDrJaH5DDpTjYIeckYdtFSh9+fi3LdnYk/
|
||||
bnoYNRJqAE5Fhs5ccih0Z7TgX3L3fFMKL/Pe5kxyIYzuWRZcAvctVSIJPamNjShB
|
||||
9UQ9EBe+lJHej54VBP+s6YuHbcg4GtxNvnVy4L5Bah1T0AEQXrQFbv8jbXU/YEJi
|
||||
NuXQ7GECgYA0UNvuZxVSDn8fBxARcX3ub5aok5owdLL3SOCPMpNrmOBQj8iJGT+5
|
||||
nv7fH1TWVh9yUdRwhd81s5H/PO3/myLmgq0TcPvewtEEwY+++QpsYZwHTDXgxbbw
|
||||
++lmJali4fzmd/72JqocGABYhZFt0jbcQ1QEcqUYcD380+cNVZPO+w==
|
||||
-----END RSA PRIVATE KEY-----
|
||||
|
||||
|
||||
readinessProbe:
|
||||
enabled: true
|
||||
initialDelaySeconds: 5
|
||||
periodSeconds: 5
|
||||
|
||||
# -- Container Ports
|
||||
containerPorts:
|
||||
# -- containerPorts.web
|
||||
web: 7000
|
||||
# -- containerPorts.api
|
||||
api: 7001
|
||||
|
||||
# -- only for kubeedge deployment
|
||||
hostPorts:
|
||||
enabled: false
|
||||
web: 30370
|
||||
api: 30371
|
||||
|
||||
Reference in New Issue
Block a user