add helm chart

This commit is contained in:
Hongchao Deng
2021-08-12 11:13:41 +08:00
parent bf93bf5004
commit 9620fbbfca
5 changed files with 53 additions and 4 deletions
@@ -0,0 +1,20 @@
{{- if .Values.apiserver.enabled -}}
---
apiVersion: v1
kind: Service
metadata:
name: {{ template "kubevela.name" . }}-api
namespace: {{ .Release.Namespace }}
labels:
{{- include "kubevela.labels" . | nindent 4 }}
spec:
type: {{ .Values.service.type }}
ports:
- port: {{ .Values.apiserver.port }}
targetPort: {{ .Values.apiserver.port }}
protocol: TCP
name: api
selector:
{{- include "kubevela.selectorLabels" . | nindent 6 }}
{{- end }}
@@ -158,6 +158,24 @@ spec:
name: tls-cert-vol
readOnly: true
{{ end }}
{{- if .Values.apiserver.enabled -}}
- name: {{ .Release.Name }}-api
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
command:
- "apiserver"
args:
- "start"
- "--port={{ .Values.apiserver.port }}"
ports:
- containerPort: {{ .Values.apiserver.port }}
name: api
protocol: TCP
image: {{ .Values.image.repository }}:{{ .Values.image.tag }}
imagePullPolicy: {{ quote .Values.image.pullPolicy }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
{{ end }}
{{ if .Values.admissionWebhooks.enabled }}
volumes:
- name: tls-cert-vol
+12
View File
@@ -78,6 +78,18 @@ admissionWebhooks:
# If autoGenWorkloadDefinition is true, webhook will auto generated workloadDefinition which componentDefinition refers to
autoGenWorkloadDefinition: true
apiserver:
enabled: true
port: 8000
resources:
limits:
cpu: 500m
memory: 1Gi
requests:
cpu: 50m
memory: 20Mi
#Enable debug logs for development purpose
logDebug: false
+2 -2
View File
@@ -25,8 +25,8 @@ import (
func main() {
app := commands.NewCLI(
"velacp",
"KubeVela control plane",
"apiserver",
"KubeVela API Server",
)
app.AddCommands(
server.NewServerCommand(),
+1 -2
View File
@@ -34,14 +34,13 @@ func NewServerCommand() *cobra.Command {
s := &server{}
cmd := &cobra.Command{
Use: "apiserver",
Use: "start",
Short: "Start running apiserver.",
RunE: func(cmd *cobra.Command, args []string) error {
return s.run()
},
}
// rest
cmd.Flags().IntVar(&s.restCfg.Port, "port", 8000, "The port number used to serve the http APIs.")
return cmd