Skip to content

Commit

Permalink
feat: Add eck olm-subscription (#66)
Browse files Browse the repository at this point in the history
* 1. add elastic-cloud-eck olm-subscription;
2. respect Subscription channel for all components.

* remove duplicated channle value
  • Loading branch information
ignacioli authored Oct 17, 2023
1 parent 73acc1b commit 0a5dfff
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 0 deletions.
11 changes: 11 additions & 0 deletions modules/olm-subscriptions/chart/templates/_helper.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -102,4 +102,15 @@ Get subscription config for zookeeper
{{- else }}
{{- toYaml .Values.subscriptionConfig.resources | nindent 6 }}
{{- end }}
{{- end }}

{{/*
Get subscription config for elastic_cloud_eck
*/}}
{{- define "subscription.eckResources" -}}
{{- if .Values.elastic_cloud_eck.config.resources }}
{{- toYaml .Values.elastic_cloud_eck.config.resources | nindent 6 }}
{{- else }}
{{- toYaml .Values.subscriptionConfig.resources | nindent 6 }}
{{- end }}
{{- end }}
43 changes: 43 additions & 0 deletions modules/olm-subscriptions/chart/templates/elastic-cloud-eck.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Copyright 2023 StreamNative, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#

{{- if and .Values.components.elastic_cloud_eck }}
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
name: {{ .Values.elastic_cloud_eck.name }}
namespace: {{ .Values.install_namespace }}
spec:
channel: {{ .Values.elastic_cloud_eck.channel | default .Values.channel }}
installPlanApproval: {{ .Values.elastic_cloud_eck.approval | default .Values.approval }}
source: {{ .Values.elastic_cloud_eck.source }}
sourceNamespace: {{ .Values.olm_namespace }}
name: {{ .Values.elastic_cloud_eck.name }}
config:
{{- if .Values.tolerations }}
tolerations:
{{ toYaml .Values.tolerations | indent 4 }}
{{- end }}
resources: {{ include "subscription.eckResources" . }}
{{- if .Values.elastic_cloud_eck.config.env }}
env:
{{- toYaml .Values.elastic_cloud_eck.config.env | nindent 4 }}
{{- end }}
{{- if .Values.elastic_cloud_eck.config.envFrom }}
envFrom:
{{- toYaml .Values.elastic_cloud_eck.config.envFrom | nindent 4 }}
{{- end }}
{{- end }}
6 changes: 6 additions & 0 deletions modules/olm-subscriptions/chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ components:
flinkSql: true
zookeeper: true
sn_operator: true
elastic_cloud_eck: true

subscriptionConfig:
resources:
Expand Down Expand Up @@ -96,3 +97,8 @@ sn_operator:
source: sn-catalog
name: sn-operator
config: {}

elastic_cloud_eck:
source: operatorhubio-catalog
name: elastic-cloud-eck
config: {}

0 comments on commit 0a5dfff

Please sign in to comment.