Skip to content

Commit 9ea7ae8

Browse files
author
wlanboy
committed
Helm Chart
1 parent 03315ba commit 9ea7ae8

File tree

9 files changed

+176
-0
lines changed

9 files changed

+176
-0
lines changed

webshell-chart/Chart.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
apiVersion: v2
2+
name: webshell
3+
description: Webshell deployment with Istio Gateway and cert-manager
4+
type: application
5+
version: 0.1.0
6+
appVersion: "latest"

webshell-chart/readme.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
```bash
2+
helm install webshell . -n shells --create-namespace
3+
```
4+
5+
```bash
6+
kubectl get secret webshell-tls -n istio-ingress
7+
kubectl get gateway,virtualservice -n shells
8+
```
9+
10+
```bash
11+
helm upgrade webshell . -n shells
12+
```
13+
14+
```bash
15+
helm uninstall webshell -n shells
16+
```
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{{- if .Values.certManager.enabled }}
2+
apiVersion: cert-manager.io/v1
3+
kind: Certificate
4+
metadata:
5+
name: {{ .Values.istio.tls.secretName }}
6+
namespace: {{ .Values.istio.gatewayNamespace}}
7+
spec:
8+
secretName: {{ .Values.istio.tls.secretName }}
9+
issuerRef:
10+
name: {{ .Values.certManager.issuerRef.name }}
11+
kind: {{ .Values.certManager.issuerRef.kind }}
12+
dnsNames:
13+
{{- range .Values.certManager.dnsNames }}
14+
- {{ . }}
15+
{{- end }}
16+
privateKey:
17+
rotationPolicy: Always
18+
{{- end }}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: webshell
5+
spec:
6+
replicas: {{ .Values.replicaCount }}
7+
selector:
8+
matchLabels:
9+
app: webshell
10+
template:
11+
metadata:
12+
labels:
13+
app: webshell
14+
sidecar.istio.io/inject: "true"
15+
spec:
16+
containers:
17+
- name: webshell
18+
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
19+
imagePullPolicy: {{ .Values.image.pullPolicy }}
20+
ports:
21+
- containerPort: {{ .Values.service.targetPort }}
22+
volumeMounts:
23+
- name: tmp-volume
24+
mountPath: {{ .Values.volume.mountPath }}
25+
volumes:
26+
- name: tmp-volume
27+
persistentVolumeClaim:
28+
claimName: {{ .Values.pvc.name }}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
apiVersion: networking.istio.io/v1beta1
2+
kind: Gateway
3+
metadata:
4+
name: {{ .Values.istio.gatewayName }}
5+
spec:
6+
selector:
7+
istio: ingressgateway
8+
servers:
9+
- port:
10+
number: 443
11+
name: https
12+
protocol: HTTPS
13+
hosts:
14+
- {{ .Values.istio.host }}
15+
tls:
16+
mode: SIMPLE
17+
credentialName: {{ .Values.istio.tls.secretName }}
18+
- port:
19+
number: 80
20+
name: http
21+
protocol: HTTP
22+
hosts:
23+
- {{ .Values.istio.host }}

webshell-chart/templates/pvc.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{{- if .Values.pvc.enabled }}
2+
apiVersion: v1
3+
kind: PersistentVolumeClaim
4+
metadata:
5+
name: {{ .Values.pvc.name }}
6+
spec:
7+
accessModes: {{ toJson .Values.pvc.accessModes }}
8+
{{- if .Values.pvc.storageClassName }}
9+
storageClassName: {{ .Values.pvc.storageClassName }}
10+
{{- end }}
11+
resources:
12+
requests:
13+
storage: {{ .Values.pvc.size }}
14+
{{- end }}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
name: {{ .Values.service.name }}
5+
spec:
6+
type: {{ .Values.service.type }}
7+
selector:
8+
app: webshell
9+
ports:
10+
- name: http
11+
port: {{ .Values.service.port }}
12+
targetPort: {{ .Values.service.targetPort }}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
apiVersion: networking.istio.io/v1beta1
2+
kind: VirtualService
3+
metadata:
4+
name: webshell-vs
5+
spec:
6+
hosts:
7+
- {{ .Values.istio.host }}
8+
exportTo:
9+
- "."
10+
- istio-ingress
11+
- istio-system
12+
gateways:
13+
- {{ .Values.istio.gatewayName }}
14+
- mesh
15+
http:
16+
- route:
17+
- destination:
18+
host: {{ .Values.service.name }}
19+
port:
20+
number: {{ .Values.service.port }}

webshell-chart/values.yaml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
image:
2+
repository: wlanboy/webshell
3+
tag: latest
4+
pullPolicy: IfNotPresent
5+
6+
replicaCount: 1
7+
8+
service:
9+
name: webshell-svc
10+
type: ClusterIP
11+
port: 8080
12+
targetPort: 8001
13+
14+
pvc:
15+
enabled: true
16+
name: webshell-tmp-pvc
17+
accessModes:
18+
- ReadWriteOnce
19+
storageClassName: ""
20+
size: "100Mi"
21+
22+
volume:
23+
mountPath: /tmp
24+
25+
istio:
26+
gatewayName: webshell-gw
27+
gatewayNamespace: "istio-ingress"
28+
host: webshell.tp.lan
29+
tls:
30+
enabled: true
31+
secretName: webshell-tls
32+
33+
certManager:
34+
enabled: true
35+
issuerRef:
36+
kind: ClusterIssuer
37+
name: "local-ca-issuer"
38+
dnsNames:
39+
- webshell.tp.lan

0 commit comments

Comments
 (0)