Compare commits

...

6 Commits

Author SHA1 Message Date
Andrei Kvapil
fe70003c5e Add openshft-console
Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
2024-12-18 15:41:49 +01:00
Andrei Kvapil
e44bece114 Prepare release v0.20.2 2024-12-13 09:54:12 +01:00
Andrei Kvapil
0822928f53 Fix API resource for Redis (#526) 2024-12-12 14:46:19 +01:00
klinch0
2e0ae0bd0a fix disable oidc (#525)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **Bug Fixes**
- Improved conditional logic for OIDC functionality, ensuring accurate
deployment of related components.
- **Chores**
- Updated dependencies for the `keycloak` release to ensure proper
operation with the `postgres-operator`.
- **New Features**
- Enhanced configuration handling for OIDC, affecting the inclusion of
related components based on strict equality checks.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2024-12-11 10:28:20 +01:00
Andrei Kvapil
3ff1709826 Prepare release v0.20.1 2024-12-10 13:19:04 +01:00
Andrei Kvapil
ebe9a1b0a5 Fix Terraform compatibility (#524)
Signed-off-by: Andrei Kvapil <kvapss@gmail.com>


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- **New Features**
- Enhanced dynamic registration capabilities for internal API versions
of `Application` and `ApplicationList`.
- Added configuration management for server options, allowing users to
specify a resource configuration path via command line.
  
- **Bug Fixes**
	- Improved error handling for loading resource configurations.

- **Documentation**
- Updated OpenAPI specification handling by removing certain definitions
post-processing.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
2024-12-10 12:40:29 +01:00
44 changed files with 1204 additions and 20 deletions

View File

@@ -68,7 +68,7 @@ spec:
serviceAccountName: cozystack
containers:
- name: cozystack
image: "ghcr.io/aenix-io/cozystack/cozystack:v0.20.0"
image: "ghcr.io/aenix-io/cozystack/cozystack:v0.20.2"
env:
- name: KUBERNETES_SERVICE_HOST
value: localhost
@@ -87,7 +87,7 @@ spec:
fieldRef:
fieldPath: metadata.name
- name: darkhttpd
image: "ghcr.io/aenix-io/cozystack/cozystack:v0.20.0"
image: "ghcr.io/aenix-io/cozystack/cozystack:v0.20.2"
command:
- /usr/bin/darkhttpd
- /cozystack/assets

View File

@@ -1 +1 @@
ghcr.io/aenix-io/cozystack/postgres-backup:0.7.1@sha256:4d934b40075b0781265faca8c70f39d92602df82f00ef4dfeb5481e973575662
ghcr.io/aenix-io/cozystack/postgres-backup:0.7.1@sha256:406d2c5a30fa8b6fe10eab3cba45c06fea3876e81fd123ead6dc3c19347762d0

View File

@@ -1 +1 @@
ghcr.io/aenix-io/cozystack/cluster-autoscaler:0.14.1@sha256:1cfca75874f03834426969f9e011b4d24da4a8a7d67d8cc5b8ad916189515766
ghcr.io/aenix-io/cozystack/cluster-autoscaler:0.14.1@sha256:b63293bc295e8c04574900bb711ebfe51db6774beb6bc3a58791562ec11b406b

View File

@@ -1 +1 @@
ghcr.io/aenix-io/cozystack/kubevirt-cloud-provider:0.14.1@sha256:ee4527c2e0a19edcedf3a93ae6d9462a6263af4c2cb0feaab218ff94ed01f3a4
ghcr.io/aenix-io/cozystack/kubevirt-cloud-provider:0.14.1@sha256:c0561a342e6b55d066f3363182f442e8fa30a0b6b448d89d15a1a855c999b98e

View File

@@ -1 +1 @@
ghcr.io/aenix-io/cozystack/kubevirt-csi-driver:0.14.1@sha256:89d0e7ddce51370c350da0f5f884030d73d4e219cd34b6017c9c08a4c3dd0ece
ghcr.io/aenix-io/cozystack/kubevirt-csi-driver:0.14.1@sha256:4b84a077e7f1b75bdf8b272c8f147e4ef3b67b9bea83383a399e9149868384ac

View File

@@ -1 +1 @@
ghcr.io/aenix-io/cozystack/ubuntu-container-disk:v1.30.1@sha256:1b82ac6e0c0e5e3a3a0793609ada90f7b21ba290967afe214bdce76b28a8f88a
ghcr.io/aenix-io/cozystack/ubuntu-container-disk:v1.30.1@sha256:91ec9c31472f8e94ae5f6f5a2568058eb28b3f57ab7e203d8d4a0993911fffc3

View File

@@ -1 +1 @@
ghcr.io/aenix-io/cozystack/mariadb-backup:0.5.2@sha256:1d9a9d5ab0c785e40d7dd1fe40422e229ca2ff80a194014765072c3bbfe98b07
ghcr.io/aenix-io/cozystack/mariadb-backup:0.5.2@sha256:f6435ce02b1bf4d7b2422676e84bc2299725ed2cfb93922e40f40a695d54b9d3

View File

@@ -1 +1 @@
ghcr.io/aenix-io/cozystack/postgres-backup:0.7.1@sha256:4d934b40075b0781265faca8c70f39d92602df82f00ef4dfeb5481e973575662
ghcr.io/aenix-io/cozystack/postgres-backup:0.7.1@sha256:406d2c5a30fa8b6fe10eab3cba45c06fea3876e81fd123ead6dc3c19347762d0

View File

@@ -1,2 +1,2 @@
cozystack:
image: ghcr.io/aenix-io/cozystack/cozystack:v0.20.0@sha256:c4fedc707857aea08fd26508ca8d179581533a90a4665cb9bd71fa90d9955348
image: ghcr.io/aenix-io/cozystack/cozystack:v0.20.2@sha256:061668fa81344302f1097482418fe7925d77ca74ccc856dcb739119590523136

View File

@@ -223,7 +223,7 @@ releases:
{{- end }}
{{- end }}
{{- end }}
{{- if $oidcEnabled }}
{{- if eq $oidcEnabled "true" }}
dependsOn: [keycloak-configure]
valuesFrom:
- kind: ConfigMap
@@ -233,6 +233,12 @@ releases:
dependsOn: []
{{- end }}
- name: console
releaseName: console
chart: cozy-console
namespace: cozy-console
dependsOn: [cilium,kubeovn]
- name: kamaji
releaseName: kamaji
chart: cozy-kamaji

View File

@@ -153,7 +153,7 @@ releases:
{{- end }}
{{- end }}
{{- end }}
{{- if $oidcEnabled }}
{{- if eq $oidcEnabled "true" }}
dependsOn: [keycloak-configure]
valuesFrom:
- kind: ConfigMap
@@ -163,6 +163,12 @@ releases:
dependsOn: []
{{- end }}
- name: console
releaseName: console
chart: cozy-console
namespace: cozy-console
dependsOn: [cilium,kubeovn]
{{- if $oidcEnabled }}
- name: keycloak
releaseName: keycloak

View File

@@ -1,2 +1,2 @@
e2e:
image: ghcr.io/aenix-io/cozystack/e2e-sandbox:v0.20.0@sha256:1a26a511b9e269bcb607e2d80f878d7c2d993b7a2a7a3a2a1042470c8c56b061
image: ghcr.io/aenix-io/cozystack/e2e-sandbox:v0.20.2@sha256:1a26a511b9e269bcb607e2d80f878d7c2d993b7a2a7a3a2a1042470c8c56b061

View File

@@ -1 +1 @@
ghcr.io/aenix-io/cozystack/s3manager:v0.5.0@sha256:cb80a89e0fe516b3f788df9af8ed1980103659fd0e0ae18e46c01dd4d1578346
ghcr.io/aenix-io/cozystack/s3manager:v0.5.0@sha256:e0cb068804546e4152ce4cf7a7c315a5a2a669a7236c9fe47371de934cdf99a9

View File

@@ -0,0 +1,3 @@
apiVersion: v2
name: cozy-console
version: 0.0.0 # Placeholder, the actual version will be automatically set during the build process

View File

@@ -0,0 +1,5 @@
export NAME=console
export NAMESPACE=cozy-$(NAME)
include ../../../scripts/common-envs.mk
include ../../../scripts/package.mk

View File

@@ -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/

View File

@@ -0,0 +1,7 @@
apiVersion: v2
appVersion: 4.20.0
description: OpenShift Cluster Console UI
icon: https://avatars0.githubusercontent.com/u/792337?s=200&v=4
name: openshift-console
type: application
version: 0.3.6

View File

@@ -0,0 +1,75 @@
# OpenShift Console (Bridge)
[Bridge](https://github.com/openshift/console) is the OpenShift console.
## TL;DR
```console
$ helm repo add av1o https://av1o.gitlab.io/charts
$ helm install bridge av1o/openshift-console
```
## Introduction
This chart bootstraps a deployment of the OpenShift Console on a [Kubernetes](https://kubernetes.io) cluster using the [Helm](https://helm.sh) package manager.
The OpenShift Console is designed for running on OpenShift, however it works perfectly fine in native Kubernetes. Since the Console is unable to use the default OpenShift OAuth2, this chart is expecting a Dex deployment which is configured to generate OIDC tokens for the Kubernetes API server.
This behaviour can be configured with the `extraEnv` map.
## Prerequisites
- Kubernetes 1.12+
- Helm 3
## Installing the Chart
To install the chart with the release name `my-release`:
```console
$ helm install my-release av1o/openshift-console
```
The command deploys the console on the Kubernetes cluster in the default configuration.
> **Tip**: List all releases using `helm list`
## Uninstalling the Chart
To uninstall/delete the `my-release` deployment:
```console
$ helm delete my-release
```
## Parameters
The following table lists the configurable parameters of the OpenShift Console chart and their default values.
| Parameter | Description | Default |
|--------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------|
| `replicaCount` | Number of pods to run | 1 |
| `image.registry` | Docker image registry | `quay.io` |
| `image.repository` | Docker image name | `openshift/origin-console` |
| `image.pullPolicy` | Docker image pull policy | `IfNotPresent` |
| `image.tag` | Docker image tag | `${CHART_VERSION}` |
| `imagePullSecrets` | Specify Image pull secrets | `[]` |
| `podAnnotations` | Map of annotations to add to the pods | See `values.yaml` |
| `podSecurityContext` | Map of security context to add to the pod | See `values.yaml` |
| `securityContext` | Map of security context to add to the container | See `values.yaml` |
| `service.type` | Service type | `ClusterIP` |
| `extraEnv` | Map of environment variables to include in the container | `{}` |
| `console.dex.host` | HTTP(S) address of the Dex instance | `https://dex.example.org` |
| `console.baseUrl` | HTTP(S) address of the Console | `https://console.example.org` |
| `console.impersonateOpenShift` | Install CRDs to trick the Console into showing some OpenShift-exclusive actions which work on Kubernetes. Note: requires `cluster-admin` | `false` |
| `console.oidc.enabled` | Enable OIDC authentication | `true` |
| `console.oidc.issuerUrl` | Issuer of the OIDC server | `https://dex.example.org` |
| `console.oidc.clientId` | OIDC client ID | `kubernetes` |
| `console.oidc.clientSecret` | OIDC client secret | `hunter2` |
| `rbac.enabled` | Install RBAC to trick the Console into behaving closer to how OpenShift does. Required `cluster-admin` and `console.impersonateOpenShift=true` | `false` |
| `ingress.className` | IngressClass resource to use. | |
| `sidecars` | Arbitrary sidecars to include as-is | `[]` |
Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`.
### Version `0.2.X`
Version `0.2.0` and above require the `networking.k8s.io/v1` API for Ingress which is available in Kubernetes 1.19 and above.

View File

@@ -0,0 +1,4 @@
hostAliases:
- ip: "127.0.0.1"
hostnames:
- "kubernetes.default.svc"

View File

@@ -0,0 +1,7 @@
sidecars:
- name: your-image-name
image: your-image
imagePullPolicy: Always
ports:
- name: portname
containerPort: 1234

View File

@@ -0,0 +1,21 @@
1. Get the application URL by running these commands:
{{- if .Values.ingress.enabled }}
{{- range $host := .Values.ingress.hosts }}
{{- range .paths }}
http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ . }}
{{- end }}
{{- end }}
{{- else if contains "NodePort" .Values.service.type }}
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "openshift-console.fullname" . }})
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
echo http://$NODE_IP:$NODE_PORT
{{- else if contains "LoadBalancer" .Values.service.type }}
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "openshift-console.fullname" . }}'
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "openshift-console.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
echo http://$SERVICE_IP:{{ .Values.service.port }}
{{- else if contains "ClusterIP" .Values.service.type }}
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "openshift-console.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
echo "Visit http://127.0.0.1:8080 to use your application"
kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:80
{{- end }}

View File

@@ -0,0 +1,75 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "openshift-console.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 "openshift-console.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 "openshift-console.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}
{{/*
Common labels
*/}}
{{- define "openshift-console.labels" -}}
helm.sh/chart: {{ include "openshift-console.chart" . }}
{{ include "openshift-console.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}
{{/*
Selector labels
*/}}
{{- define "openshift-console.selectorLabels" -}}
app.kubernetes.io/name: {{ include "openshift-console.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}
{{/*
Create the name of the service account to use
*/}}
{{- define "openshift-console.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "openshift-console.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}
{{/*
Renders a value that contains template.
Usage:
{{ include "common.tplvalues.render" ( dict "value" .Values.path.to.the.Value "context" $) }}
*/}}
{{- define "common.tplvalues.render" -}}
{{- if typeIs "string" .value }}
{{- tpl .value .context }}
{{- else }}
{{- tpl (.value | toYaml) .context }}
{{- end }}
{{- end -}}

View File

@@ -0,0 +1,21 @@
{{- if .Values.console.impersonateOpenShift }}
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: apps.apps.openshift.io
spec:
group: apps.openshift.io
versions:
- name: v1
served: true
storage: true
schema:
openAPIV3Schema:
type: object
properties: {}
scope: Namespaced
names:
plural: apps
singular: app
kind: OpenShift
{{- end }}

View File

@@ -0,0 +1,134 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "openshift-console.fullname" . }}
labels:
{{- with .Values.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- include "openshift-console.labels" . | nindent 4 }}
annotations:
{{- toYaml .Values.annotations | nindent 4 }}
spec:
{{- if not .Values.autoscaling.enabled }}
replicas: {{ .Values.replicaCount }}
{{- end }}
selector:
matchLabels:
{{- include "openshift-console.selectorLabels" . | nindent 6 }}
template:
metadata:
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- with .Values.podLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- include "openshift-console.selectorLabels" . | nindent 8 }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
automountServiceAccountToken: {{ .Values.serviceAccount.automountServiceAccountToken }}
serviceAccountName: {{ include "openshift-console.serviceAccountName" . }}
{{- if .Values.podSecurityContext.enabled }}
securityContext:
{{- omit .Values.podSecurityContext "enabled" | toYaml | nindent 8 }}
{{- end }}
volumes:
{{- if .Values.volumes }}
{{- range .Values.volumes }}
- name: {{ .name }}
{{ toYaml .config | indent 10 }}
{{- end }}
{{- end }}
{{- with .Values.hostAliases }}
hostAliases:
{{- toYaml . | nindent 8 }}
{{- end }}
containers:
- name: {{ .Chart.Name }}
{{- with .Values.args }}
args:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.command }}
command:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- if .Values.securityContext.enabled }}
securityContext:
{{- omit .Values.securityContext "enabled" | toYaml | nindent 12 }}
{{- end }}
image: "{{ .Values.image.registry}}/{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
env:
- name: BRIDGE_KUBECTL_CLIENT_SECRET
valueFrom:
secretKeyRef:
key: secret
name: {{ include "openshift-console.fullname" . }}
- name: BRIDGE_DOCUMENTATION_BASE_URL
value: https://kubernetes.io/docs/
- name: BRIDGE_DEX_API_HOST
value: {{ .Values.console.dex.host }}
- name: BRIDGE_BASE_ADDRESS
value: {{ .Values.console.baseUrl }}
{{- if .Values.console.oidc.enabled }}
- name: BRIDGE_USER_AUTH
value: oidc
- name: BRIDGE_K8S_AUTH
value: oidc
- name: BRIDGE_USER_AUTH_OIDC_ISSUER_URL
value: {{ .Values.console.oidc.issuerUrl }}
- name: BRIDGE_USER_AUTH_OIDC_CLIENT_ID
value: {{ .Values.console.oidc.clientId }}
- name: BRIDGE_USER_AUTH_OIDC_CLIENT_SECRET
value: {{ .Values.console.oidc.clientSecret }}
{{- end }}
{{- range $key, $value := .Values.extraEnv }}
- name: {{ $key }}
value: {{ $value | quote }}
{{- end }}
ports:
- name: http
containerPort: {{ .Values.service.port }}
protocol: TCP
volumeMounts:
{{- if .Values.volumes }}
{{- range .Values.volumes }}
- mountPath: {{ .mountPath }}
name: {{ .name }}
{{- if .subPath }}
subPath: {{ .subPath }}
{{- end }}
{{- end }}
{{- end }}
livenessProbe:
httpGet:
path: /health
port: http
readinessProbe:
httpGet:
path: /health
port: http
resources:
{{- toYaml .Values.resources | nindent 12 }}
{{- if .Values.sidecars }}
{{- include "common.tplvalues.render" ( dict "value" .Values.sidecars "context" $ ) | nindent 8 }}
{{- end }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}

View File

@@ -0,0 +1,28 @@
{{- if .Values.autoscaling.enabled }}
apiVersion: autoscaling/v2beta1
kind: HorizontalPodAutoscaler
metadata:
name: {{ include "openshift-console.fullname" . }}
labels:
{{- include "openshift-console.labels" . | nindent 4 }}
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: {{ include "openshift-console.fullname" . }}
minReplicas: {{ .Values.autoscaling.minReplicas }}
maxReplicas: {{ .Values.autoscaling.maxReplicas }}
metrics:
{{- if .Values.autoscaling.targetCPUUtilizationPercentage }}
- type: Resource
resource:
name: cpu
targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }}
{{- end }}
{{- if .Values.autoscaling.targetMemoryUtilizationPercentage }}
- type: Resource
resource:
name: memory
targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }}
{{- end }}
{{- end }}

View File

@@ -0,0 +1,41 @@
{{- if .Values.ingress.enabled -}}
{{- $fullName := include "openshift-console.fullname" . -}}
{{- $svcPort := .Values.service.port -}}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ $fullName }}
labels:
{{- include "openshift-console.labels" . | nindent 4 }}
{{- with .Values.ingress.annotations }}
annotations:
{{- omit . "kubernetes.io/ingress.class" | toYaml | nindent 4 }}
{{- end }}
spec:
ingressClassName: {{ .Values.ingress.className | default (get .Values.ingress.annotations "kubernetes.io/ingress.class") }}
{{- if .Values.ingress.tls }}
tls:
{{- range .Values.ingress.tls }}
- hosts:
{{- range .hosts }}
- {{ . | quote }}
{{- end }}
secretName: {{ .secretName }}
{{- end }}
{{- end }}
rules:
{{- range .Values.ingress.hosts }}
- host: {{ .host | quote }}
http:
paths:
{{- range .paths }}
- path: {{ . }}
pathType: ImplementationSpecific
backend:
service:
name: {{ $fullName }}
port:
number: {{ $svcPort }}
{{- end }}
{{- end }}
{{- end }}

View File

@@ -0,0 +1,31 @@
{{- if and .Values.console.impersonateOpenShift .Values.rbac.enabled }}
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: {{ include "openshift-console.fullname" . }}-dashboards
namespace: openshift-config-managed
rules:
- verbs:
- get
- list
- watch
apiGroups:
- ""
resources:
- configmaps
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: {{ include "openshift-console.fullname" . }}-dashboards
# unfortunately this is hardcoded (https://github.com/openshift/console/blob/master/cmd/bridge/main.go#L576)
namespace: openshift-config-managed
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: {{ include "openshift-console.fullname" . }}-dashboards
subjects:
- kind: ServiceAccount
name: {{ include "openshift-console.serviceAccountName" . }}
namespace: {{ .Release.Namespace }}
{{- end }}

View File

@@ -0,0 +1,15 @@
{{ if .Values.consolesecret }}
apiVersion: v1
kind: Secret
metadata:
name: {{ include "openshift-console.fullname" . }}
labels:
{{- with .Values.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- include "openshift-console.labels" . | nindent 4 }}
annotations:
{{- toYaml .Values.annotations | nindent 4 }}
data:
secret: {{ .Values.consolesecret | b64enc | quote }}
{{- end }}

View File

@@ -0,0 +1,15 @@
apiVersion: v1
kind: Service
metadata:
name: {{ include "openshift-console.fullname" . }}
labels:
{{- include "openshift-console.labels" . | nindent 4 }}
spec:
type: {{ .Values.service.type }}
ports:
- port: {{ .Values.service.port }}
targetPort: http
protocol: TCP
name: http
selector:
{{- include "openshift-console.selectorLabels" . | nindent 4 }}

View File

@@ -0,0 +1,12 @@
{{- if .Values.serviceAccount.create -}}
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ include "openshift-console.serviceAccountName" . }}
labels:
{{- include "openshift-console.labels" . | nindent 4 }}
{{- with .Values.serviceAccount.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}

View File

@@ -0,0 +1,15 @@
apiVersion: v1
kind: Pod
metadata:
name: "{{ include "openshift-console.fullname" . }}-test-connection"
labels:
{{- include "openshift-console.labels" . | nindent 4 }}
annotations:
"helm.sh/hook": test-success
spec:
containers:
- name: wget
image: busybox
command: ['wget']
args: ['{{ include "openshift-console.fullname" . }}:{{ .Values.service.port }}']
restartPolicy: Never

View File

@@ -0,0 +1,130 @@
# Default values for openshift-console.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.
replicaCount: 1
image:
registry: quay.io
repository: openshift/origin-console
pullPolicy: Always
# Overrides the image tag whose default is the chart appVersion.
tag: 4.20.0
imagePullSecrets: []
nameOverride: ""
fullnameOverride: ""
annotations: {}
labels: {}
podLabels: {}
podAnnotations: {}
podSecurityContext:
enabled: true
runAsUser: 1001
securityContext:
enabled: true
capabilities:
drop:
- ALL
readOnlyRootFilesystem: true
allowPrivilegeEscalation: false
runAsNonRoot: true
runAsUser: 1001
service:
type: ClusterIP
port: 9000
ingress:
enabled: false
className: ""
annotations: {}
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
hosts:
- host: chart-example.local
paths: []
tls: []
# - secretName: chart-example-tls
# hosts:
# - chart-example.local
extraEnv:
BRIDGE_K8S_AUTH_BEARER_TOKEN: 'CENSORED'
BRIDGE_GRAFANA_PUBLIC_URL: https://grafana.something.com
BRIDGE_KUBECTL_CLIENT_ID: console
BRIDGE_K8S_MODE: off-cluster
BRIDGE_K8S_MODE_OFF_CLUSTER_ALERTMANAGER: https://alertmanager.something.com
BRIDGE_K8S_MODE_OFF_CLUSTER_SKIP_VERIFY_TLS: "true"
BRIDGE_K8S_MODE_OFF_CLUSTER_THANOS: https://prometheus.something.com
BRIDGE_K8S_MODE_OFF_CLUSTER_ENDPOINT: https://kube-oidc-proxy:443
volumes: []
# - name: my-volume
# mountPath: /foo/bar
# config:
# emptyDir: {}
console:
dex:
host: https://dex.something.com
baseUrl: https://console.something.com
impersonateOpenShift: false
oidc:
enabled: true
issuerUrl: https://dex.something.com
clientId: console
clientSecret: 'xxxxxx'
rbac:
enabled: false
autoscaling:
enabled: false
minReplicas: 1
maxReplicas: 100
targetCPUUtilizationPercentage: 80
# targetMemoryUtilizationPercentage: 80
nodeSelector: {}
tolerations: []
affinity: {}
sidecars: []
serviceAccount:
create: false
automountServiceAccountToken: true
annotations: {}
name: ""
hostAliases: []
# - ip: "127.0.0.1"
# hostnames:
# - "kubernetes.default.svc"
consolesecret: 'XXXXXXXXX'
#cookie-encryption-key-file: "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
#cookie-authentication-key-file: "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
args:
- --public-dir=/opt/bridge/static
- -v
- "7"
command:
- /opt/bridge/bin/bridge
resources:
limits:
cpu: 500m
memory: 512Mi
requests:
cpu: 200m
memory: 256Mi

View File

@@ -0,0 +1,168 @@
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
api-approved.openshift.io: https://github.com/openshift/api/pull/598
api.openshift.io/merged-by-featuregates: "true"
include.release.openshift.io/ibm-cloud-managed: "true"
include.release.openshift.io/self-managed-high-availability: "true"
name: helmchartrepositories.helm.openshift.io
spec:
group: helm.openshift.io
names:
kind: HelmChartRepository
listKind: HelmChartRepositoryList
plural: helmchartrepositories
singular: helmchartrepository
scope: Cluster
versions:
- name: v1beta1
schema:
openAPIV3Schema:
description: |-
HelmChartRepository holds cluster-wide configuration for proxied Helm chart repository
Compatibility level 2: Stable within a major release for a minimum of 9 months or 3 minor releases (whichever is longer).
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: spec holds user settable values for configuration
properties:
connectionConfig:
description: Required configuration for connecting to the chart repo
properties:
ca:
description: |-
ca is an optional reference to a config map by name containing the PEM-encoded CA bundle.
It is used as a trust anchor to validate the TLS certificate presented by the remote server.
The key "ca-bundle.crt" is used to locate the data.
If empty, the default system roots are used.
The namespace for this config map is openshift-config.
properties:
name:
description: name is the metadata.name of the referenced config
map
type: string
required:
- name
type: object
tlsClientConfig:
description: |-
tlsClientConfig is an optional reference to a secret by name that contains the
PEM-encoded TLS client certificate and private key to present when connecting to the server.
The key "tls.crt" is used to locate the client certificate.
The key "tls.key" is used to locate the private key.
The namespace for this secret is openshift-config.
properties:
name:
description: name is the metadata.name of the referenced secret
type: string
required:
- name
type: object
url:
description: Chart repository URL
maxLength: 2048
pattern: ^https?:\/\/
type: string
type: object
description:
description: Optional human readable repository description, it can
be used by UI for displaying purposes
maxLength: 2048
minLength: 1
type: string
disabled:
description: If set to true, disable the repo usage in the cluster/namespace
type: boolean
name:
description: Optional associated human readable repository name, it
can be used by UI for displaying purposes
maxLength: 100
minLength: 1
type: string
type: object
status:
description: Observed status of the repository within the cluster..
properties:
conditions:
description: conditions is a list of conditions and their statuses
items:
description: Condition contains details for one aspect of the current
state of this API Resource.
properties:
lastTransitionTime:
description: |-
lastTransitionTime is the last time the condition transitioned from one status to another.
This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.
format: date-time
type: string
message:
description: |-
message is a human readable message indicating details about the transition.
This may be an empty string.
maxLength: 32768
type: string
observedGeneration:
description: |-
observedGeneration represents the .metadata.generation that the condition was set based upon.
For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date
with respect to the current state of the instance.
format: int64
minimum: 0
type: integer
reason:
description: |-
reason contains a programmatic identifier indicating the reason for the condition's last transition.
Producers of specific condition types may define expected values and meanings for this field,
and whether the values are considered a guaranteed API.
The value should be a CamelCase string.
This field may not be empty.
maxLength: 1024
minLength: 1
pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$
type: string
status:
description: status of the condition, one of True, False, Unknown.
enum:
- "True"
- "False"
- Unknown
type: string
type:
description: type of condition in CamelCase or in foo.example.com/CamelCase.
maxLength: 316
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
type: string
required:
- lastTransitionTime
- message
- reason
- status
- type
type: object
type: array
type: object
required:
- spec
type: object
served: true
storage: true
subresources:
status: {}

View File

@@ -0,0 +1,182 @@
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
api-approved.openshift.io: https://github.com/openshift/api/pull/1084
api.openshift.io/merged-by-featuregates: "true"
include.release.openshift.io/ibm-cloud-managed: "true"
include.release.openshift.io/self-managed-high-availability: "true"
name: projecthelmchartrepositories.helm.openshift.io
spec:
group: helm.openshift.io
names:
kind: ProjectHelmChartRepository
listKind: ProjectHelmChartRepositoryList
plural: projecthelmchartrepositories
singular: projecthelmchartrepository
scope: Namespaced
versions:
- name: v1beta1
schema:
openAPIV3Schema:
description: |-
ProjectHelmChartRepository holds namespace-wide configuration for proxied Helm chart repository
Compatibility level 2: Stable within a major release for a minimum of 9 months or 3 minor releases (whichever is longer).
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: spec holds user settable values for configuration
properties:
connectionConfig:
description: Required configuration for connecting to the chart repo
properties:
basicAuthConfig:
description: |-
basicAuthConfig is an optional reference to a secret by name that contains
the basic authentication credentials to present when connecting to the server.
The key "username" is used locate the username.
The key "password" is used to locate the password.
The namespace for this secret must be same as the namespace where the project helm chart repository is getting instantiated.
properties:
name:
description: name is the metadata.name of the referenced secret
type: string
required:
- name
type: object
ca:
description: |-
ca is an optional reference to a config map by name containing the PEM-encoded CA bundle.
It is used as a trust anchor to validate the TLS certificate presented by the remote server.
The key "ca-bundle.crt" is used to locate the data.
If empty, the default system roots are used.
The namespace for this configmap must be same as the namespace where the project helm chart repository is getting instantiated.
properties:
name:
description: name is the metadata.name of the referenced config
map
type: string
required:
- name
type: object
tlsClientConfig:
description: |-
tlsClientConfig is an optional reference to a secret by name that contains the
PEM-encoded TLS client certificate and private key to present when connecting to the server.
The key "tls.crt" is used to locate the client certificate.
The key "tls.key" is used to locate the private key.
The namespace for this secret must be same as the namespace where the project helm chart repository is getting instantiated.
properties:
name:
description: name is the metadata.name of the referenced secret
type: string
required:
- name
type: object
url:
description: Chart repository URL
maxLength: 2048
pattern: ^https?:\/\/
type: string
type: object
description:
description: Optional human readable repository description, it can
be used by UI for displaying purposes
maxLength: 2048
minLength: 1
type: string
disabled:
description: If set to true, disable the repo usage in the namespace
type: boolean
name:
description: Optional associated human readable repository name, it
can be used by UI for displaying purposes
maxLength: 100
minLength: 1
type: string
type: object
status:
description: Observed status of the repository within the namespace..
properties:
conditions:
description: conditions is a list of conditions and their statuses
items:
description: Condition contains details for one aspect of the current
state of this API Resource.
properties:
lastTransitionTime:
description: |-
lastTransitionTime is the last time the condition transitioned from one status to another.
This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.
format: date-time
type: string
message:
description: |-
message is a human readable message indicating details about the transition.
This may be an empty string.
maxLength: 32768
type: string
observedGeneration:
description: |-
observedGeneration represents the .metadata.generation that the condition was set based upon.
For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date
with respect to the current state of the instance.
format: int64
minimum: 0
type: integer
reason:
description: |-
reason contains a programmatic identifier indicating the reason for the condition's last transition.
Producers of specific condition types may define expected values and meanings for this field,
and whether the values are considered a guaranteed API.
The value should be a CamelCase string.
This field may not be empty.
maxLength: 1024
minLength: 1
pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$
type: string
status:
description: status of the condition, one of True, False, Unknown.
enum:
- "True"
- "False"
- Unknown
type: string
type:
description: type of condition in CamelCase or in foo.example.com/CamelCase.
maxLength: 316
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
type: string
required:
- lastTransitionTime
- message
- reason
- status
- type
type: object
type: array
type: object
required:
- spec
type: object
served: true
storage: true
subresources:
status: {}

View File

@@ -0,0 +1,8 @@
apiVersion: helm.openshift.io/v1beta1
kind: HelmChartRepository
metadata:
name: cozystack
spec:
name: cozystack
connectionConfig:
url: http://cozystack.cozy-system.svc/repos/apps

View File

@@ -0,0 +1,88 @@
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: kubevirt-plugin
spec:
replicas: 1
selector:
matchLabels:
app: kubevirt-plugin
template:
metadata:
labels:
app: kubevirt-plugin
spec:
containers:
- name: kubevirt-plugin
image: quay.io/kubevirt-ui/kubevirt-plugin:v4.17.0
ports:
- containerPort: 9443
protocol: TCP
imagePullPolicy: Always
volumeMounts:
#- name: plugin-serving-cert
# readOnly: true
# mountPath: /var/serving-cert
- name: nginx-conf
readOnly: true
mountPath: /etc/nginx/nginx.conf
subPath: nginx.conf
volumes:
#- name: plugin-serving-cert
# secret:
# secretName: plugin-serving-cert
# defaultMode: 420
- name: nginx-conf
configMap:
name: nginx-conf
defaultMode: 420
restartPolicy: Always
dnsPolicy: ClusterFirst
strategy:
type: RollingUpdate
rollingUpdate:
maxUnavailable: 25%
maxSurge: 25%
---
apiVersion: v1
kind: ConfigMap
metadata:
name: nginx-conf
data:
nginx.conf: |
error_log /dev/stdout info;
events {}
http {
access_log /dev/stdout;
include /etc/nginx/mime.types;
default_type application/octet-stream;
keepalive_timeout 65;
server {
listen 9443;
root /usr/share/nginx/html;
}
#server {
# listen 9443 ssl;
# ssl_certificate /var/serving-cert/tls.crt;
# ssl_certificate_key /var/serving-cert/tls.key;
# root /usr/share/nginx/html;
#}
}
---
apiVersion: v1
kind: Service
metadata:
#annotations:
# service.alpha.openshift.io/serving-cert-secret-name: plugin-serving-cert
name: kubevirt-plugin
spec:
ports:
- name: 9443-tcp
protocol: TCP
port: 9443
targetPort: 9443
selector:
app: kubevirt-plugin
type: ClusterIP
sessionAffinity: None

View File

@@ -0,0 +1,7 @@
apiVersion: v1
kind: Secret
metadata:
name: openshift-console
stringData:
cookie_auth_key: rpb7aos4rd0m32x9omcrcqacnia0xty2
cookie_enc_key: gg1ejofgupoc19wyuywr2yflm75aeiwg

View File

@@ -0,0 +1,50 @@
openshift-console:
fullnameOverride: console
console:
baseUrl: https://console.infra.aenix.org
oidc:
enabled: true
issuerUrl: https://keycloak.infra.aenix.org/realms/cozy
clientId: console-test
clientSecret: Sgq1yrmmEwPKy9YxGmg37b1EgsLu3P9g
extraEnv:
BRIDGE_K8S_AUTH_BEARER_TOKEN: null
BRIDGE_GRAFANA_PUBLIC_URL: https://grafana.infra.aenix.org
BRIDGE_KUBECTL_CLIENT_ID: console
BRIDGE_K8S_MODE: in-cluster
BRIDGE_COOKIE_AUTHENTICATION_KEY_FILE: /etc/openshift-console-secrets/cookie_auth_key
BRIDGE_COOKIE_ENCRYPTION_KEY_FILE: /etc/openshift-console-secrets/cookie_enc_key
BRIDGE_PLUGINS: kubevirt-plugin=http://kubevirt-plugin.cozy-console.svc:9443/
BRIDGE_ALERMANAGER_PUBLIC_URL: http://vmalertmanager-alertmanager.tenant-root.svc:9093
BRIDGE_THANOS_PUBLIC_URL: http://vmselect-shortterm.tenant-root.svc:8481/select/0/prometheus
BRIDGE_SKIP_VERIFY_TLS: true
volumes:
- name: cookie-secrets
mountPath: /etc/openshift-console-secrets
config:
secret:
secretName: openshift-console
- name: tmp
mountPath: /tmp
config:
emptyDir: {}
ingress:
enabled: true
annotations:
acme.cert-manager.io/http01-ingress-class: tenant-root
cert-manager.io/cluster-issuer: letsencrypt-prod
className: 'tenant-root'
hosts:
- host: console.infra.aenix.org
paths: ["/"]
tls:
- secretName: console-tls
hosts:
- console.infra.aenix.org
resources:
limits:
cpu: 500m
memory: 2048Mi
requests:
cpu: 200m
memory: 512Mi

View File

@@ -155,7 +155,7 @@ data:
labels:
cozystack.io/ui: "true"
chart:
name: rabbitmq
name: redis
sourceRef:
kind: HelmRepository
name: cozystack-apps

View File

@@ -1,2 +1,2 @@
cozystackAPI:
image: ghcr.io/aenix-io/cozystack/cozystack-api:v0.20.0@sha256:d49c650a7f0f3ec4321a17d44c86ca2e8b9d47be8ee063f891b432ec7d6e1f6d
image: ghcr.io/aenix-io/cozystack/cozystack-api:v0.20.2@sha256:fd7bebabd4b8d29c5749bc454feec1ef35bf29ce60b5edebb9a550ca6dcfed49

View File

@@ -33,11 +33,11 @@ kubeapps:
image:
registry: ghcr.io/aenix-io/cozystack
repository: dashboard
tag: v0.20.0
tag: v0.20.2
digest: "sha256:4818712e9fc9c57cc321512760c3226af564a04e69d4b3ec9229ab91fd39abeb"
kubeappsapis:
image:
registry: ghcr.io/aenix-io/cozystack
repository: kubeapps-apis
tag: v0.20.0
digest: "sha256:097b04a5870a966f764aacc317276078149ad7d038fce6a388b9a8f47c3d34a6"
tag: v0.20.2
digest: "sha256:7640ba0c9549e6051b4e26488904a4f07d532087f1ac2f32bdc35687d7291ace"

View File

@@ -3,7 +3,7 @@ kamaji:
deploy: false
image:
pullPolicy: IfNotPresent
tag: v0.20.0@sha256:35f4793fedb4dfbedbd6dca2cf312518c25632ae66f9f7acc4dc69aaf2406650
tag: v0.20.2@sha256:f7ebb4e8b833b90982d371a8d8292c328ab7e828ffd953a32f08cdd91398faef
repository: ghcr.io/aenix-io/cozystack/kamaji
resources:
limits:

View File

@@ -72,6 +72,10 @@ func RegisterDynamicTypes(scheme *runtime.Scheme, cfg *config.ResourceConfig) er
scheme.AddKnownTypeWithName(gvk, &Application{})
scheme.AddKnownTypeWithName(gvk.GroupVersion().WithKind(kind+"List"), &ApplicationList{})
gvkInternal := schema.GroupVersion{Group: GroupName, Version: runtime.APIVersionInternal}.WithKind(kind)
scheme.AddKnownTypeWithName(gvkInternal, &Application{})
scheme.AddKnownTypeWithName(gvkInternal.GroupVersion().WithKind(kind+"List"), &ApplicationList{})
klog.V(1).Infof("Registered kind: %s\n", kind)
RegisteredGVKs = append(RegisteredGVKs, gvk)
}

View File

@@ -256,6 +256,9 @@ func (o *AppsServerOptions) Config() (*apiserver.Config, error) {
klog.V(6).Infof("PostProcessSpec: Added OpenAPI definition for %s\n", listResourceName)
}
delete(defs, "com.github.aenix.io.cozystack.pkg.apis.apps.v1alpha1.Application")
delete(defs, "com.github.aenix.io.cozystack.pkg.apis.apps.v1alpha1.ApplicationList")
swagger.Definitions = defs
return swagger, nil
}