Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions defaults/onpremises-kfd-v1alpha2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@ data:
networkPoliciesEnabled: false
# the module section will be used to fine tune each module behaviour and configuration
modules:
docs:
enabled: true
overrides:
ingresses:
docs:
host: ""
ingressClass: ""
# ingress module configuration
ingress:
overrides:
Expand Down
10 changes: 10 additions & 0 deletions docs/releases/unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,16 @@ The distribution is maintained with ❤️ by the team [SIGHUP by ReeVo](https:/

## New features 🌟

- [[#XXX](https://github.com/sighupio/distribution/pull/XXX)] **Embedded Docs site**: the distribution now includes an embedded version of the docs site with the documentation for the SD version. The docs will be deployed by default and an (unprotected) ingress will be automatically created. You can disable and / or override some values with the new configuration key, for example:

```yaml
spec:
distribution:
modules:
docs:
enabled: false # disable embedded Docs
```

## Fixes 🐞
- [[#387](https://github.com/sighupio/distribution/pull/387)]: This PR fixed an issue that prevented the control planes nodes array to be treated as immutable under the OnPremises provider. The number of control plane nodes was originally set as immutable in the 1.31.1 release cycle because there isn't any support to scale the etcd cluster with the number of control plane nodes in the SIGHUP Distribution yet. The issue allowed users to change the number of the control plane, even if it was explicitly marked as immutable.

Expand Down
43 changes: 43 additions & 0 deletions schemas/public/onpremises-kfd-v1alpha2.json
Original file line number Diff line number Diff line change
Expand Up @@ -834,6 +834,9 @@
"dr": {
"$ref": "#/$defs/Spec.Distribution.Modules.Dr"
},
"docs": {
"$ref": "#/$defs/Spec.Distribution.Modules.Docs"
},
"ingress": {
"$ref": "#/$defs/Spec.Distribution.Modules.Ingress"
},
Expand All @@ -860,6 +863,46 @@
"policy"
]
},
"Spec.Distribution.Modules.Docs": {
"type": "object",
"additionalProperties": false,
"properties": {
"overrides": {
"$ref": "#/$defs/Spec.Distribution.Modules.Docs.Overrides"
},
"enabled": {
"type": "boolean",
"default": true,
"description": "When enabled, the docs site will be included in the distribution and available at `docs.<baseDomain>`."
}
}
},
"Spec.Distribution.Modules.Docs.Overrides": {
"type": "object",
"additionalProperties": false,
"description": "Override the common configuration with a particular configuration for the Docs module.",
"properties": {
"ingresses": {
"type": "object",
"additionalProperties": false,
"properties": {
"docs": {
"$ref": "#/$defs/Types.FuryModuleOverridesIngress"
}
} },
"nodeSelector": {
"$ref": "#/$defs/Types.KubeNodeSelector",
"description": "Set to override the node selector used to place the pods of the Ingress module."
},
"tolerations": {
"type": "array",
"items": {
"$ref": "#/$defs/Types.KubeToleration"
},
"description": "Set to override the tolerations that will be added to the pods of the Ingress module."
}
}
},
"Spec.Distribution.Modules.Ingress": {
"type": "object",
"additionalProperties": false,
Expand Down
4 changes: 4 additions & 0 deletions templates/distribution/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -224,3 +224,7 @@ cert-manager.io/cluster-issuer: {{ .spec.distribution.modules.ingress.certManage
{{ define "hubbleUrl" }}
{{- template "ingressHost" (dict "module" "networking" "package" "hubble" "prefix" "hubble." "spec" .) -}}
{{ end }}

{{ define "docsUrl" }}
{{- template "ingressHost" (dict "module" "docs" "package" "docs" "prefix" "docs." "spec" .) -}}
{{ end }}
52 changes: 52 additions & 0 deletions templates/distribution/manifests/docs/deployment.yaml.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: sd-docs
labels:
app.kubernetes.io/name: docs
app.kubernetes.io/version: "{{ .spec.distributionVersion }}"
app.kubernetes.io/part-of: sighup-distribution
spec:
replicas: 2
selector:
matchLabels:
app.kubernetes.io/name: docs
app.kubernetes.io/version: "{{ .spec.distributionVersion }}"
app.kubernetes.io/part-of: sighup-distribution
strategy: {}
template:
metadata:
labels:
app.kubernetes.io/name: docs
app.kubernetes.io/version: "{{ .spec.distributionVersion }}"
app.kubernetes.io/part-of: sighup-distribution
spec:
tolerations:
{{ template "tolerations" dict "module" "docs" "package" "docs" "spec" .spec }}
nodeSelector:
{{ template "nodeSelector" dict "module" "docs" "package" "docs" "spec" .spec }}
containers:
- name: docs
image: registry.sighup.io/fury/docs:{{ .spec.distributionVersion | trimPrefix "v" }}-single
ports:
- name: http
containerPort: 8080
securityContext:
privileged: false
runAsNonRoot: true
runAsUser: 101
runAsGroup: 101
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
seccompProfile:
type: RuntimeDefault
capabilities:
drop:
- ALL
volumeMounts:
- name: tmp
mountPath: /tmp
volumes:
- name: tmp
emptyDir: {}
30 changes: 30 additions & 0 deletions templates/distribution/manifests/docs/ingress.yaml.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: sd-docs
labels:
app.kubernetes.io/name: docs
app.kubernetes.io/version: "{{ .spec.distributionVersion }}"
app.kubernetes.io/part-of: sighup-distribution
annotations:
cluster.kfd.sighup.io/useful-link.url: https://{{ template "docsUrl" .spec }}
cluster.kfd.sighup.io/useful-link.name: "SD Documentation"
forecastle.stakater.com/expose: "true"
forecastle.stakater.com/appName: "SIGHUP Distribution Documentation"
forecastle.stakater.com/icon: "https://raw.githubusercontent.com/sighupio/distribution/refs/heads/main/docs/assets/black-logo.png"
{{ template "certManagerClusterIssuer" . }}
spec:
ingressClassName: {{ template "ingressClass" (dict "module" "docs" "package" "docs" "type" "internal" "spec" .spec) }}
rules:
- host: {{ template "docsUrl" .spec }}
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: sd-docs
port:
name: http
{{- template "ingressTls" (dict "module" "docs" "package" "docs" "prefix" "docs." "spec" .spec) }}
10 changes: 10 additions & 0 deletions templates/distribution/manifests/docs/kustomization.yaml.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: sd-docs
resources:
- namespace.yaml
- deployment.yaml
- service.yaml
{{- if ne .spec.distribution.modules.ingress.nginx.type "none" }}
- ingress.yaml
{{- end }}
8 changes: 8 additions & 0 deletions templates/distribution/manifests/docs/namespace.yaml.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
apiVersion: v1
kind: Namespace
metadata:
name: sd-docs
labels:
app.kubernetes.io/name: docs
app.kubernetes.io/version: "{{ .spec.distributionVersion }}"
app.kubernetes.io/part-of: sighup-distribution
18 changes: 18 additions & 0 deletions templates/distribution/manifests/docs/service.yaml.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
apiVersion: v1
kind: Service
metadata:
name: sd-docs
labels:
app.kubernetes.io/name: docs
app.kubernetes.io/version: "{{ .spec.distributionVersion }}"
app.kubernetes.io/part-of: sighup-distribution
spec:
selector:
app.kubernetes.io/name: docs
app.kubernetes.io/version: "{{ .spec.distributionVersion }}"
app.kubernetes.io/part-of: sighup-distribution
ports:
- name: http
port: 80
targetPort: http
3 changes: 3 additions & 0 deletions templates/distribution/manifests/kustomization.yaml.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ resources:
{{- if and (eq .spec.distribution.modules.tracing.type "tempo") (.checks.storageClassAvailable) }}
- tracing
{{- end }}
{{- if .spec.distribution.modules.docs.enabled }}
- docs
{{- end }}

{{- if .spec.distribution.customPatches.patchesStrategicMerge }}
patchesStrategicMerge:
Expand Down