Skip to content
This repository has been archived by the owner on Sep 18, 2024. It is now read-only.

Commit

Permalink
librarychartify vscode & normalize schema
Browse files Browse the repository at this point in the history
  • Loading branch information
avouacr committed Oct 26, 2021
1 parent 6e345bd commit 1e72def
Show file tree
Hide file tree
Showing 17 changed files with 44 additions and 192 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
*.tgz
index.yaml
**.lock
Chart.lock
7 changes: 6 additions & 1 deletion charts/vscode/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,14 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 3.12.1
version: 4.0.0

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
appVersion: latest

dependencies:
- name: library-chart
version: 1.1.4
repository: https://inseefrlab.github.io/helm-charts-datascience
112 changes: 0 additions & 112 deletions charts/vscode/templates/_helpers.tpl

This file was deleted.

15 changes: 1 addition & 14 deletions charts/vscode/templates/configmap-git.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1 @@
{{- if .Values.git.enabled -}}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "vscode.configMapNameGit" . }}
labels:
{{- include "vscode.labels" . | nindent 4 }}
data:
GIT_USER_NAME: "{{ .Values.git.name }}"
GIT_USER_MAIL: "{{ .Values.git.email }}"
GIT_CREDENTIALS_CACHE_DURATION: "{{ .Values.git.cache }}"
GIT_PERSONNAL_ACCESS_TOKEN: "{{ .Values.git.token }}"
GIT_REPOSITORY: "{{ .Values.git.repository }}"
{{- end }}
{{ include "library-chart.configMapGit" . }}
16 changes: 1 addition & 15 deletions charts/vscode/templates/configmap-s3.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1 @@
{{- if .Values.s3.enabled -}}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "vscode.configMapNameS3" . }}
labels:
{{- include "vscode.labels" . | nindent 4 }}
data:
AWS_ACCESS_KEY_ID: "{{ .Values.s3.accessKeyId }}"
AWS_S3_ENDPOINT: "{{ .Values.s3.endpoint }}"
AWS_DEFAULT_REGION: "{{ .Values.s3.defaultRegion }}"
AWS_SECRET_ACCESS_KEY: "{{ .Values.s3.secretAccessKey }}"
AWS_SESSION_TOKEN: "{{ .Values.s3.sessionToken }}"

{{- end }}
{{ include "library-chart.configMapS3" . }}
16 changes: 1 addition & 15 deletions charts/vscode/templates/configmap-vault.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1 @@
{{- if .Values.vault.enabled -}}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "vscode.configMapNameVault" . }}
labels:
{{- include "vscode.labels" . | nindent 4 }}
data:
VAULT_ADDR: "{{ .Values.vault.url }}"
VAULT_TOKEN: "{{ .Values.vault.token }}"
VAULT_RELATIVE_PATH: "{{ .Values.vault.secret }}"
VAULT_TOP_DIR: "{{ .Values.vault.directory }}"
VAULT_MOUNT: "{{ .Values.vault.mount }}"

{{- end }}
{{ include "library-chart.configMapVault" . }}
20 changes: 10 additions & 10 deletions charts/vscode/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
{{- $fullName := include "vscode.fullname" . -}}
{{- $fullName := include "library-chart.fullname" . -}}
{{- $volumeName := printf "%s-%s" $fullName "data" | trunc 63 | trimSuffix "-" -}}
{{- $initContainerName := printf "%s-%s" $fullName "init-data" | trunc 63 | trimSuffix "-" -}}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "vscode.fullname" . }}
name: {{ include "library-chart.fullname" . }}
labels:
{{- include "vscode.labels" . | nindent 4 }}
{{- include "library-chart.labels" . | nindent 4 }}
spec:
{{- if not .Values.autoscaling.enabled }}
replicas: {{ .Values.replicaCount }}
{{- end }}
selector:
matchLabels:
{{- include "vscode.selectorLabels" . | nindent 6 }}
{{- include "library-chart.selectorLabels" . | nindent 6 }}
template:
metadata:
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "vscode.selectorLabels" . | nindent 8 }}
{{- include "library-chart.selectorLabels" . | nindent 8 }}
spec:
volumes:
- name: home
{{- if .Values.persistence.enabled }}
persistentVolumeClaim:
claimName: {{ .Values.persistence.existingClaim | default (include "vscode.fullname" .) }}
claimName: {{ .Values.persistence.existingClaim | default (include "library-chart.fullname" .) }}
{{- else }}
emptyDir: {}
{{- end }}
Expand All @@ -37,7 +37,7 @@ spec:
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "vscode.serviceAccountName" . }}
serviceAccountName: {{ include "library-chart.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
containers:
Expand Down Expand Up @@ -70,15 +70,15 @@ spec:
envFrom:
{{- if .Values.s3.enabled }}
- configMapRef:
name: {{ include "vscode.configMapNameS3" . }}
name: {{ include "library-chart.configMapNameS3" . }}
{{- end }}
{{- if .Values.vault.enabled }}
- configMapRef:
name: {{ include "vscode.configMapNameVault" . }}
name: {{ include "library-chart.configMapNameVault" . }}
{{- end }}
{{- if .Values.git.enabled }}
- configMapRef:
name: {{ include "vscode.configMapNameGit" . }}
name: {{ include "library-chart.configMapNameGit" . }}
{{- end }}
ports:
- name: http
Expand Down
6 changes: 3 additions & 3 deletions charts/vscode/templates/ingress.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{{- if .Values.ingress.enabled -}}
{{- $fullName := include "vscode.fullname" . -}}
{{- $fullName := include "library-chart.fullname" . -}}
{{- $svcPort := .Values.networking.vscode.port -}}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ $fullName }}
labels:
{{- include "vscode.labels" . | nindent 4 }}
{{- include "library-chart.labels" . | nindent 4 }}
annotations:
{{- include "vscode.ingress.annotations" . | nindent 4 }}
{{- include "library-chart.ingress.annotations" . | nindent 4 }}
spec:
{{- if .Values.ingress.tls }}
tls:
Expand Down
4 changes: 2 additions & 2 deletions charts/vscode/templates/networkpolicy-ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
kind: NetworkPolicy
apiVersion: networking.k8s.io/v1
metadata:
name: {{ include "vscode.fullname" . }}-2
name: {{ include "library-chart.fullname" . }}-2
spec:
podSelector:
matchLabels:
{{- include "vscode.selectorLabels" . | nindent 6 }}
{{- include "library-chart.selectorLabels" . | nindent 6 }}
ingress:
- from:
{{- toYaml .Values.security.networkPolicy.from | nindent 4 }}
Expand Down
4 changes: 2 additions & 2 deletions charts/vscode/templates/networkpolicy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
kind: NetworkPolicy
apiVersion: networking.k8s.io/v1
metadata:
name: {{ include "vscode.fullname" . }}
name: {{ include "library-chart.fullname" . }}
spec:
podSelector:
matchLabels:
{{- include "vscode.selectorLabels" . | nindent 6 }}
{{- include "library-chart.selectorLabels" . | nindent 6 }}
ingress:
- from:
- podSelector: {}
Expand Down
4 changes: 2 additions & 2 deletions charts/vscode/templates/pvc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: {{ include "vscode.fullname" . }}
name: {{ include "library-chart.fullname" . }}
labels:
{{- include "vscode.labels" . | nindent 4 }}
{{- include "library-chart.labels" . | nindent 4 }}
spec:
accessModes:
- {{ .Values.persistence.accessMode | quote }}
Expand Down
6 changes: 3 additions & 3 deletions charts/vscode/templates/role-binding.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: {{ include "vscode.serviceAccountName" . }}
name: {{ include "library-chart.serviceAccountName" . }}
labels:
{{- include "vscode.labels" . | nindent 4 }}
{{- include "library-chart.labels" . | nindent 4 }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: {{ .Values.kubernetes.role}}
subjects:
- kind: ServiceAccount
name: {{ include "vscode.serviceAccountName" . }}
name: {{ include "library-chart.serviceAccountName" . }}
namespace: {{ .Release.Namespace }}
{{- end }}
{{- end }}
6 changes: 3 additions & 3 deletions charts/vscode/templates/service.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
apiVersion: v1
kind: Service
metadata:
name: {{ include "vscode.fullname" . }}
name: {{ include "library-chart.fullname" . }}
labels:
{{- include "vscode.labels" . | nindent 4 }}
{{- include "library-chart.labels" . | nindent 4 }}
spec:
type: {{ .Values.networking.type }}
ports:
Expand All @@ -12,4 +12,4 @@ spec:
protocol: TCP
name: http
selector:
{{- include "vscode.selectorLabels" . | nindent 4 }}
{{- include "library-chart.selectorLabels" . | nindent 4 }}
4 changes: 2 additions & 2 deletions charts/vscode/templates/serviceaccount.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ include "vscode.serviceAccountName" . }}
name: {{ include "library-chart.serviceAccountName" . }}
labels:
{{- include "vscode.labels" . | nindent 4 }}
{{- include "library-chart.labels" . | nindent 4 }}
{{- with .Values.serviceAccount.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
Expand Down
6 changes: 3 additions & 3 deletions charts/vscode/templates/tests/test-connection.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
apiVersion: v1
kind: Pod
metadata:
name: "{{ include "vscode.fullname" . }}-test-connection"
name: "{{ include "library-chart.fullname" . }}-test-connection"
labels:
{{- include "vscode.labels" . | nindent 4 }}
{{- include "library-chart.labels" . | nindent 4 }}
annotations:
"helm.sh/hook": test-success
spec:
containers:
- name: wget
image: busybox
command: ['wget']
args: ['{{ include "vscode.fullname" . }}:{{ .Values.service.port }}']
args: ['{{ include "library-chart.fullname" . }}:{{ .Values.service.port }}']
restartPolicy: Never
4 changes: 2 additions & 2 deletions charts/vscode/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -162,11 +162,11 @@
"value": "{{project.password}}"
}
},
"whitelist": {
"allowlist": {
"type": "object",
"description": "IP protection",
"properties": {
"enable": {
"enabled": {
"type": "boolean",
"title": "Enable IP protection",
"description": "Only the configured set of IPs will be able to reach the service",
Expand Down
Loading

0 comments on commit 1e72def

Please sign in to comment.