Unverified Commit 98664975 authored by Mayank Sharma's avatar Mayank Sharma Committed by GitHub
Browse files

helm chart for the new WebUI (#121)

helm chart for the new WebUI 
parent bf5fa064
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
name: rucio-webui
version: 1.30.0
apiVersion: v1
description: A Helm chart to deploy the new webui (2.0) servers for Rucio
keywords:
  - data-management
  - science
home: https://rucio.cern.ch/
sources:
  - https://github.com/rucio/webui
maintainers:
  - name: Rucio development team
    email: rucio-dev@cern.ch
+0 −0

Empty file added.

+19 −0
Original line number Diff line number Diff line
1. To check that you server is running you can run this command:
{{- if .Values.ingress.enabled }}
{{- range .Values.ingress.hosts }}
  http{{ if $.Values.ingress.tls }}s{{ end }}://{{ . }}{{ $.Values.ingress.path }}ping
{{- end }}
{{- else if contains "NodePort" .Values.service.type }}
  export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ template "rucio.fullname" . }})
  export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
  curl http://$NODE_IP:$NODE_PORT/
{{- else if contains "LoadBalancer" .Values.service.type }}
     NOTE: It may take a few minutes for the LoadBalancer IP to be available.
           You can watch the status of by running 'kubectl get svc -w {{ template "rucio.fullname" . }}'
  export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "rucio.fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
  echo http://$SERVICE_IP:{{ .Values.service.port }}
{{- else if contains "ClusterIP" .Values.service.type }}
  export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app={{ template "rucio.name" . }},release={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
  echo "Visit http://127.0.0.1:8080 to use your application"
  kubectl port-forward $POD_NAME 8080:80
{{- end }}
+43 −0
Original line number Diff line number Diff line
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "rucio.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 "rucio.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 "rucio.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{/*
Get Ingress Kube API Version
*/}}
{{- define "rucio.ingress.apiVersion" -}}
  {{- if semverCompare ">= 1.19.x" (default .Capabilities.KubeVersion.Version .Values.kubeVersionOverride) -}}
    {{- print "networking.k8s.io/v1" -}}
  {{- else -}}
    {{- print "extensions/v1beta1" -}}
  {{- end -}}
{{- end -}}
+174 −0
Original line number Diff line number Diff line
apiVersion: v1
kind: Secret
metadata:
  name: {{ template "rucio.fullname" . }}.config.yaml
  labels:
    app: {{ template "rucio.name" . }}
    chart: {{ template "rucio.chart" . }}
    release: "{{ .Release.Name }}"
    heritage: "{{ .Release.Service }}"
type: Opaque
data:
  {{- $common_config := .Values.config | default dict | mustToPrettyJson | b64enc }}
  common.json: {{ $common_config | quote }}
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ template "rucio.fullname" . }}
  labels:
    app: {{ template "rucio.name" . }}
    chart: {{ template "rucio.chart" . }}
    release: {{ .Release.Name }}
    heritage: {{ .Release.Service }}
spec:
  replicas: {{ .Values.replicaCount }}
  selector:
    matchLabels:
      app: {{ template "rucio.name" . }}
      release: {{ .Release.Name }}
  strategy:
    type: {{ .Values.strategy.type }}
{{- if eq .Values.strategy.type "RollingUpdate" }}
    {{- with .Values.strategy.rollingUpdate }}
    rollingUpdate:
{{ toYaml . | trim | indent 6 }}
    {{- end }}
{{- end }}
  minReadySeconds: {{ .Values.minReadySeconds }}
  template:
    metadata:
      labels:
        app: {{ template "rucio.name" . }}
        release: {{ .Release.Name }}
      annotations:
        checksum/config: {{ $common_config | sha1sum }}
    spec:
      volumes:
      - name: config
        secret:
          secretName: {{ template "rucio.fullname" . }}.config.yaml
      - name: httpdlog
        emptyDir: {}
      {{- if eq .Values.service.useSSL true }}
      - name: hostcert
        secret:
          secretName: {{ .Release.Name }}-hostcert
      - name: hostkey
        secret:
          secretName: {{ .Release.Name }}-hostkey
      - name: cafile
        secret:
          secretName: {{ .Release.Name }}-cafile
      {{- end }}
      {{- range $key, $val := .Values.additionalSecrets }}
      - name: {{ kindIs "int" $key | ternary (coalesce $val.volumeName $val.secretName $val.secretFullName) $key }}
        secret:
          secretName: {{ coalesce $val.secretFullName (printf "%s-%s" $.Release.Name $val.secretName) }}
      {{- end}}
      {{- range $key, $val := .Values.persistentVolumes }}
      - name: {{ $key }}
        persistentVolumeClaim:
          claimName: {{ $val.name }}
      {{- end}}
      containers:
      {{- if .Values.exposeErrorLogs }}
        - name: httpd-error-log
          image: busybox
          args: [/bin/sh, -c, 'tail -n+1 -F /var/log/httpd/error_log']
          volumeMounts:
          - name: httpdlog
            mountPath: /var/log/httpd
      {{- end }}
        - name: {{ .Chart.Name }}
          image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
          imagePullPolicy: {{ .Values.image.pullPolicy }}
          ports:
            - name: http
              containerPort: 80
              protocol: TCP
            {{- if .Values.service.useSSL }}
            - name: https
              containerPort: 443
              protocol: TCP
            {{- end }}
          volumeMounts:
            - name: config
              mountPath: /opt/rucio/etc/conf.d/10_common.json
              subPath: common.json
            - name: httpdlog
              mountPath: /var/log/httpd
            {{- if .Values.service.useSSL }}
            - name: hostcert
              mountPath: /etc/grid-security/hostcert.pem
              subPath: hostcert.pem
            - name: hostkey
              mountPath: /etc/grid-security/hostkey.pem
              subPath: hostkey.pem
            - name: cafile
              mountPath: /etc/grid-security/ca.pem
              subPath: ca.pem
            {{- end}}
            {{- range $key, $val := .Values.additionalSecrets }}
            - name: {{ kindIs "int" $key | ternary (coalesce $val.volumeName $val.secretName $val.secretFullName) $key }} 
              mountPath: {{ $val.mountPath }}
              subPath: {{ $val.subPath }}
            {{- end}}
            {{- range $key, $val := .Values.persistentVolumes }}
            - name: {{ $key }}
              mountPath: {{ $val.mountPath }}
            {{- end}}
          env:
            {{- range $key, $val := .Values.config.httpd }}
            - name: RUCIO_HTTPD_{{ $key | snakecase | upper }}
              value: {{ $val | quote }}
            {{- end }}
            {{- range $key, $val := .Values.config.httpdWebui }}
            - name: RUCIO_{{ $key | snakecase | upper }}
              value: {{ $val | quote }}
            {{- end }}
            {{ range $i, $provider := .Values.config.oidcProviders }}
            {{- range $key, $val := $provider }}
            - name: RUCIO_CFG_OIDC_REACT_APP_{{ $key | snakecase | upper }}_{{ $i }}
              value: {{ $val | quote }}
            {{- end }}
            {{- end }}
            {{- range $key, $val := .Values.config.react }}
            {{- if and (ne $key "rucioHost") (ne $key "rucioAuthHost") }}
            - name: {{ $key | upper }}
              value: {{ $val | quote }}
            {{- end }}
            {{- end }}
            {{- range $key1, $val1 := .Values.optionalConfig }}
            - name: {{ $key1 | upper }}
              value: "{{ $val1  }}"
            {{- end}}
            - name: RUCIO_HOST
              value: {{ required "A valid rucioHost value pointing to the rucio server is required" .Values.config.react.rucioHost }}
            - name: RUCIO_AUTH_HOST
              value: {{ required "A valid rucioAuthHost value pointing to the rucio auth server is required" .Values.config.react.rucioAuthHost }}
            - name: RUCIO_OVERRIDE_CONFIGS
              value: "/opt/rucio/etc/conf.d/"
            - name: RUCIO_LOG_FORMAT
              value: '[%{%Y-%m-%d %H:%M:%S}t]\t%v\t%h\t%{X-Forwarded-For}i\t%{X-Rucio-RequestId}i\t%>s\t%I\t%B\t%D\t\"%r\"\t\"%{X-Rucio-Auth-Token}i\"\t\"%{User-Agent}i\"\t%{X-Rucio-Script}i'
          {{- if not .Values.service.useSSL }}
            - name: RUCIO_ENABLE_SSL
              value: "False"
          {{- else }}
            - name: RUCIO_ENABLE_SSL
              value: "True"
          {{- end }}
          resources:
{{ toYaml .Values.resources | indent 12 }}
    {{- with .Values.nodeSelector }}
      nodeSelector:
{{ toYaml . | indent 8 }}
    {{- end }}
    {{- with .Values.affinity }}
      affinity:
{{ toYaml . | indent 8 }}
    {{- end }}
    {{- with .Values.tolerations }}
      tolerations:
{{ toYaml . | indent 8 }}
    {{- end }}
Loading