Skip to content

Commit

Permalink
Merge pull request #638 from klinch0/feature/move-kubeconfig
Browse files Browse the repository at this point in the history
feature/mv-kubeconfig
  • Loading branch information
lllamnyp authored Feb 21, 2025
2 parents bc95159 + 6c73e3f commit 135b060
Show file tree
Hide file tree
Showing 16 changed files with 109 additions and 10 deletions.
2 changes: 1 addition & 1 deletion packages/apps/tenant/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ description: Separated tenant namespace
icon: /logos/tenant.svg

type: application
version: 1.6.8
version: 1.7.0
27 changes: 27 additions & 0 deletions packages/apps/tenant/templates/info.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{{- $cozyConfig := lookup "v1" "ConfigMap" "cozy-system" "cozystack" }}
{{- $oidcEnabled := index $cozyConfig.data "oidc-enabled" }}
{{- if $oidcEnabled }}
apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata:
name: info
namespace: {{ include "tenant.name" . }}
annotations:
helm.sh/resource-policy: keep
labels:
cozystack.io/ui: "true"
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
spec:
chart:
spec:
chart: info
reconcileStrategy: Revision
sourceRef:
kind: HelmRepository
name: cozystack-extra
namespace: cozy-public
version: "*"
interval: 1m0s
timeout: 5m0s
{{- end }}
1 change: 1 addition & 0 deletions packages/apps/tenant/templates/tenant.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,7 @@ rules:
- virtualmachines
- vmdisks
- vminstances
- infos
verbs:
- get
- list
Expand Down
3 changes: 2 additions & 1 deletion packages/apps/versions_map
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ tenant 1.6.4 3c9e50a4
tenant 1.6.5 f1e11451
tenant 1.6.6 d4634797
tenant 1.6.7 06afcf27
tenant 1.6.8 HEAD
tenant 1.6.8 4cc48e6f
tenant 1.7.0 HEAD
virtual-machine 0.1.4 f2015d6
virtual-machine 0.1.5 7cd7de7
virtual-machine 0.2.0 5ca8823
Expand Down
2 changes: 2 additions & 0 deletions packages/extra/info/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.helmignore
/logos
6 changes: 6 additions & 0 deletions packages/extra/info/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apiVersion: v2
name: info
description: Info
icon: /logos/info.svg
type: application
version: 1.0.0
3 changes: 3 additions & 0 deletions packages/extra/info/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
NAME=etcd

include ../../../scripts/package.mk
18 changes: 18 additions & 0 deletions packages/extra/info/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Info

### Kubeconfig for tenant

### Kubelogin

For using kubeconfig need install kubelogin.

```bash
# Homebrew (macOS and Linux)
brew install int128/kubelogin/kubelogin

# Krew (macOS, Linux, Windows and ARM)
kubectl krew install oidc-login

# Chocolatey (Windows)
choco install kubelogin
```
13 changes: 13 additions & 0 deletions packages/extra/info/logos/info.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: {{ include "tenant.name" . }}-dashboard-resources
namespace: {{ .Release.namespace }}
name: info-dashboard-resources
rules:
- apiGroups:
- ""
resources:
- secrets
resourceNames:
- kubeconfig-{{ include "tenant.name" . }}
- kubeconfig-{{ .Release.Namespace }}
verbs: ["get", "list", "watch"]
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
apiVersion: v1
kind: Secret
metadata:
name: kubeconfig-{{ include "tenant.name" . }}
namespace: tenant-root
name: kubeconfig-{{ .Release.Namespace }}
stringData:
kubeconfig: |
apiVersion: v1
Expand All @@ -28,10 +27,10 @@ stringData:
contexts:
- context:
cluster: cluster
namespace: {{ include "tenant.name" . }}
namespace: {{ .Release.Namespace }}
user: keycloak
name: {{ include "tenant.name" . }}
current-context: {{ include "tenant.name" . }}
name: {{ .Release.Namespace }}
current-context: {{ .Release.Namespace }}
users:
- name: keycloak
user:
Expand Down
1 change: 1 addition & 0 deletions packages/extra/info/values.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
Empty file added packages/extra/info/values.yaml
Empty file.
1 change: 1 addition & 0 deletions packages/extra/versions_map
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ etcd 2.2.0 5ca8823
etcd 2.3.0 b908400d
etcd 2.4.0 cb7b8158
etcd 2.5.0 HEAD
info 1.0.0 HEAD
ingress 1.0.0 f642698
ingress 1.1.0 838bee5d
ingress 1.2.0 ced8e5b
Expand Down
14 changes: 14 additions & 0 deletions packages/system/cozystack-api/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -314,3 +314,17 @@ data:
kind: HelmRepository
name: cozystack-extra
namespace: cozy-public
- application:
kind: Info
plural: infos
singular: info
release:
prefix: ""
labels:
cozystack.io/ui: "true"
chart:
name: info
sourceRef:
kind: HelmRepository
name: cozystack-extra
namespace: cozy-public
14 changes: 14 additions & 0 deletions packages/system/dashboard/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -361,3 +361,17 @@ kubeapps:
kind: HelmRepository
name: cozystack-extra
namespace: cozy-public
- application:
kind: Info
plural: infos
singular: info
release:
prefix: ""
labels:
cozystack.io/ui: "true"
chart:
name: info
sourceRef:
kind: HelmRepository
name: cozystack-extra
namespace: cozy-public

0 comments on commit 135b060

Please sign in to comment.