Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ISSUE-2988][Bug] Update helm template, fix streampark on k8s failed #2990

Merged
merged 5 commits into from
Aug 29, 2023
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions deploy/helm/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Deploy StreamPark on k8s

### 1. create template

```shell
helm template streampark/ -n default -f streampark/values.yaml --output-dir ./result
```

### 2. apply

```shell
kubectl apply -f result/streampark/templates
```

### 3. open WebUI

http://streampark.apache.org/streampark
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WebUI error, prompt the user to open the browser based on the actual URL.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you are right


#### [more detail](streampark/templates/NOTES.txt)
20 changes: 12 additions & 8 deletions deploy/helm/streampark/templates/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,27 @@
# limitations under the License.
#
{{- if .Values.ingress.enabled }}
apiVersion: networking.k8s.io/v1beta1
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ include "streampark.name" . }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "streampark.labels" . | nindent 4 }}
annotations:
nginx.ingress.kubernetes.io/configuration-snippet: {{ .Values.nginx.ingress.kubernetes.configurationSnippet }}
nginx.ingress.kubernetes.io/proxy-body-size: {{ .Values.nginx.ingress.kubernetes.proxyBbodySize }}
nginx.ingress.kubernetes.io/rewrite-target: {{ .Values.nginx.ingress.kubernetes.rewriteTarget }}
{{- with .Values.ingress.annotations }}
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
rules:
- host: {{ .Values.ingress.host }}
http:
paths:
- backend:
serviceName: {{ .Values.service.name }}
servicePort: {{ .Values.spec.name }}
path: {{ .Values.ingress.path }}
- backend:
service:
name: {{ .Values.service.name }}
port:
name: {{ .Values.spec.name }}
path: {{ .Values.ingress.path }}
pathType: {{ .Values.ingress.pathType }}
{{- end }}
19 changes: 7 additions & 12 deletions deploy/helm/streampark/templates/streampark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ metadata:
labels:
{{- include "streampark.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.replicaCount}}
replicas: {{ .Values.spec.replicaCount }}
selector:
matchLabels:
{{- include "streampark.selectorLabels" . | nindent 6 }}
Expand Down Expand Up @@ -57,11 +57,10 @@ spec:
containerPort: {{ .Values.spec.containerPort }}
protocol: TCP
env:
- name: TZ
value: {{ .Values.timezone }}
{{- toYaml .Values.spec.container.env | nindent 12 }}
securityContext:
privileged: false
command: ["bash","-c","bash bin/startup.sh"]
command: ["bash","-c","bash ./bin/streampark.sh start_docker"]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good job

{{- if .Values.spec.livenessProbe.enabled }}
livenessProbe:
exec:
Expand All @@ -83,11 +82,10 @@ spec:
failureThreshold: {{ .Values.spec.readinessProbe.failureThreshold }}
{{- end }}
volumeMounts:
- name: volume-docker
mountPath: /var/run/docker.sock
readOnly: true
- name: streampark-default-config-volume
mountPath: /streampark/conf
mountPath: /usr/local/service/streampark/conf
resources:
{{- toYaml .Values.spec.resources | nindent 12 }}
volumes:
- name: streampark-default-config-volume
configMap:
Expand All @@ -109,9 +107,6 @@ spec:
path: spy.properties
- key: ValidationMessages.properties
path: ValidationMessages.properties
- name: volume-docker
hostPath:
path: /var/run/docker.sock
type: ""



60 changes: 47 additions & 13 deletions deploy/helm/streampark/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,40 @@
# When enabled RBAC is only created for said namespaces, otherwise it is done for the cluster scope.
# watchNamespaces: ["streampark"]

timezone: "Asia/Shanghai"

image:
repository: "apache/streampark"
pullPolicy: "IfNotPresent"
tag: "2.2.0-SNAPSHOT"
tag: "2.1.1"
pullSecret: ""

rbac:
create: true

spec:
container:
env: [
{
name: TZ,
value: "Asia/Shanghai"
},
{
name: DOCKER_HOST,
value: "tcp://localhost:2375"
},
{
name: LANG,
value: en_US.UTF-8
},
{
name: LANGUAGE,
value: en_US:en
},
{
name: LC_ALL,
value: en_US.UTF-8
}
]

replicaCount: 1
containerPort: 10000
name: rest
Expand All @@ -42,7 +64,17 @@ spec:
tolerations: [ ]
## Affinity is a group of affinity scheduling rules. If specified, the pod's scheduling constraints.
## More info: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.17/#affinity-v1-core
resources: { }
resources: {
limits: {
memory: "1Gi",
cpu: "1"
},
requests: {
memory: "1Gi",
cpu: "1"
}
}

# resources:
# limits:
# memory: "2Gi"
Expand Down Expand Up @@ -72,10 +104,18 @@ spec:
successThreshold: "1"

ingress:
enabled: false
enabled: true
host: "streampark.apache.org"
path: "/streampark"
annotations: {}
path: "/streampark(/|$)(.*)"
pathType: "ImplementationSpecific"
annotations: {
nginx.ingress.kubernetes.io/rewrite-target: "/$2",
nginx.ingress.kubernetes.io/proxy-body-size: "1024m",
## fix swagger 404: https://github.com/springdoc/springdoc-openapi/issues/1741
## add rewrite ^/v3/(.*)$ /streampark/v3/$1 redirect;
nginx.ingress.kubernetes.io/configuration-snippet: 'rewrite ^(/streampark)$ $1/ permanent;',
kubernetes.io/ingress.class: "nginx"
}

service:
## type determines how the Service is exposed. Defaults to ClusterIP. Valid options are ExternalName, ClusterIP, NodePort, and LoadBalancer
Expand All @@ -96,9 +136,3 @@ streamParkServiceAccount:
annotations: {}
name: "streampark"

nginx:
ingress:
kubernetes:
configurationSnippet: "rewrite ^(/streampark)$ $1/ permanent;"
proxyBbodySize: "1024m"
rewriteTarget: "/$2"
Original file line number Diff line number Diff line change
Expand Up @@ -622,11 +622,12 @@ main() {
echo_r "Unknown command: $1"
echo_w "Usage: streampark.sh ( commands ... )"
echo_w "commands:"
echo_w " start \$conf Start StreamPark with application config."
echo_w " start \$conf Start StreamPark with application config."
echo_w " stop Stop StreamPark, wait up to 3 seconds and then use kill -KILL if still running"
echo_w " start_docker start in docker or k8s mode"
echo_w " status StreamPark status"
echo_w " debug StreamPark start with debug mode,start debug mode, like: bash streampark.sh debug 10002"
echo_w " restart \$conf restart StreamPark with application config."
echo_w " restart \$conf restart StreamPark with application config."
exit 0
;;
esac
Expand Down
Loading