UNCLASSIFIED

Commit b91507ac authored by bhearn's avatar bhearn
Browse files

Merge branch 'redis-test' into 'main'

update redis dep

See merge request !35
parents 4cfc9c82 74512f88
Pipeline #312446 passed with stages
in 4 minutes and 25 seconds
{{- if and .Values.usePassword (not .Values.existingSecret) -}} {{- if and .Values.auth.enabled (not .Values.auth.existingSecret) -}}
{{- $secretName := include "redis.fullname" . -}}
{{- $secret := (lookup "v1" "Secret" .Release.Namespace $secretName ) -}}
apiVersion: v1 apiVersion: v1
kind: Secret kind: Secret
metadata: metadata:
name: {{ $secretName }} name: {{ include "redis.secretName" . }}
namespace: {{ .Release.Namespace | quote }} namespace: {{ .Release.Namespace | quote }}
labels: labels: {{- include "common.labels.standard" . | nindent 4 }}
app: {{ template "redis.name" . }} {{- if .Values.commonLabels }}
chart: {{ template "redis.chart" . }} {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
release: "{{ .Release.Name }}" {{- end }}
heritage: "{{ .Release.Service }}" {{- if .Values.commonAnnotations }}
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
type: Opaque type: Opaque
data: data:
{{ if $secret }}
{{ with $secret }}
redis-password: {{ get .data "redis-password" }}
{{ end }}
{{ else }}
redis-password: {{ include "redis.password" . | b64enc | quote }} redis-password: {{ include "redis.password" . | b64enc | quote }}
{{- end -}} {{- end -}}
{{- end -}}
\ No newline at end of file
{{- if and (eq .Values.architecture "replication") .Values.sentinel.enabled }}
apiVersion: v1
kind: Service
metadata:
name: {{ template "common.names.fullname" . }}
namespace: {{ .Release.Namespace | quote }}
labels: {{- include "common.labels.standard" . | nindent 4 }}
app.kubernetes.io/component: node
{{- if .Values.commonLabels }}
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
{{- end }}
{{- if or .Values.sentinel.service.annotations .Values.commonAnnotations }}
annotations:
{{- if .Values.sentinel.service.annotations }}
{{- include "common.tplvalues.render" ( dict "value" .Values.sentinel.service.annotations "context" $ ) | nindent 4 }}
{{- end }}
{{- if .Values.commonAnnotations }}
{{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
{{- end }}
spec:
type: {{ .Values.sentinel.service.type }}
{{- if eq .Values.sentinel.service.type "LoadBalancer" }}
externalTrafficPolicy: {{ .Values.sentinel.service.externalTrafficPolicy }}
{{- end }}
{{- if and (eq .Values.sentinel.service.type "LoadBalancer") .Values.sentinel.service.loadBalancerIP }}
loadBalancerIP: {{ .Values.sentinel.service.loadBalancerIP }}
{{- end }}
{{- if and (eq .Values.sentinel.service.type "LoadBalancer") .Values.sentinel.service.loadBalancerSourceRanges }}
loadBalancerSourceRanges: {{- toYaml .Values.sentinel.service.loadBalancerSourceRanges | nindent 4 }}
{{- end }}
{{- if and (eq .Values.sentinel.service.type "ClusterIP") .Values.sentinel.service.clusterIP }}
clusterIP: {{ .Values.sentinel.service.clusterIP }}
{{- end }}
ports:
- name: tcp-redis
port: {{ .Values.sentinel.service.port }}
targetPort: redis
{{- if and (or (eq .Values.sentinel.service.type "NodePort") (eq .Values.sentinel.service.type "LoadBalancer")) .Values.sentinel.service.nodePorts.redis }}
nodePort: {{ .Values.sentinel.service.nodePorts.redis }}
{{- else if eq .Values.sentinel.service.type "ClusterIP" }}
nodePort: null
{{- end }}
- name: tcp-sentinel
port: {{ .Values.sentinel.service.sentinelPort }}
targetPort: redis-sentinel
{{- if and (or (eq .Values.sentinel.service.type "NodePort") (eq .Values.sentinel.service.type "LoadBalancer")) .Values.sentinel.service.nodePorts.sentinel }}
nodePort: {{ .Values.sentinel.service.nodePorts.sentinel }}
{{- else if eq .Values.sentinel.service.type "ClusterIP" }}
nodePort: null
{{- end }}
selector: {{- include "common.labels.matchLabels" . | nindent 4 }}
app.kubernetes.io/component: node
{{- end }}
{{- if .Values.serviceAccount.create }}
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ template "redis.serviceAccountName" . }}
namespace: {{ .Release.Namespace | quote }}
labels: {{- include "common.labels.standard" . | nindent 4 }}
{{- if .Values.commonLabels }}
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
{{- end }}
{{- if or .Values.commonAnnotations .Values.serviceAccount.annotations }}
annotations:
{{- if or .Values.commonAnnotations }}
{{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
{{- if .Values.serviceAccount.annotations }}
{{- include "common.tplvalues.render" ( dict "value" .Values.serviceAccount.annotations "context" $ ) | nindent 4 }}
{{- end }}
{{- end }}
{{- end }}
{{- if and .Values.metrics.enabled .Values.metrics.serviceMonitor.enabled }}
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: {{ template "common.names.fullname" . }}
{{- if .Values.metrics.serviceMonitor.namespace }}
namespace: {{ .Values.metrics.serviceMonitor.namespace }}
{{- else }}
namespace: {{ .Release.Namespace | quote }}
{{- end }}
labels: {{- include "common.labels.standard" . | nindent 4 }}
{{- if .Values.metrics.serviceMonitor.additionalLabels }}
{{- include "common.tplvalues.render" (dict "value" .Values.metrics.serviceMonitor.additionalLabels "context" $) | nindent 4 }}
{{- end }}
{{- if .Values.commonLabels }}
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
{{- end }}
{{- if .Values.commonAnnotations }}
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
spec:
endpoints:
- port: tcp-metrics
{{- if .Values.metrics.serviceMonitor.interval }}
interval: {{ .Values.metrics.serviceMonitor.interval }}
{{- end }}
{{- if .Values.metrics.serviceMonitor.scrapeTimeout }}
scrapeTimeout: {{ .Values.metrics.serviceMonitor.scrapeTimeout }}
{{- end }}
{{- if .Values.metrics.serviceMonitor.honorLabels }}
honorLabels: {{ .Values.metrics.serviceMonitor.honorLabels }}
{{- end }}
{{- if .Values.metrics.serviceMonitor.relabellings }}
metricRelabelings: {{- toYaml .Values.metrics.serviceMonitor.relabellings | nindent 6 }}
{{- end }}
namespaceSelector:
matchNames:
- {{ .Release.Namespace }}
selector:
matchLabels: {{- include "common.labels.matchLabels" . | nindent 6 }}
app.kubernetes.io/component: metrics
{{- if .Values.metrics.sentinel.enabled }}
---
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: {{ printf "%s-sentinel" (include "common.names.fullname" .) }}
{{- if .Values.metrics.serviceMonitor.namespace }}
namespace: {{ .Values.metrics.serviceMonitor.namespace }}
{{- else }}
namespace: {{ .Release.Namespace | quote }}
{{- end }}
labels: {{- include "common.labels.standard" . | nindent 4 }}
{{- if .Values.metrics.serviceMonitor.additionalLabels }}
{{- include "common.tplvalues.render" (dict "value" .Values.metrics.serviceMonitor.additionalLabels "context" $) | nindent 4 }}
{{- end }}
{{- if .Values.commonLabels }}
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
{{- end }}
{{- if .Values.commonAnnotations }}
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
spec:
endpoints:
- port: tcp-metrics
{{- if .Values.metrics.serviceMonitor.interval }}
interval: {{ .Values.metrics.serviceMonitor.interval }}
{{- end }}
{{- if .Values.metrics.serviceMonitor.scrapeTimeout }}
scrapeTimeout: {{ .Values.metrics.serviceMonitor.scrapeTimeout }}
{{- end }}
{{- if .Values.metrics.serviceMonitor.honorLabels }}
honorLabels: {{ .Values.metrics.serviceMonitor.honorLabels }}
{{- end }}
{{- if .Values.metrics.serviceMonitor.relabellings }}
metricRelabelings: {{- toYaml .Values.metrics.serviceMonitor.relabellings | nindent 6 }}
{{- end }}
namespaceSelector:
matchNames:
- {{ .Release.Namespace }}
selector:
matchLabels: {{- include "common.labels.matchLabels" . | nindent 6 }}
app.kubernetes.io/component: sentinel-metrics
{{- end }}
{{- end }}
...@@ -2,39 +2,30 @@ ...@@ -2,39 +2,30 @@
"$schema": "http://json-schema.org/schema#", "$schema": "http://json-schema.org/schema#",
"type": "object", "type": "object",
"properties": { "properties": {
"usePassword": { "architecture": {
"type": "boolean",
"title": "Use password authentication",
"form": true
},
"password": {
"type": "string", "type": "string",
"title": "Password", "title": "Redis architecture",
"form": true, "form": true,
"description": "Defaults to a random 10-character alphanumeric string if not set", "description": "Allowed values: `standalone` or `replication`"
"hidden": {
"value": false,
"path": "usePassword"
}
}, },
"cluster": { "auth": {
"type": "object", "type": "object",
"title": "Cluster Settings", "title": "Authentication configuration",
"form": true, "form": true,
"properties": { "properties": {
"enabled": { "enabled": {
"type": "boolean", "type": "boolean",
"form": true, "form": true,
"title": "Enable master-slave", "title": "Use password authentication"
"description": "Enable master-slave architecture"
}, },
"slaveCount": { "password": {
"type": "integer", "type": "string",
"title": "Slave Replicas", "title": "Redis password",
"form": true, "form": true,
"description": "Defaults to a random 10-character alphanumeric string if not set",
"hidden": { "hidden": {
"value": false, "value": false,
"path": "cluster/enabled" "path": "auth/enabled"
} }
} }
} }
...@@ -67,31 +58,28 @@ ...@@ -67,31 +58,28 @@
"value": false, "value": false,
"path": "master/persistence/enabled" "path": "master/persistence/enabled"
} }
},
"matchLabels": {
"type": "object",
"title": "Persistent Match Labels Selector"
},
"matchExpressions": {
"type": "object",
"title": "Persistent Match Expressions Selector"
} }
} }
} }
} }
}, },
"slave": { "replica": {
"type": "object", "type": "object",
"title": "Slave replicas settings", "title": "Redis replicas settings",
"form": true, "form": true,
"hidden": { "hidden": {
"value": false, "value": "standalone",
"path": "cluster/enabled" "path": "architecture"
}, },
"properties": { "properties": {
"replicaCount": {
"type": "integer",
"form": true,
"title": "Number of Redis replicas"
},
"persistence": { "persistence": {
"type": "object", "type": "object",
"title": "Persistence for slave replicas", "title": "Persistence for Redis replicas",
"form": true, "form": true,
"properties": { "properties": {
"enabled": { "enabled": {
...@@ -110,16 +98,8 @@ ...@@ -110,16 +98,8 @@
"sliderUnit": "Gi", "sliderUnit": "Gi",
"hidden": { "hidden": {
"value": false, "value": false,
"path": "slave/persistence/enabled" "path": "replica/persistence/enabled"
} }
},
"matchLabels": {
"type": "object",
"title": "Persistent Match Labels Selector"
},
"matchExpressions": {
"type": "object",
"title": "Persistent Match Expressions Selector"
} }
} }
} }
......
This diff is collapsed.
...@@ -80,7 +80,7 @@ spec: ...@@ -80,7 +80,7 @@ spec:
env: env:
{{- if and (index .Values "anchoreEnterpriseUi" "existingSecret") (not (index .Values "anchore-ui-redis" "externalEndpoint")) }} {{- if and (index .Values "anchoreEnterpriseUi" "existingSecret") (not (index .Values "anchore-ui-redis" "externalEndpoint")) }}
- name: ANCHORE_REDIS_URI - name: ANCHORE_REDIS_URI
value: redis://nouser:{{ index .Values "anchore-ui-redis" "password" }}@{{ template "redis.fullname" . }}-master:6379 value: redis://nouser:{{ index .Values "anchore-ui-redis" "auth" "password" }}@{{ template "redis.fullname" . }}-master:6379
{{- end }} {{- end }}
{{ if .Values.anchoreGlobal.dbConfig.ssl }} {{ if .Values.anchoreGlobal.dbConfig.ssl }}
- name: PGSSLROOTCERT - name: PGSSLROOTCERT
......
...@@ -23,7 +23,7 @@ stringData: ...@@ -23,7 +23,7 @@ stringData:
{{- if and (index .Values "anchore-ui-redis" "externalEndpoint") (not (index .Values "anchore-ui-redis" "enabled")) }} {{- if and (index .Values "anchore-ui-redis" "externalEndpoint") (not (index .Values "anchore-ui-redis" "enabled")) }}
ANCHORE_REDIS_URI: '{{ index .Values "anchore-ui-redis" "externalEndpoint" }}' ANCHORE_REDIS_URI: '{{ index .Values "anchore-ui-redis" "externalEndpoint" }}'
{{- else }} {{- else }}
ANCHORE_REDIS_URI: 'redis://nouser:{{ index .Values "anchore-ui-redis" "password" }}@{{ template "redis.fullname" . }}-master:6379' ANCHORE_REDIS_URI: 'redis://nouser:{{ index .Values "anchore-ui-redis" "auth" "password" }}@{{ template "redis.fullname" . }}-master:6379'
{{- end }} {{- end }}
{{- end }} {{- end }}
{{- end }} {{- end }}
...@@ -1067,7 +1067,8 @@ anchoreEnterpriseUi: ...@@ -1067,7 +1067,8 @@ anchoreEnterpriseUi:
# Anchore Engine Enterprise UI is dependent on redis for storing sessions # Anchore Engine Enterprise UI is dependent on redis for storing sessions
# Only utilized if 'anchoreEnterpriseUi.enabled: true' # Only utilized if 'anchoreEnterpriseUi.enabled: true'
anchore-ui-redis: anchore-ui-redis:
password: anchore-redis,123 auth:
password: anchore-redis,123
# To use an external redis endpoint, uncomment to set 'enabled: false' # To use an external redis endpoint, uncomment to set 'enabled: false'
# enabled: false # enabled: false
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment