Skip to content

Commit 5cba0e1

Browse files
committed
rancher oidc
1 parent f57b243 commit 5cba0e1

File tree

5 files changed

+114
-16
lines changed

5 files changed

+114
-16
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
apiVersion: external-secrets.io/v1
3+
kind: ExternalSecret
4+
metadata:
5+
name: rancher-oidc-credentials
6+
namespace: cattle-system
7+
spec:
8+
refreshInterval: "1h"
9+
secretStoreRef:
10+
name: vault-kubernetes-secret-store
11+
kind: ClusterSecretStore
12+
target:
13+
name: rancher-oidc-credentials
14+
creationPolicy: Owner
15+
data:
16+
- secretKey: clientId
17+
remoteRef:
18+
key: kubernetes/data/rancher
19+
property: oidc-client-id
20+
- secretKey: clientSecret
21+
remoteRef:
22+
key: kubernetes/data/rancher
23+
property: oidc-client-secret

kubernetes/infra/manifests/ingresses/rancher.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ kind: HTTPRoute
44
metadata:
55
name: rancher
66
namespace: cattle-system
7+
labels:
8+
app.kubernetes.io/name: rancher
79
spec:
810
parentRefs:
911
- name: cilium-gateway
@@ -18,4 +20,4 @@ spec:
1820
value: /
1921
backendRefs:
2022
- name: rancher
21-
port: 80
23+
port: 80
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
apiVersion: v2
3+
name: rancher
4+
version: 1.0.0
5+
dependencies:
6+
- name: rancher
7+
version: "2.12.1"
8+
repository: https://releases.rancher.com/server-charts/stable
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
---
2+
# =============================================================================
3+
# RANCHER CORE CONFIGURATION
4+
# =============================================================================
5+
rancher:
6+
# Hostname per Rancher
7+
hostname: rancher.local.ildoc.it
8+
9+
# Numero di repliche
10+
replicas: 2
11+
12+
# TLS configuration - external perché gestiamo TLS al gateway
13+
tls: external
14+
15+
# Private CA - se usi certificati self-signed
16+
privateCA: false
17+
18+
# Ingress - disabilitato, usiamo HTTPRoute in ingresses/
19+
ingress:
20+
enabled: false
21+
22+
# Resources
23+
resources:
24+
requests:
25+
cpu: 250m
26+
memory: 512Mi
27+
limits:
28+
cpu: 1000m
29+
memory: 2Gi
30+
31+
# Anti-affinity per distribuire i pod
32+
affinity:
33+
podAntiAffinity:
34+
preferredDuringSchedulingIgnoredDuringExecution:
35+
- weight: 100
36+
podAffinityTerm:
37+
labelSelector:
38+
matchLabels:
39+
app: rancher
40+
topologyKey: kubernetes.io/hostname
41+
42+
# Liveness e Readiness probes
43+
livenessProbe:
44+
initialDelaySeconds: 60
45+
periodSeconds: 30
46+
timeoutSeconds: 5
47+
failureThreshold: 3
48+
49+
readinessProbe:
50+
initialDelaySeconds: 30
51+
periodSeconds: 10
52+
timeoutSeconds: 5
53+
failureThreshold: 3
54+
55+
# Bootstrap password - IMPORTANTE: cambialo al primo accesso
56+
bootstrapPassword: "admin"
57+
58+
# Features
59+
extraEnv:
60+
# Proxy configuration per headers
61+
- name: HTTP_PROXY
62+
value: ""
63+
- name: HTTPS_PROXY
64+
value: ""
65+
- name: NO_PROXY
66+
value: "127.0.0.0/8,10.0.0.0/8,cattle-system.svc,172.16.0.0/12,192.168.0.0/16,.svc,.cluster.local"
67+
68+
# Audit log
69+
auditLog:
70+
level: 0
71+
maxAge: 10
72+
maxBackup: 10
73+
maxSize: 100
74+
75+
# Additional trusted CAs (se necessario)
76+
additionalTrustedCAs: false

kubernetes/infra/rancher.yaml

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,32 +6,21 @@ metadata:
66
namespace: argocd
77
finalizers:
88
- resources-finalizer.argocd.argoproj.io
9-
- post-delete-finalizer.argocd.argoproj.io
10-
- post-delete-finalizer.argocd.argoproj.io/cleanup
119
annotations:
1210
argocd.argoproj.io/sync-wave: "-70"
13-
argocd.argoproj.io/sync-options: SkipDryRunOnMissingResource=true
14-
argocd.argoproj.io/wait: "true"
1511
spec:
1612
project: default
1713
source:
18-
repoURL: https://releases.rancher.com/server-charts/stable
19-
chart: rancher
20-
targetRevision: 2.12.1
21-
helm:
22-
parameters:
23-
- name: "ingress.enabled"
24-
value: "false"
25-
- name: "tls"
26-
value: "external" # IMPORTANTE: Disabilita TLS interno
27-
- name: "hostname"
28-
value: "rancher.local.ildoc.it"
14+
repoURL: https://gitlab.local.ildoc.it/ildoc/homelab.git
15+
targetRevision: HEAD
16+
path: kubernetes/infra/manifests/rancher
2917
destination:
3018
server: https://kubernetes.default.svc
3119
namespace: cattle-system
3220
syncPolicy:
3321
syncOptions:
3422
- CreateNamespace=true
23+
- ServerSideApply=true
3524
automated:
3625
prune: true
3726
selfHeal: true

0 commit comments

Comments
 (0)