Skip to content

Commit

Permalink
Merge pull request #100 from severalnines/163-severalnines/helm-ccx-r…
Browse files Browse the repository at this point in the history
…elease/1.51

Run 163 Merge repo severalnines/helm-ccx of branch release/1.51 into default branch
  • Loading branch information
Wojciech-Niemkowski authored Dec 17, 2024
2 parents 84c08d4 + bad4c89 commit 1922e82
Show file tree
Hide file tree
Showing 17 changed files with 520 additions and 133 deletions.
2 changes: 1 addition & 1 deletion charts/ccx/.helmignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@
.project
.idea/
*.tmproj
.vscode/
.vscode/
4 changes: 2 additions & 2 deletions charts/ccx/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ icon: https://st.s9s.io/ccx/logo/ccx-purple.svg
# 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: 1.50.9
version: 1.51.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. 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.
# THIS IS THE CCX RELEASE VERSION
appVersion: "1.50.9"
appVersion: "1.51.0"
52 changes: 0 additions & 52 deletions charts/ccx/files/fluent-bit.conf

This file was deleted.

62 changes: 17 additions & 45 deletions charts/ccx/minimal-values-cloudstack.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
secgroups: &secgroups
security_groups:
- cidr: ip_of_k8s_nodes_where_ccx_is_runnig/32
from_port: 22
ip_protocol: tcp
to_port: 22
- cidr: ip_of_k8s_nodes_where_ccx_is_runnig/32
from_port: 1000
ip_protocol: tcp
self: true
to_port: 65535

sessionDomain: ccx.mycloud.com
ccxFQDN: ccx.mycloud.com
ccx:
Expand Down Expand Up @@ -55,52 +67,12 @@ ccx:
zone: "00000000-0000-0000-0000-000000000000"
database_vendors:
- name: mariadb
security_groups:
- cidr: cmon_ip/32
from_port: 22
ip_protocol: tcp
to_port: 22
- cidr: cmon_ip/32
from_port: 1000
ip_protocol: tcp
to_port: 65535
<<: *secgroups
- name: microsoft
security_groups:
- cidr: cmon_ip/32
from_port: 22
ip_protocol: tcp
to_port: 22
- cidr: cmon_ip/32
from_port: 1000
ip_protocol: tcp
to_port: 65535
<<: *secgroups
- name: percona
security_groups:
- cidr: cmon_ip/32
from_port: 22
ip_protocol: tcp
to_port: 22
- cidr: cmon_ip/32
from_port: 1000
ip_protocol: tcp
to_port: 65535
<<: *secgroups
- name: postgres
security_groups:
- cidr: cmon_ip/32
from_port: 22
ip_protocol: tcp
to_port: 22
- cidr: 37.30.16.41/32
from_port: 1000
ip_protocol: tcp
to_port: 65535
<<: *secgroups
- name: redis
security_groups:
- cidr: cmon_ip/32
from_port: 22
ip_protocol: tcp
to_port: 22
- cidr: cmon_ip/32
from_port: 1000
ip_protocol: tcp
to_port: 65535
<<: *secgroups
1 change: 1 addition & 0 deletions charts/ccx/scripts/gather-logs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -93,3 +93,4 @@ kill -9 %1 2>/dev/null

echo Done.
echo Logs available at ${OUTPUT_FILE}

23 changes: 22 additions & 1 deletion charts/ccx/templates/NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,25 @@ Set it in `ccx.cloudSecrets` value.
Please see https://severalnines.github.io/ccx-docs/docs/admin/Installation/#providing-cloud-credentials on how to do that.
You can still access CCX however, you won't be able to create any datastores!
***************************************************************************************
{{ end }}
{{ end }}

{{- if .Values.fluentbit.enabled }}
{{- if eq .Values.fluentbit.host (include "ccx.ccxFQDN" .) }}
{{- $service := lookup "v1" "Service" .Release.Namespace "ccxdeps-loki-gateway" -}}
{{- if not $service }}
***********************************WARNING***************************************************************
Service 'ccxdeps-loki-gateway' was not found!

Please ensure you have updated and deployed ccxdeps else logging feature will be disabled for you.
*********************************************************************************************************
{{- end }}
{{- end }}
{{- end }}

{{- if (include "checkKeycloakServiceExists" . | eq "false") }}
***********************************WARNING***************************************************************
Service 'keycloak' was not found!

Please ensure you have updated and deployed ccxdeps else 'SSO' feature will be disabled for you.
*********************************************************************************************************
{{- end }}
25 changes: 23 additions & 2 deletions charts/ccx/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -138,15 +138,36 @@ Create the name of the service account to use
{{- end }}
{{- end }}

{{- define "ccx.checkFluentBitConfig" -}}
{{- if and .Values.fluentbit.enabled (not .Values.fluentbit.hostSet) }}
{{- if not .Values.fluentbit.host }}
{{- $_ := set .Values.fluentbit "host" (printf "%s" (include "ccx.ccxFQDN" .)) }}
{{- $_ := set .Values.fluentbit "hostSet" true }}
{{- else if ne .Values.fluentbit.host "loki.local" }}
{{- $_ := set .Values.fluentbit "hostSet" true }}
{{- else }}
{{- $_ := set .Values.fluentbit "host" (printf "%s" (include "ccx.ccxFQDN" .)) }}
{{- end }}
{{- end }}
{{- end }}

{{- define "checkKeycloakServiceExists" -}}
{{- $keycloak := (lookup "v1" "Service" .Release.Namespace "keycloak") }}
{{- if $keycloak }}
{{- "true" }}
{{- else -}}
{{- "false" }}
{{- end -}}
{{- end -}}

{{- define "ccx.services.admin.basicauth.username" -}}
{{- $secretObj := (lookup "v1" "Secret" .Release.Namespace "admin-basicauth") | default dict }}
{{- $secretObj := (lookup "v1" "Secret" .Release.Namespace "admin-basic-auth") | default dict }}
{{- $secretData := (get $secretObj "data") | default dict }}
{{- or (get $secretData "ADMIN_AUTH_USERNAME" | b64dec) .Values.ccx.services.admin.basicauth.username | default "admin" }}
{{- end -}}

{{- define "ccx.services.admin.basicauth.password" -}}
{{- $secretObj := (lookup "v1" "Secret" .Release.Namespace "admin-basicauth") | default dict }}
{{- $secretObj := (lookup "v1" "Secret" .Release.Namespace "admin-basic-auth") | default dict }}
{{- $secretData := (get $secretObj "data") | default dict }}
{{- or (get $secretData "ADMIN_AUTH_PASSWORD" | b64dec) .Values.ccx.services.admin.basicauth.password | default (randAlphaNum 16) }}
{{- end -}}
Expand Down
7 changes: 7 additions & 0 deletions charts/ccx/templates/ccx/ccx-auth-service.deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@ spec:
image: {{ .Values.ccx.services.auth.image | default .Values.ccx.backend.image | required "No image set for auth" }}
command: ["/bin/ccx-auth-service"]
env:
{{ if (include "checkKeycloakServiceExists" . | eq "true") }}
- name: KEYCLOAK_PASSWORD
valueFrom:
secretKeyRef:
name: keycloak
key: admin-password
{{ end }}
{{- range $key, $val := .Values.ccx.services.auth.env }}
- name: {{ $key }}
value: {{ $val | quote }}
Expand Down
28 changes: 16 additions & 12 deletions charts/ccx/templates/ccx/ccx-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -95,19 +95,23 @@ data:
source: "/conf/fluent-bit.conf"
owner: "root:root"
perms: "0644"
- target: "/etc/fluent-bit/parsers-multiline.conf"
source: "/conf/parsers-multiline.conf"
owner: "root:root"
perms: "0644"
{{- end }}
{{- if and .Values.fluentbit.enabled .Values.fluentbit.extraOutputConfig }}
- target: "/etc/fluent-bit/extra_output.conf"
source: "/conf/extra_output.conf"
owner: "root:root"
perms: "0644"
{{- end }}
{{- range .Values.ccx.services.deployer.extraCopyFiles }}
- target: {{ .target }}
source: {{ .source }}
owner: {{ .owner }}
perms: {{ .perms }}
{{- end }}
{{- if .Values.fluentbit.enabled }}
---
apiVersion: v1
kind: ConfigMap
metadata:
name: ccx-config-fluentbit
data:
# fluent bit config
{{- $fluentbit_conf := .Values.fluentbit.config | default (printf "%v" (.Files.Get "files/fluent-bit.conf")) }}
fluent-bit.conf: |
{{ $fluentbit_conf | indent 4 }}
{{- end }}
---
apiVersion: v1
kind: ConfigMap
Expand Down
Loading

0 comments on commit 1922e82

Please sign in to comment.