Skip to content

Commit af3a0cc

Browse files
committed
Update netsoc/webspaced charts (1c7b7431)
1 parent 9f23571 commit af3a0cc

15 files changed

+600
-0
lines changed

charts/webspaced/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/values-test*.yaml

charts/webspaced/.helmignore

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Patterns to ignore when building packages.
2+
# This supports shell glob matching, relative path matching, and
3+
# negation (prefixed with !). Only one pattern per line.
4+
.DS_Store
5+
# Common VCS dirs
6+
.git/
7+
.gitignore
8+
.bzr/
9+
.bzrignore
10+
.hg/
11+
.hgignore
12+
.svn/
13+
# Common backup files
14+
*.swp
15+
*.bak
16+
*.tmp
17+
*.orig
18+
*~
19+
# Various IDEs
20+
.project
21+
.idea/
22+
*.tmproj
23+
.vscode/

charts/webspaced/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: webspaced
3+
description: Microservice for managing containerised webspaces
4+
type: application
5+
version: 0.2.7
6+
appVersion: 0.5.0

charts/webspaced/templates/NOTES.txt

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
1. Get the application URL by running these commands:
2+
{{- if .Values.ingress.enabled }}
3+
{{- range $host := .Values.ingress.hosts }}
4+
{{- range .paths }}
5+
http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ . }}
6+
{{- end }}
7+
{{- end }}
8+
{{- else if contains "NodePort" .Values.service.type }}
9+
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "webspaced.fullname" . }})
10+
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
11+
echo http://$NODE_IP:$NODE_PORT
12+
{{- else if contains "LoadBalancer" .Values.service.type }}
13+
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
14+
You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "webspaced.fullname" . }}'
15+
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "webspaced.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
16+
echo http://$SERVICE_IP:{{ .Values.service.port }}
17+
{{- else if contains "ClusterIP" .Values.service.type }}
18+
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "webspaced.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
19+
echo "Visit http://127.0.0.1:8080 to use your application"
20+
kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:80
21+
{{- end }}
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
{{/*
2+
Expand the name of the chart.
3+
*/}}
4+
{{- define "webspaced.name" -}}
5+
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
6+
{{- end }}
7+
8+
{{/*
9+
Create a default fully qualified app name.
10+
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
11+
If release name contains chart name it will be used as a full name.
12+
*/}}
13+
{{- define "webspaced.fullname" -}}
14+
{{- if .Values.fullnameOverride }}
15+
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
16+
{{- else }}
17+
{{- $name := default .Chart.Name .Values.nameOverride }}
18+
{{- if contains $name .Release.Name }}
19+
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
20+
{{- else }}
21+
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
22+
{{- end }}
23+
{{- end }}
24+
{{- end }}
25+
26+
{{/*
27+
Create chart name and version as used by the chart label.
28+
*/}}
29+
{{- define "webspaced.chart" -}}
30+
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
31+
{{- end }}
32+
33+
{{/*
34+
Common labels
35+
*/}}
36+
{{- define "webspaced.labels" -}}
37+
helm.sh/chart: {{ include "webspaced.chart" . }}
38+
{{ include "webspaced.selectorLabels" . }}
39+
{{- if .Chart.AppVersion }}
40+
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
41+
{{- end }}
42+
app.kubernetes.io/managed-by: {{ .Release.Service }}
43+
{{- end }}
44+
45+
{{/*
46+
Selector labels
47+
*/}}
48+
{{- define "webspaced.selectorLabels" -}}
49+
app.kubernetes.io/name: {{ include "webspaced.name" . }}
50+
app.kubernetes.io/instance: {{ .Release.Name }}
51+
{{- end }}
52+
53+
{{/*
54+
Create the name of the service account to use
55+
*/}}
56+
{{- define "webspaced.serviceAccountName" -}}
57+
{{- include "webspaced.fullname" . }}
58+
{{- end }}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{{- if not .Values.global.kubelan.externalConfigMap }}
2+
apiVersion: v1
3+
kind: ConfigMap
4+
metadata:
5+
name: {{ include "webspaced.fullname" . }}-kubelan
6+
labels:
7+
{{- include "webspaced.labels" . | nindent 4 }}
8+
data:
9+
kubelan.yaml: |
10+
log_level: {{ .Values.global.kubelan.log_level }}
11+
services:
12+
- {{ include "webspaced.fullname" . }}
13+
{{- range $s := .Values.global.kubelan.extraServices }}
14+
- {{ $s }}
15+
{{- end }}
16+
{{- with .Values.global.kubelan.vxlan }}
17+
vxlan:
18+
{{- toYaml . | nindent 6 }}
19+
{{- end }}
20+
{{- with .Values.global.kubelan.hooks }}
21+
hooks:
22+
{{- toYaml . | nindent 6 }}
23+
{{- end }}
24+
{{- end }}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
apiVersion: v1
2+
kind: ConfigMap
3+
metadata:
4+
name: {{ include "webspaced.fullname" . }}
5+
labels:
6+
{{- include "webspaced.labels" . | nindent 4 }}
7+
data:
8+
{{- with .Values.config }}
9+
webspaced.yaml: |
10+
{{- toYaml . | nindent 4 }}
11+
{{- end }}
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
{{- if .Values.ingress.enabled -}}
2+
{{- $fullName := include "webspaced.fullname" . -}}
3+
{{- if and .Values.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }}
4+
{{- if not (hasKey .Values.ingress.annotations "kubernetes.io/ingress.class") }}
5+
{{- $_ := set .Values.ingress.annotations "kubernetes.io/ingress.class" .Values.ingress.className}}
6+
{{- end }}
7+
{{- end }}
8+
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}}
9+
apiVersion: networking.k8s.io/v1
10+
{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}}
11+
apiVersion: networking.k8s.io/v1beta1
12+
{{- else -}}
13+
apiVersion: extensions/v1beta1
14+
{{- end }}
15+
kind: Ingress
16+
metadata:
17+
name: {{ $fullName }}
18+
labels:
19+
{{- include "webspaced.labels" . | nindent 4 }}
20+
{{- with .Values.ingress.annotations }}
21+
annotations:
22+
{{- toYaml . | nindent 4 }}
23+
{{- end }}
24+
spec:
25+
{{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }}
26+
ingressClassName: {{ .Values.ingress.className }}
27+
{{- end }}
28+
{{- if .Values.ingress.tls }}
29+
tls:
30+
{{- range .Values.ingress.tls }}
31+
- hosts:
32+
{{- range .hosts }}
33+
- {{ . | quote }}
34+
{{- end }}
35+
secretName: {{ .secretName }}
36+
{{- end }}
37+
{{- end }}
38+
rules:
39+
{{- range .Values.ingress.hosts }}
40+
- host: {{ .host | quote }}
41+
http:
42+
paths:
43+
{{- range .paths }}
44+
- path: {{ .path }}
45+
{{- if semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion }}
46+
pathType: {{ .pathType }}
47+
{{- end }}
48+
backend:
49+
{{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }}
50+
service:
51+
name: {{ $fullName }}
52+
port:
53+
name: http
54+
{{- else }}
55+
serviceName: {{ $fullName }}
56+
servicePort: http
57+
{{- end }}
58+
{{- end }}
59+
{{- end }}
60+
{{- end }}

charts/webspaced/templates/role.yaml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
---
2+
apiVersion: rbac.authorization.k8s.io/v1
3+
kind: Role
4+
metadata:
5+
name: {{ include "webspaced.fullname" . }}
6+
labels:
7+
{{- include "webspaced.labels" . | nindent 4 }}
8+
rules:
9+
- apiGroups: ['', 'traefik.containo.us', 'cert-manager.io']
10+
resources:
11+
- endpoints
12+
- services
13+
- middlewares
14+
- middlewaretcps
15+
- ingressroutes
16+
- ingressroutetcps
17+
- certificates
18+
verbs: ['get', 'create', 'update', 'delete']
19+
---
20+
apiVersion: rbac.authorization.k8s.io/v1
21+
kind: ClusterRole
22+
metadata:
23+
name: {{ include "webspaced.fullname" . }}
24+
labels:
25+
{{- include "webspaced.labels" . | nindent 4 }}
26+
rules:
27+
- apiGroups: ['discovery.k8s.io']
28+
resources: ['endpointslices']
29+
verbs: ['watch', 'list']
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
---
2+
apiVersion: rbac.authorization.k8s.io/v1
3+
kind: RoleBinding
4+
metadata:
5+
name: {{ include "webspaced.fullname" . }}
6+
labels:
7+
{{- include "webspaced.labels" . | nindent 4 }}
8+
roleRef:
9+
kind: Role
10+
name: {{ include "webspaced.fullname" . }}
11+
apiGroup: rbac.authorization.k8s.io
12+
subjects:
13+
- kind: ServiceAccount
14+
name: {{ include "webspaced.serviceAccountName" . }}
15+
---
16+
apiVersion: rbac.authorization.k8s.io/v1
17+
kind: ClusterRoleBinding
18+
metadata:
19+
name: {{ include "webspaced.fullname" . }}
20+
labels:
21+
{{- include "webspaced.labels" . | nindent 4 }}
22+
roleRef:
23+
kind: ClusterRole
24+
name: {{ include "webspaced.fullname" . }}
25+
apiGroup: rbac.authorization.k8s.io
26+
subjects:
27+
- kind: ServiceAccount
28+
name: {{ include "webspaced.serviceAccountName" . }}
29+
namespace: {{ .Release.Namespace }}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
apiVersion: v1
2+
kind: Secret
3+
metadata:
4+
name: {{ include "webspaced.fullname" . }}
5+
labels:
6+
{{- include "webspaced.labels" . | nindent 4 }}
7+
data:
8+
{{- with .Values.secrets.iamToken }}
9+
iam_token.txt: {{ . | b64enc }}
10+
{{- end }}
11+
{{- with .Values.secrets.lxdKey }}
12+
lxd_client.key: {{ . | b64enc }}
13+
{{- end }}
14+
{{- with .Values.secrets.lxdTrust }}
15+
lxd_trust.txt: {{ . | b64enc | squote }}
16+
{{- end }}
17+
{{- with .Values.secrets.traefikIAMToken }}
18+
traefik_iam_token.txt: {{ . | b64enc }}
19+
{{- end }}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
apiVersion: v1
2+
kind: ServiceAccount
3+
metadata:
4+
name: {{ include "webspaced.serviceAccountName" . }}
5+
labels:
6+
{{- include "webspaced.labels" . | nindent 4 }}
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
---
2+
apiVersion: v1
3+
kind: Service
4+
metadata:
5+
name: {{ include "webspaced.fullname" . }}
6+
labels:
7+
{{- include "webspaced.labels" . | nindent 4 }}
8+
spec:
9+
type: {{ .Values.service.type }}
10+
{{- with .Values.service.spec }}
11+
{{- toYaml . | nindent 2 }}
12+
{{- end }}
13+
ports:
14+
- port: {{ .Values.service.port }}
15+
targetPort: http
16+
protocol: TCP
17+
name: http
18+
selector:
19+
{{- include "webspaced.selectorLabels" . | nindent 4 }}
20+
{{- if .Values.fwdService.enabled }}
21+
---
22+
apiVersion: v1
23+
kind: Service
24+
metadata:
25+
name: {{ include "webspaced.fullname" . }}-forwarding
26+
{{- with .Values.fwdService.annotations }}
27+
annotations:
28+
{{- toYaml . | nindent 8 }}
29+
{{- end }}
30+
labels:
31+
{{- include "webspaced.labels" . | nindent 4 }}
32+
spec:
33+
type: {{ .Values.fwdService.type }}
34+
{{- with .Values.fwdService.spec }}
35+
{{- toYaml . | nindent 2 }}
36+
{{- end }}
37+
ports:
38+
- port: {{ .Values.fwdService.dummyPort }}
39+
targetPort: {{ .Values.fwdService.dummyPort }}
40+
protocol: TCP
41+
name: dummy
42+
selector:
43+
{{- include "webspaced.selectorLabels" . | nindent 4 }}
44+
{{- end }}

0 commit comments

Comments
 (0)