diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..74afef7a4d4914ece410e2e8a44b08ab9b65d4da --- /dev/null +++ b/.gitignore @@ -0,0 +1,25 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*.orig +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ +rshiny-*.tgz +chart/charts/*tgz +Chart.lock diff --git a/chart/Chart.yaml b/chart/Chart.yaml index bd9877cfb599ada2135449d0b3c1192bcbd5df0c..11b899faf1dcee43d7f59c150b827e7aaed15218 100644 --- a/chart/Chart.yaml +++ b/chart/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v2 -name: rshiny -description: A Helm chart for deploying rshiny app in Kubernetes +name: rshiny-example +description: An example # A chart can be either an 'application' or a 'library' chart. # @@ -15,10 +15,15 @@ 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: 0.1.0 +version: 1.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. # It is recommended to use it with quotes. -appVersion: "1.16.0" +appVersion: "1.0.0" + +dependencies: +- name: rshiny + version: "0.2.0" + repository: "https://gitlab.pasteur.fr/api/v4/projects/5334/packages/helm/stable" diff --git a/chart/charts/.gitkeep b/chart/charts/.gitkeep new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/chart/templates/.gitkeep b/chart/templates/.gitkeep new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/chart/templates/_helpers.tpl b/chart/templates/_helpers.tpl deleted file mode 100644 index b4c38025b9921445c6cf1b9f3160ac0ded9d178d..0000000000000000000000000000000000000000 --- a/chart/templates/_helpers.tpl +++ /dev/null @@ -1,51 +0,0 @@ -{{/* -Expand the name of the chart. -*/}} -{{- define "chart.name" -}} -{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} -{{- end }} - -{{/* -Create a default fully qualified app name. -We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). -If release name contains chart name it will be used as a full name. -*/}} -{{- define "chart.fullname" -}} -{{- if .Values.fullnameOverride }} -{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} -{{- else }} -{{- $name := default .Chart.Name .Values.nameOverride }} -{{- if contains $name .Release.Name }} -{{- .Release.Name | trunc 63 | trimSuffix "-" }} -{{- else }} -{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} -{{- end }} -{{- end }} -{{- end }} - -{{/* -Create chart name and version as used by the chart label. -*/}} -{{- define "chart.chart" -}} -{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} -{{- end }} - -{{/* -Common labels -*/}} -{{- define "chart.labels" -}} -helm.sh/chart: {{ include "chart.chart" . }} -{{ include "chart.selectorLabels" . }} -{{- if .Chart.AppVersion }} -app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} -{{- end }} -app.kubernetes.io/managed-by: {{ .Release.Service }} -{{- end }} - -{{/* -Selector labels -*/}} -{{- define "chart.selectorLabels" -}} -app.kubernetes.io/name: {{ include "chart.name" . }} -app.kubernetes.io/instance: {{ .Release.Name }} -{{- end }} diff --git a/chart/templates/deployment.yaml b/chart/templates/deployment.yaml deleted file mode 100644 index 4b20e17d3617232dbd6a2aa41306a985fd0bf78b..0000000000000000000000000000000000000000 --- a/chart/templates/deployment.yaml +++ /dev/null @@ -1,38 +0,0 @@ ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - name: {{ include "chart.fullname" . }} - labels: - {{- include "chart.labels" . | nindent 4 }} -spec: - selector: - matchLabels: - {{- include "chart.selectorLabels" . | nindent 6 }} -{{- if .Values.nodowntime.enabled }} - strategy: - type: RollingUpdate - rollingUpdate: - maxSurge: 1 - maxUnavailable: 0 -{{- end }} - template: - metadata: - labels: - {{- include "chart.selectorLabels" . | nindent 8 }} - spec: - imagePullSecrets: - - name: registry-gitlab - containers: - - name: rshiny-pod - image: {{ .Values.imageFullNameAndTag }} - securityContext: - runAsGroup: 999 - runAsUser: 999 - ports: - - name: http - containerPort: 3838 - protocol: TCP - resources: - {{- toYaml .Values.resources | nindent 12 }} ---- \ No newline at end of file diff --git a/chart/templates/hpa.yaml b/chart/templates/hpa.yaml deleted file mode 100644 index 548ee03b16e46f690c213aac0afc40e44e240936..0000000000000000000000000000000000000000 --- a/chart/templates/hpa.yaml +++ /dev/null @@ -1,28 +0,0 @@ -{{- if .Values.autoscaling.enabled }} -apiVersion: autoscaling/v2beta1 -kind: HorizontalPodAutoscaler -metadata: - name: {{ include "chart.fullname" . }} - labels: - {{- include "chart.labels" . | nindent 4 }} -spec: - scaleTargetRef: - apiVersion: apps/v1 - kind: Deployment - name: {{ include "chart.fullname" . }} - minReplicas: {{ .Values.autoscaling.minReplicas }} - maxReplicas: {{ .Values.autoscaling.maxReplicas }} - metrics: - {{- if .Values.autoscaling.targetCPUUtilizationPercentage }} - - type: Resource - resource: - name: cpu - targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} - {{- end }} - {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }} - - type: Resource - resource: - name: memory - targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} - {{- end }} -{{- end }} diff --git a/chart/templates/ingress.yaml b/chart/templates/ingress.yaml deleted file mode 100644 index f6d131a2ad622c8282b07b05e55f87faee27424f..0000000000000000000000000000000000000000 --- a/chart/templates/ingress.yaml +++ /dev/null @@ -1,21 +0,0 @@ ---- -apiVersion: networking.k8s.io/v1 -kind: Ingress -metadata: - annotations: - {{- toYaml .Values.ingress.annotations | nindent 4 }} - name: {{ include "chart.fullname" . }} -spec: - ingressClassName: {{ .Values.ingress.className | quote }} - rules: - - host: {{ .Values.ingress.hostname | quote }} - http: - paths: - - path: / - pathType: Prefix - backend: - service: - name: {{ include "chart.fullname" . }} - port: - number: 8080 ---- \ No newline at end of file diff --git a/chart/templates/service.yaml b/chart/templates/service.yaml deleted file mode 100644 index 609de414273f92e72da7a9cdfdb85e2563a9f36b..0000000000000000000000000000000000000000 --- a/chart/templates/service.yaml +++ /dev/null @@ -1,14 +0,0 @@ ---- -apiVersion: v1 -kind: Service -metadata: - name: {{ include "chart.fullname" . }} -spec: - type: ClusterIP - ports: - - name: http - port: 8080 - targetPort: 3838 - selector: - {{- include "chart.selectorLabels" . | nindent 4 }} ---- \ No newline at end of file diff --git a/chart/values.yaml b/chart/values.yaml index e0d8b1f1408e11b2abefb5cf574c1b6e3f7b6a7b..768686d1dff5fa5a953ef92bd071adb1b1e985e2 100644 --- a/chart/values.yaml +++ b/chart/values.yaml @@ -1,31 +1,5 @@ autoscaling: enabled: true - minReplicas: 1 - maxReplicas: 2 - targetCPUUtilizationPercentage: 80 - targetMemoryUtilizationPercentage: 80 - nodowntime: - enabled: true - - -imageFullNameAndTag: registry-gitlab.pasteur.fr/hub/rshiny-k8s-example/main:latest - - -resources: - requests: - memory: "256Mi" - cpu: "500m" - limits: - memory: "512Mi" - cpu: "1000m" - - -ingress: - enabled: true - className: "" - annotations: - nginx.ingress.kubernetes.io/affinity: cookie - nginx.ingress.kubernetes.io/proxy-body-size: 256m - hostname: "" + enabled: true \ No newline at end of file