Skip to content

Commit 24185b2

Browse files
author
TimeBye
committed
[云原生应用大赛] SVN-iF.SVNAdmin Chart
1 parent a6db132 commit 24185b2

File tree

12 files changed

+507
-0
lines changed

12 files changed

+507
-0
lines changed

submitted/svn-ifsvnadmin/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
charts/*
2+
requirements.lock

submitted/svn-ifsvnadmin/.helmignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
docs/*
2+
.git/*
3+
.gitignore
4+
CONTRIBUTING.md

submitted/svn-ifsvnadmin/Chart.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: svn-ifsvnadmin
2+
version: 0.1.0
3+
appVersion: passwd
4+
description: iF.SVNAdmin. It's a web interface for subversion repositories and users management.
5+
keywords:
6+
- svn
7+
- iF.SVNAdmin
8+
home: http://svnadmin.insanefactory.com/
9+
icon: http://tortoisesvn.net/assets/img/logo-256x256.png
10+
sources:
11+
- http://svnadmin.insanefactory.com/
12+
- https://github.com/mfreiholz/iF.SVNAdmin
13+
maintainers:
14+
- name: TimeBye
15+

submitted/svn-ifsvnadmin/README.md

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
# Helm Chart for svn
2+
3+
## Introduction
4+
5+
This [iF.SVNAdmin](http://svnadmin.insanefactory.com/) chart installs [timebye/svn-ifsvnadmin](https://github.com/TimeBye/svn-ifsvnadmin) in a Kubernetes cluster.
6+
7+
## Prerequisites
8+
9+
- Kubernetes cluster 1.10+
10+
- Helm 2.8.0+
11+
12+
## Installation
13+
14+
### Download the chart
15+
16+
Download Gitlab helm chart code.
17+
18+
```bash
19+
git clone https://github.com/cloudnativeapp/charts.git
20+
```
21+
22+
Checkout the tag.
23+
24+
```bash
25+
git checkout tag_name
26+
cd submitted/docker-gitlab
27+
```
28+
29+
### Configure the chart
30+
31+
The following items can be configured in `values.yaml` or set via `--set` flag during installation.
32+
33+
#### Configure the way how to expose svn service:
34+
35+
- **Ingress**: The ingress controller must be installed in the Kubernetes cluster.
36+
- **ClusterIP**: Exposes the service on a cluster-internal IP. Choosing this value makes the service only reachable from within the cluster.
37+
- **NodePort**: Exposes the service on each Node’s IP at a static port (the NodePort). You’ll be able to contact the NodePort service, from outside the cluster, by requesting `NodeIP:NodePort`.
38+
- **LoadBalancer**: Exposes the service externally using a cloud provider’s load balancer.
39+
40+
#### Configure the way how to persistent data:
41+
42+
- **Disable**: The data does not survive the termination of a pod.
43+
- **Persistent Volume Claim(default)**: A default `StorageClass` is needed in the Kubernetes cluster to dynamic provision the volumes. Specify another StorageClass in the `storageClass` or set `existingClaim` if you have already existing persistent volumes to use.
44+
45+
#### Configure the other items listed in [configuration](#configuration) section.
46+
47+
### Install the chart
48+
49+
Install the svn helm chart with a release name `my-svn`:
50+
51+
```bash
52+
# helm v2
53+
helm install . \
54+
--name my-svn \
55+
--set expose.ingress.host=svn.cluster.local
56+
57+
# helm v3
58+
helm install my-svn . \
59+
--set expose.ingress.host=svn.cluster.local
60+
```
61+
62+
## Uninstallation
63+
64+
To uninstall/delete the `my-svn` deployment:
65+
66+
```bash
67+
# helm v2
68+
helm delete --purge my-svn
69+
70+
# helm v3
71+
helm uninstall my-svn
72+
```
73+
74+
## Configuration
75+
76+
The following table lists the configurable parameters of the svn chart and the default values.
77+
78+
| Parameter | Description | Default |
79+
| ---------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------- |
80+
| **SVN** | | |
81+
| `replicaCount` | Number of desired pods. This is a pointer to distinguish between explicit zero and not specified. | `1` |
82+
| `strategy` | The deployment strategy to use to replace existing pods with new ones. | `RollingUpdate`-`maxUnavailable: 0` |
83+
| `image.repository` | Repository for svn image | `quay.azk8s.cn/setzero/svn-ifsvnadmin` |
84+
| `image.tag` | Tag for svn image | `passwd` |
85+
| `image.pullPolicy` | The image pull policy | `IfNotPresent` |
86+
| `annotations` | Annotations to add to the svn deployment | `{}` |
87+
| `podAnnotations` | Annotations to add to the svn pod | `{}` |
88+
| `resources` | The [resources] to allocate for container | undefined |
89+
| `nodeSelector` | Node labels for pod assignment | `{}` |
90+
| `tolerations` | Tolerations for pod assignment | `[]` |
91+
| `affinity` | Node/Pod affinities | `{}` |
92+
| `env` | The [available options] that can be used to customize your svn installation. | `{}` |
93+
| **Expose** | | |
94+
| `expose.type` | The way how to expose the service: `ingress``clusterIP``loadBalancer` or `nodePort` | `ingress` |
95+
| `expose.tls.enabled` | Enable the tls or not | `false` |
96+
| `expose.tls.secretName` | Fill the name of secret if you want to use your own TLS certificate. The secret must contain keys named:`tls.crt` - the certificate, `tls.key` - the private key, `ca.crt` - the certificate of CA.These files will be generated automatically if the `secretName` is not set | |
97+
| `expose.tls.certExpiry` | Automatically generated self-signed certificate validity period(day) | `3650` |
98+
| `expose.ingress.host` | The host of svn service in ingress rule | `svn.cluster.local` |
99+
| `expose.ingress.annotations` | The annotations used in ingress | |
100+
| `expose.clusterIP.name` | The name of ClusterIP service | `Release.Name` |
101+
| `expose.clusterIP.port` | The service port svn listens on when serving with HTTP | `80` |
102+
| `expose.nodePort.name` | The name of NodePort service | `Release.Name` |
103+
| `expose.nodePort.port` | The service port svn listens on when serving with HTTP | `80` |
104+
| `expose.nodePort.nodePort` | The node port svn listens on when serving with HTTP | |
105+
| `expose.loadBalancer.name` | The name of LoadBalancer service | `Release.Name` |
106+
| `expose.loadBalancer.port` | The service port svnÎ listens on when serving with HTTP | `80` |
107+
| **Persistence** | | |
108+
| `persistence.enabled` | Enable the data persistence or not | `false` |
109+
| `persistence.resourcePolicy` | Setting it to `keep` to avoid removing PVCs during a helm delete operation. Leaving it empty will delete PVCs after the chart deleted | `keep` |
110+
| `persistence.existingClaim` | Use the existing PVC which must be created manually before bound, and specify the `subPath` if the PVC is shared with other components | |
111+
| `persistence.storageClass` | Specify the `storageClass` used to provision the volume. Or the default StorageClass will be used(the default). Set it to `-` to disable dynamic provisioning | |
112+
| `persistence.accessMode` | The access mode of the volume | `ReadWriteMany` |
113+
| `persistence.size` | The size of the volume | `5Gi` |
114+
115+
[resources]: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/
116+
[available options]: https://github.com/TimeBye/svn-ifsvnadmin
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
Please wait for several minutes for svn deployment to complete.
2+
Then you should be able to visit the svn portal at:
3+
{{ if eq .Values.expose.type "ingress" }}
4+
{{if .Values.expose.tls.enabled }}https{{ else }}http{{ end }}://{{ .Values.expose.ingress.host }}
5+
{{ else if eq .Values.expose.type "clusterIP" }}
6+
# Execute the following command to route the connection:
7+
echo http://127.0.0.1:{{ .Values.expose.clusterIP.port }}/
8+
kubectl port-forward svc/{{ include "svn.fullname" . }} --namespace {{ .Release.Namespace }} {{ .Values.expose.clusterIP.port }}
9+
{{ else if eq .Values.expose.type "nodePort" }}
10+
# Execute the following command to route the connection:
11+
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" svc {{ include "svn.fullname" . }})
12+
export NODE_IP=$(kubectl get nodes -o jsonpath="{.items[0].status.addresses[0].address}")
13+
echo http://$NODE_IP:$NODE_PORT/
14+
{{ else if eq .Values.expose.type "loadBalancer" }}
15+
**** NOTE: It may take a few minutes for the LoadBalancer IP to be available. ****
16+
**** You can watch the status of by running 'kubectl get svc -w {{ include "svn.fullname" . }}' ****
17+
export SERVICE_IP=$(kubectl get svc {{ include "svn.fullname" . }} --namespace {{ .Release.Namespace }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
18+
echo http://$SERVICE_IP:{{ .Values.expose.loadBalancer.port }}/
19+
{{ end }}
20+
For more details, please visit https://hub.docker.com/r/sonatype/svn.
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{{/* vim: set filetype=mustache: */}}
2+
{{/*
3+
Expand the name of the chart.
4+
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
5+
*/}}
6+
{{- define "svn.name" -}}
7+
{{- default "svn" .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
8+
{{- end -}}
9+
10+
{{/*
11+
Create a default fully qualified app name.
12+
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
13+
*/}}
14+
{{- define "svn.fullname" -}}
15+
{{- $name := default "svn" .Values.nameOverride -}}
16+
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
17+
{{- end -}}
18+
19+
{{/* Helm required labels */}}
20+
{{- define "svn.labels.standard" -}}
21+
heritage: {{ .Release.Service }}
22+
release: {{ .Release.Name }}
23+
chart: {{ .Chart.Name }}
24+
app: "{{ include "svn.name" . }}"
25+
{{- end -}}
26+
27+
{{/* matchLabels */}}
28+
{{- define "svn.labels.matchLabels" -}}
29+
release: {{ .Release.Name }}
30+
app: "{{ include "svn.name" . }}"
31+
{{- end -}}
32+
33+
{{- define "svn.autoGenCert" -}}
34+
{{- if and .Values.expose.tls.enabled (not .Values.expose.tls.secretName) -}}
35+
{{- printf "true" -}}
36+
{{- else -}}
37+
{{- printf "false" -}}
38+
{{- end -}}
39+
{{- end -}}

0 commit comments

Comments
 (0)