Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions charts/opendcs-operator/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ 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.0.9
version: 0.0.10

# 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: "0.0.12"
appVersion: "0.0.15"
7 changes: 7 additions & 0 deletions charts/opendcs-operator/crds/lrgs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@ spec:
default: 16003
format: int32
type: integer
tlsMode:
enum:
- NoTls
- StartTls
- Tls
nullable: true
type: string
username:
type: string
required:
Expand Down
72 changes: 72 additions & 0 deletions charts/opendcs-operator/crds/tsdb.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: opendcsdatabases.tsdb.opendcs.org
spec:
group: tsdb.opendcs.org
names:
categories: []
kind: OpenDcsDatabase
plural: opendcsdatabases
shortNames: []
singular: opendcsdatabase
scope: Namespaced
versions:
- additionalPrinterColumns: []
name: v1
schema:
openAPIV3Schema:
description: Auto-generated derived type for OpenDcsDatabaseSpec via `CustomResource`
properties:
spec:
properties:
databaseSecret:
description: 'Secret for admin user of the database. Must contain the following keys: jdbcUrl, username, password'
type: string
placeholders:
additionalProperties:
type: string
description: Flyway placeholders for the given database. Cannot be changed after initial setup
type: object
x-kubernetes-validations:
- message: is immutable
rule: self == oldSelf
schemaVersion:
description: Migration image to use. Migration image tags will track the schema version they are as well if the opendcs release version
type: string
required:
- databaseSecret
- placeholders
- schemaVersion
type: object
status:
nullable: true
properties:
applied_schema_version:
description: Applied Schema version as derived from the installed schema
nullable: true
type: string
last_updated:
format: date-time
nullable: true
type: string
state:
description: Current migration activity
enum:
- Fresh
- PreparingToMigrate
- Migrating
- Ready
- Failed
nullable: true
type: string
type: object
required:
- spec
title: OpenDcsDatabase
type: object
served: true
storage: true
subresources:
status: {}
2 changes: 1 addition & 1 deletion charts/opendcs-operator/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ app.kubernetes.io/managed-by: {{ .Release.Service }}
Selector labels
*/}}
{{- define "opendcs-operator.selectorLabels" -}}
app.kubernetes.io/name: {{ include "opendcs-operator.name" . }}

app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "opendcs-operator.fullname" . }}
name: {{ include "opendcs-operator.fullname" . }}-lrgs
labels:
{{- include "opendcs-operator.labels" . | nindent 4 }}
spec:
{{- if not .Values.autoscaling.enabled }}
replicas: {{ .Values.replicaCount }}
{{- end }}
replicas: 1
selector:
matchLabels:
{{- include "opendcs-operator.selectorLabels" . | nindent 6 }}
app.kubernetes.io/name: {{ include "opendcs-operator.name" . }}-lrgs
template:
metadata:
{{- with .Values.podAnnotations }}
Expand All @@ -22,6 +21,7 @@ spec:
{{- with .Values.podLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
app.kubernetes.io/name: {{ include "opendcs-operator.name" . }}-lrgs
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
Expand All @@ -34,8 +34,8 @@ spec:
- name: {{ .Chart.Name }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
image: "{{ .Values.lrgs.image.repository }}:{{ .Values.lrgs.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.lrgs.image.pullPolicy | default .Values.image.pullPolicy }}
command: ["/lrgs"]
ports:
- containerPort: 8080
Expand Down
59 changes: 59 additions & 0 deletions charts/opendcs-operator/templates/schema-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "opendcs-operator.fullname" . }}-schema
labels:
{{- include "opendcs-operator.labels" . | nindent 4 }}
spec:
replicas: 1
selector:
matchLabels:
{{- include "opendcs-operator.selectorLabels" . | nindent 6 }}
app.kubernetes.io/name: {{ include "opendcs-operator.name" . }}-schema
template:
metadata:
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "opendcs-operator.labels" . | nindent 8 }}
{{- with .Values.podLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
app.kubernetes.io/name: {{ include "opendcs-operator.name" . }}-schema
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "opendcs-operator.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
containers:
- name: {{ .Chart.Name }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.schema.image.repository }}:{{ .Values.schema.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.schema.image.pullPolicy | default .Values.image.pullPolicy }}
command: ["/schema"]
ports:
- containerPort: 8080
name: http
resources:
{{- toYaml .Values.resources | nindent 12 }}
env:
- name: RUST_LOG
value: {{ .Values.log_level }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
29 changes: 29 additions & 0 deletions charts/opendcs-operator/templates/serviceaccount.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,22 @@ rules:
verbs: ["create"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: tsdb-operator-role
rules:
- apiGroups: ["tsdb.opendcs.org"]
resources: ["*"]
verbs: ["*"]
- apiGroups: ["batch","apps",""]
resources: ["pods","services","deployments","jobs","secrets","configmaps"]
verbs: ["*"]
# If you want events
- apiGroups: ["events.k8s.io"]
resources: ["events"]
verbs: ["create"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: lrgs-controller-binding
Expand All @@ -39,4 +55,17 @@ subjects:
- kind: ServiceAccount
name: {{ include "opendcs-operator.serviceAccountName" . }}
namespace: {{ .Release.Namespace }}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: tsdb-controller-binding
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: tsdb-operator-role
subjects:
- kind: ServiceAccount
name: {{ include "opendcs-operator.serviceAccountName" . }}
namespace: {{ .Release.Namespace }}
{{- end }}
15 changes: 15 additions & 0 deletions charts/opendcs-operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -87,3 +87,18 @@ nodeSelector: {}
tolerations: []

affinity: {}


lrgs:
image:
repository: ghcr.io/opendcs/k8s/lrgs-controller
pullPolicy: IfNotPresent
# Overrides the image tag whose default is the chart appVersion.
tag: ""

schema:
image:
repository: ghcr.io/opendcs/k8s/schema-controller
pullPolicy: IfNotPresent
# Overrides the image tag whose default is the chart appVersion.
tag: ""