Commit 0bb252d7 authored by Prout, Ryan's avatar Prout, Ryan
Browse files

Merge branch 'fs-mount-example' into 'master'

Fs mount example

See merge request ryu/slate_helm_examples!4
parents e9de604a a62fe780
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
apiVersion: v1
description: A Helm chart example for deploying a pod and mounting NCCS filesystems
name: nccs-fs-mount
version: 1.0.0
+5 −0
Original line number Diff line number Diff line
# Simple deployment that mounts NCCS filesystems

This simple example utilizes the ["recreate" deployment strategy](https://docs.openshift.com/container-platform/4.4/applications/deployments/deployment-strategies.html#deployments-recreate-strategy_deployment-strategies).

It will mount the NCCS GPFS filesystem and NFS filesystem, running as your projects automation user.
+16 −0
Original line number Diff line number Diff line
{{/*
Expand the name of the chart.
*/}}
{{- define "{{ .Values.fs-deployment.name }}.name" -}}
{{- default .Release.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).
*/}}
{{- define "{{ .Values.fs-deployment.name }}.fullname" -}}
{{- $name := default "{{ .Values.fs-deployment.name }}" .Values.nameOverride -}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
+34 −0
Original line number Diff line number Diff line
apiVersion: apps/v1
kind: Deployment
metadata:
  # This annotation is what enables the NCCS filesystem mount
  annotations:
    ccs.ornl.gov/fs: olcf
  name: {{ .Values.fsMount.name }}
spec:
  selector:
    matchLabels:
      app: {{ .Values.fsMount.name }} # has to match .spec.template.metadata.labels
  strategy:
    # Specifies the strategy used to replace old Pods by new ones
    # Refer: https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#strategy
    type: Recreate
  template:
    metadata:
      labels:
        app: {{ .Values.fsMount.name }}
    spec:
      containers:
      - name: fs-deployment
        image: alpine:latest
        command:
        - sh
        - -c
        - 'exec tail -f /dev/null'
        resources:
          limits:
            cpu: {{ .Values.fsMount.resources.limits.cpu }}
            memory: {{ .Values.fsMount.resources.limits.memory }}
          requests:
            cpu: {{ .Values.fsMount.resources.requests.cpu }}
            memory: {{ .Values.fsMount.resources.requests.memory }}
+12 −0
Original line number Diff line number Diff line
# This can be used to provide variables to your chart. 
# A simple example would be resources in the minio-standalone-deployment.yaml:

fsMount:
  resources:
    requests:
      cpu: 2
      memory: 1Gi
    limits:
      cpu: 2
      memory: 1Gi
  name: fs-deployment