Merge pull request #4 from tommy-skaug:foundationdb

Add foundationdb charts
This commit is contained in:
Tommy Skaug 2023-12-23 09:48:43 +01:00 committed by GitHub
commit b45f257b49
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 21688 additions and 0 deletions

View file

@ -0,0 +1,23 @@
apiVersion: v2
name: fdb-operator
description: A Helm chart for foundationDB operator
home: https://www.foundationdb.org/
sources:
- https://github.com/FoundationDB/fdb-kubernetes-operator/tree/master/helm/fdb-operator
# A chart can be either an 'application' or a 'library' chart.
#
# Application charts are a collection of templates that can be packaged into versioned archives
# to be deployed.
#
# Library charts provide useful utilities or functions for the chart developer. They're included as
# a dependency of application charts to inject those utilities and functions into the rendering
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
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.
version: 0.2.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.
appVersion: v1.30.0
maintainers:
- name: "foundationdb-ci"

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,164 @@
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.12.0
name: foundationdbrestores.apps.foundationdb.org
spec:
group: apps.foundationdb.org
names:
kind: FoundationDBRestore
listKind: FoundationDBRestoreList
plural: foundationdbrestores
shortNames:
- fdbrestore
singular: foundationdbrestore
scope: Namespaced
versions:
- additionalPrinterColumns:
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
deprecated: true
name: v1beta1
schema:
openAPIV3Schema:
properties:
apiVersion:
type: string
kind:
type: string
metadata:
type: object
spec:
properties:
backupURL:
type: string
blobStoreConfiguration:
properties:
accountName:
maxLength: 100
type: string
backupName:
maxLength: 1024
type: string
bucket:
maxLength: 63
minLength: 3
type: string
urlParameters:
items:
maxLength: 1024
type: string
maxItems: 100
type: array
required:
- accountName
type: object
customParameters:
items:
maxLength: 100
type: string
maxItems: 100
type: array
destinationClusterName:
type: string
keyRanges:
items:
properties:
end:
pattern: ^[A-Za-z0-9\/\\-]+$
type: string
start:
pattern: ^[A-Za-z0-9\/\\-]+$
type: string
required:
- end
- start
type: object
type: array
required:
- destinationClusterName
type: object
status:
properties:
running:
type: boolean
type: object
type: object
served: true
storage: false
subresources:
status: {}
- additionalPrinterColumns:
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
name: v1beta2
schema:
openAPIV3Schema:
properties:
apiVersion:
type: string
kind:
type: string
metadata:
type: object
spec:
properties:
blobStoreConfiguration:
properties:
accountName:
maxLength: 100
type: string
backupName:
maxLength: 1024
type: string
bucket:
maxLength: 63
minLength: 3
type: string
urlParameters:
items:
maxLength: 1024
type: string
maxItems: 100
type: array
required:
- accountName
type: object
customParameters:
items:
maxLength: 100
type: string
maxItems: 100
type: array
destinationClusterName:
type: string
keyRanges:
items:
properties:
end:
pattern: ^[A-Za-z0-9\/\\-]+$
type: string
start:
pattern: ^[A-Za-z0-9\/\\-]+$
type: string
required:
- end
- start
type: object
type: array
required:
- destinationClusterName
type: object
status:
properties:
running:
type: boolean
type: object
type: object
served: true
storage: true
subresources:
status: {}

View file

@ -0,0 +1,6 @@
FoundationDB operator has been installed successfully.
To see the logs of the operator you can use below command
kubectl logs deployment/{{ include "fdb-operator.fullname" . }} -n {{ .Release.Namespace }} -f
Thanks for trying out FoundationDB helm chart.

View file

@ -0,0 +1,60 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "fdb-operator.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 "fdb-operator.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 "fdb-operator.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{/*
Common labels
*/}}
{{- define "fdb-operator.labels" -}}
helm.sh/chart: {{ include "fdb-operator.chart" . }}
{{ include "fdb-operator.selectorLabels" . }}
app.kubernetes.io/version: {{ .Values.image.tag | trimPrefix "v" | quote }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}
{{/*
Selector labels
*/}}
{{- define "fdb-operator.selectorLabels" -}}
app.kubernetes.io/name: {{ include "fdb-operator.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}
{{/*
Create the name of the service account
*/}}
{{- define "fdb-operator.serviceAccountName" -}}
{{- if .Values.serviceAccount.create -}}
{{ default (include "fdb-operator.fullname" .) .Values.serviceAccount.name }}
{{- else -}}
{{ default "default" .Values.serviceAccount.name }}
{{- end -}}
{{- end -}}

View file

@ -0,0 +1,116 @@
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "fdb-operator.fullname" . }}
labels:
{{- include "fdb-operator.labels" . | nindent 4 }}
{{- with .Values.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- with .Values.replicas }}
replicas: {{ . }}
{{- end }}
selector:
matchLabels:
{{- include "fdb-operator.selectorLabels" . | nindent 6 }}
template:
metadata:
labels:
{{- include "fdb-operator.selectorLabels" . | nindent 8 }}
{{- with .Values.podLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
serviceAccountName: {{ include "fdb-operator.serviceAccountName" . }}
{{- with .Values.priorityClassName }}
priorityClassName: {{ . }}
{{- end }}
securityContext:
{{- toYaml .Values.securityContext | nindent 8 }}
terminationGracePeriodSeconds: 10
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
initContainers:
{{- range $version, $params := .Values.initContainers }}
- name: foundationdb-kubernetes-init-{{ $version | replace "." "-" }}
image: {{ $params.image.repository }}:{{ $params.image.tag }}
imagePullPolicy: {{ $params.image.pullPolicy }}
args:
- "--copy-library"
- "{{ $version }}"
- "--copy-binary"
- "fdbcli"
- "--copy-binary"
- "fdbbackup"
- "--copy-binary"
- "fdbrestore"
- "--output-dir"
- "/var/output-files/{{ regexFind "^[0-9.]+" $params.image.tag }}"
- "--init-mode"
volumeMounts:
- name: fdb-binaries
mountPath: /var/output-files
resources:
{{- toYaml $.Values.initContainersResources | nindent 10 }}
securityContext:
{{- toYaml $.Values.initContainerSecurityContext | nindent 10 }}
{{- end }}
containers:
- name: manager
image: {{ .Values.image.repository }}:{{ .Values.image.tag }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
command:
- /manager
{{- if not .Values.globalMode.enabled }}
env:
- name: WATCH_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
{{- end }}
ports:
- containerPort: 8080
name: metrics
volumeMounts:
- name: tmp
mountPath: /tmp
- name: logs
mountPath: /var/log/fdb
- name: fdb-binaries
mountPath: /usr/bin/fdb
securityContext:
{{- toYaml .Values.containerSecurityContext | nindent 10 }}
livenessProbe:
httpGet:
path: /metrics
port: metrics
resources:
{{- toYaml .Values.resources | nindent 10 }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
volumes:
- name: tmp
emptyDir: {}
- name: logs
emptyDir: {}
- name: fdb-binaries
emptyDir: {}

View file

@ -0,0 +1,112 @@
---
apiVersion: rbac.authorization.k8s.io/v1
{{- if .Values.globalMode.enabled }}
kind: ClusterRole
{{- else }}
kind: Role
{{- end }}
metadata:
name: {{ include "fdb-operator.fullname" . }}
labels:
{{- include "fdb-operator.labels" . | nindent 4 }}
rules:
- apiGroups:
- ""
resources:
- pods
- configmaps
- persistentvolumeclaims
- events
verbs:
- get
- watch
- list
- create
- update
- patch
- delete
- apiGroups:
- apps.foundationdb.org
resources:
- foundationdbclusters
- foundationdbbackups
- foundationdbrestores
verbs:
- get
- list
- watch
- create
- update
- patch
- delete
- apiGroups:
- apps.foundationdb.org
resources:
- foundationdbclusters/status
- foundationdbbackups/status
- foundationdbrestores/status
verbs:
- get
- update
- patch
- apiGroups:
- admissionregistration.k8s.io
resources:
- mutatingwebhookconfigurations
- validatingwebhookconfigurations
verbs:
- get
- list
- watch
- create
- update
- patch
- delete
- apiGroups:
- ""
resources:
- secrets
verbs:
- get
- list
- watch
- create
- update
- patch
- delete
- apiGroups:
- ""
resources:
- services
verbs:
- get
- list
- watch
- create
- update
- patch
- delete
- apiGroups:
- apps
resources:
- deployments
verbs:
- get
- list
- watch
- create
- update
- patch
- delete
- apiGroups:
- coordination.k8s.io
resources:
- leases
verbs:
- get
- list
- watch
- create
- update
- patch
- delete

View file

@ -0,0 +1,25 @@
---
apiVersion: rbac.authorization.k8s.io/v1
{{- if .Values.globalMode.enabled }}
kind: ClusterRoleBinding
{{- else }}
kind: RoleBinding
{{- end }}
metadata:
name: {{ include "fdb-operator.fullname" . }}
labels:
{{- include "fdb-operator.labels" . | nindent 4 }}
roleRef:
apiGroup: rbac.authorization.k8s.io
{{- if .Values.globalMode.enabled }}
kind: ClusterRole
{{- else }}
kind: Role
{{- end }}
name: {{ include "fdb-operator.fullname" . }}
subjects:
- kind: ServiceAccount
name: {{ include "fdb-operator.serviceAccountName" . }}
{{- if .Values.globalMode.enabled }}
namespace: {{ .Release.Namespace }}
{{- end }}

View file

@ -0,0 +1,17 @@
---
{{- if .Values.serviceAccount.create }}
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ include "fdb-operator.serviceAccountName" . }}
labels:
{{- include "fdb-operator.labels" . | nindent 4 }}
{{- with .Values.serviceAccount.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.serviceAccount.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 2 }}
{{- end }}
{{- end }}

View file

@ -0,0 +1,69 @@
---
image:
repository: foundationdb/fdb-kubernetes-operator
tag: v1.30.0
pullPolicy: IfNotPresent
initContainers:
6.2:
image:
repository: foundationdb/foundationdb-kubernetes-sidecar
tag: 6.2.30-1
pullPolicy: IfNotPresent
6.3:
image:
repository: foundationdb/foundationdb-kubernetes-sidecar
tag: 6.3.23-1
pullPolicy: IfNotPresent
7.1:
image:
repository: foundationdb/foundationdb-kubernetes-sidecar
tag: 7.1.15-1
pullPolicy: IfNotPresent
globalMode:
enabled: false
replicas: null
imagePullSecrets: []
annotations: {}
podAnnotations: {}
podLabels: {}
serviceAccount:
create: true
name: null
imagePullSecrets: []
annotations: {}
priorityClassName: null
securityContext:
runAsUser: 4059
runAsGroup: 4059
fsGroup: 4059
containerSecurityContext:
allowPrivilegeEscalation: false
privileged: false
capabilities:
drop:
- all
readOnlyRootFilesystem: true
nodeSelector: {}
affinity: {}
tolerations: {}
resources:
limits:
cpu: 500m
memory: 256Mi
requests:
cpu: 500m
memory: 256Mi
initContainersResources:
limits:
cpu: 10m
memory: 50Mi
requests:
cpu: 10m
memory: 50Mi
initContainerSecurityContext:
allowPrivilegeEscalation: false
privileged: false
capabilities:
drop:
- all
readOnlyRootFilesystem: true