Skip to content

Commit

Permalink
bigdata-operator 0.1.0 (#2)
Browse files Browse the repository at this point in the history
* bigdata operator 0.1.0

* add gitignore

* update readme

* make lint
  • Loading branch information
thorsteinnth authored Sep 17, 2021
1 parent 437ac84 commit eded75a
Show file tree
Hide file tree
Showing 15 changed files with 556 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# IDE paraphernalia
.idea
.vscode
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
lint:
docker run -v $(shell pwd):/mnt -w=/mnt quay.io/helmpack/chart-testing ct lint --config .github/ct-config.yaml
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
# Helm Charts for the Bigdata team
# Ocean for Apache Spark helm charts
23 changes: 23 additions & 0 deletions charts/bigdata-operator/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# 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/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
17 changes: 17 additions & 0 deletions charts/bigdata-operator/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
apiVersion: v2
name: bigdata-operator
description: Spot Ocean BigData Operator
type: application
version: 0.1.0
appVersion: 0.1.0
home: https://github.com/spotinst/charts
icon: https://docs.spot.io/_media/images/spot_mark.png
sources:
- https://github.com/spotinst/bigdata-operator
keywords:
- spot
- toolkit
- ocean
maintainers:
- name: thorsteinnth
email: [email protected]
148 changes: 148 additions & 0 deletions charts/bigdata-operator/crds/bigdata.spot.io_bigdataenvironments.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@

---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.4.1
creationTimestamp: null
name: bigdataenvironments.bigdata.spot.io
spec:
group: bigdata.spot.io
names:
kind: BigDataEnvironment
listKind: BigDataEnvironmentList
plural: bigdataenvironments
singular: bigdataenvironment
scope: Namespaced
versions:
- name: v1
schema:
openAPIV3Schema:
description: BigDataEnvironment is the Schema for the bigdataenvironments
API
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
metadata:
type: object
spec:
description: BigDataEnvironmentSpec defines the desired state of BigDataEnvironment
properties:
active:
description: Active indicates whether the environment is active
type: boolean
components:
additionalProperties:
description: ComponentSpec defines the desired state of Component
properties:
chartName:
description: ChartName is the name of a helm chart. For embedded
charts, this should be the chart folder name.
type: string
state:
description: State determines whether the component should be
installed or removed
type: string
type:
description: InstallationType is one of ["helm",]
type: string
url:
description: URL is the location of the helm repository. If
empty, we assume an embedded chart.
type: string
valuesConfiguration:
description: ValuesConfiguration is a set of helm values, in
yaml form
type: string
version:
description: Version is the version of the helm chart. For embedded
charts, this must match the version of the embedded chart.
type: string
required:
- chartName
- state
- type
- url
- version
type: object
type: object
purge:
description: Purge determines whether all resources should be removed
when environment is removed, including adoptable components
type: boolean
state:
description: 'State determines whether the environment should be installed
or removed (default: present)'
type: string
type: object
status:
description: BigDataEnvironmentStatus defines the observed state of BigDataEnvironment
properties:
activationTimestamp:
format: date-time
type: string
components:
additionalProperties:
description: ComponentStatus defines the observed state of Component
properties:
conditions:
items:
description: ComponentCondition describes the state of a component
at a certain point
properties:
lastTransitionTime:
description: Last time the condition transitioned from
one status to another
format: date-time
type: string
lastUpdateTime:
description: The last time this condition was updated
format: date-time
type: string
message:
description: A human-readable message indicating details
about the transition
type: string
reason:
description: The reason for the condition's last transition
type: string
status:
description: Status of the condition, one of True, False,
Unknown
type: string
type:
description: Type of component condition
type: string
required:
- status
- type
type: object
type: array
properties:
additionalProperties:
type: string
description: A set of installation values specific to the component
type: object
type: object
type: object
type: object
type: object
served: true
storage: true
subresources:
status: {}
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
1 change: 1 addition & 0 deletions charts/bigdata-operator/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Installs the Spot BigData Operator
63 changes: 63 additions & 0 deletions charts/bigdata-operator/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
{{/*
{{/*
Expand the name of the chart.
*/}}
{{- define "bigdata-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 "bigdata-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 "bigdata-operator.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Common labels
*/}}
{{- define "bigdata-operator.labels" -}}
helm.sh/chart: {{ include "bigdata-operator.chart" . }}
{{ include "bigdata-operator.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}

{{/*
Selector labels
*/}}
{{- define "bigdata-operator.selectorLabels" -}}
app.kubernetes.io/name: {{ include "bigdata-operator.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

{{/*
Create the name of the service account to use
*/}}
{{- define "bigdata-operator.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "bigdata-operator.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}
56 changes: 56 additions & 0 deletions charts/bigdata-operator/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "bigdata-operator.fullname" . }}
labels:
{{- include "bigdata-operator.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
{{- include "bigdata-operator.selectorLabels" . | nindent 6 }}
template:
metadata:
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "bigdata-operator.selectorLabels" . | nindent 8 }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "bigdata-operator.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
containers:
- name: manager
args:
- --leader-elect
ports:
- name: webhook
containerPort: 9443
protocol: TCP
- name: metrics
containerPort: 8080
protocol: TCP
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
27 changes: 27 additions & 0 deletions charts/bigdata-operator/templates/environment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{{- if .Values.bigDataEnvironment.create -}}
apiVersion: bigdata.spot.io/v1
kind: BigDataEnvironment
metadata:
name: {{ .Values.bigDataEnvironment.name | default (include "bigdata-operator.fullname" .) }}
labels:
{{- include "bigdata-operator.labels" . | nindent 4 }}
annotations:
"helm.sh/resource-policy": keep # helm delete should not delete the environment, we want to do that explicitly
spec:
active: {{ .Values.bigDataEnvironment.active }}
purge: false
state: present
components:
spark-operator:
type: helm
chartName: "spark-operator"
url: ""
state: present
version: {{ .Values.bigDataEnvironment.componentVersions | default .Chart.AppVersion }}
spark-operator-static:
type: helm
chartName: "spark-operator-static"
url: ""
state: present
version: {{ .Values.bigDataEnvironment.componentVersions | default .Chart.AppVersion }}
{{- end }}
Loading

0 comments on commit eded75a

Please sign in to comment.