Skip to content

Commit 11fcae5

Browse files
committed
feat: adds instructions
1 parent 4a1c83c commit 11fcae5

20 files changed

+1486
-1
lines changed

.github/workflows/build-test.yaml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Copyright 2025 Defense Unicorns
2+
# SPDX-License-Identifier: AGPL-3.0-or-later OR LicenseRef-Defense-Unicorns-Commercial
3+
4+
name: Test UDS RKE2 Demo
5+
6+
on:
7+
pull_request:
8+
paths-ignore:
9+
- "**.md"
10+
- "docs/**"
11+
- "CODEOWNERS"
12+
workflow_dispatch
13+
workflow_call:
14+
15+
jobs:
16+
test-clean-install:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
20+
21+
- name: Install UDS CLI
22+
uses: defenseunicorns/setup-uds@ab842abcad1f7a3305c2538e3dd1950d0daacfa5 # v1.0.1
23+
with:
24+
# renovate: datasource=github-tags depName=defenseunicorns/uds-cli versioning=semver
25+
version: v0.27.11
26+
27+
- name: Create and deploy the uds-rke2-demo bundle
28+
run: uds run --no-progress
29+
30+
- name: Validate uds-rke2-demo bundle
31+
run: uds run validate --no-progress
32+
33+
- name: Debug Output
34+
if: ${{ always() }}
35+
uses: ./.github/actions/debug-output

.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
.cache/
2+
.idea/
3+
build/
4+
.DS_Store
5+
*.tar.zst
6+
zarf-sbom
7+
tmp/
8+
zarf-config.yaml
9+
*.tar

LICENSE

Lines changed: 661 additions & 0 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 71 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,72 @@
11
# uds-rke2-demo
2-
Configuration to deploy UDS on VM-based RKE2 clusters
2+
3+
This repo provides configuration and automation for deploying UDS Core on RKE2 with an emphasis on on-prem installations. The code in this repo is meant to accompany the official UDS docs.
4+
5+
6+
## Quickstart (using Lima)
7+
8+
This quickstart is for users who want to deploy UDS RKE2 on a local Ubuntu VM using Lima.
9+
10+
### Host System requirements
11+
12+
The following requirements assume you will be running a VM locally using Lima
13+
14+
- 32GB RAM
15+
- 14 CPU cores
16+
17+
18+
### Prerequisites
19+
20+
- [Lima](https://lima-vm.io/docs/installation/)
21+
- [UDS CLI](https://github.com/defenseunicorns/uds-cli/tree/main?tab=readme-ov-file#install)
22+
23+
24+
The following command creates a Lima Ubuntu VM with an RKE2 cluster, and installs UDS Core:
25+
26+
```
27+
uds run
28+
```
29+
30+
31+
## Quickstart (RKE2 already running)
32+
33+
This quickstart assumes an RKE2 cluster is running and is accessible via the CLI.
34+
35+
### System Requirements
36+
37+
The following are recommended compute requirements for the system that the RKE2 instance is running on:
38+
39+
- 20GB RAM
40+
- 10 CPU cores
41+
42+
### Prerequisites
43+
44+
- [UDS CLI](https://github.com/defenseunicorns/uds-cli/tree/main?tab=readme-ov-file#install)
45+
46+
Assuming you are connected to the RKE2 cluster, the following command will install UDS Core and and its prerequisites
47+
48+
```
49+
uds run install
50+
```
51+
52+
## Accessing UDS Core apps
53+
54+
After installing UDS Core and the post-installation configs, find the IP of the installed ingresses with:
55+
```
56+
kubectl get ingress istio-admin-https -n istio-admin-gateway -o jsonpath='{.status.loadBalancer.ingress[0].ip}'
57+
```
58+
59+
> [!NOTE]
60+
> It takes a moment for the NGINX controller to assign an IP to the ingress resources, so the IP may not show up right away.
61+
62+
After getting the IP, use `/etc/hosts` to enable resolution of UDS Core app hostnames, for example:
63+
```
64+
# /etc/hosts
65+
66+
...
67+
68+
192.168.64.3 keycloak.admin.uds.dev grafana.admin.uds.dev sso.uds.dev neuvector.admin.uds.dev
69+
70+
```
71+
72+
UDS Core apps should now be accessible via the host machine's web browser.

chart/.helmignore

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Patterns to ignore when building packages.
2+
# This supports shell glob matching, relative path matching, and
3+
# negation (prefixed with !). Only one pattern per line.
4+
.DS_Store
5+
# Common VCS dirs
6+
.git/
7+
.gitignore
8+
.bzr/
9+
.bzrignore
10+
.hg/
11+
.hgignore
12+
.svn/
13+
# Common backup files
14+
*.swp
15+
*.bak
16+
*.tmp
17+
*.orig
18+
*~
19+
# Various IDEs
20+
.project
21+
.idea/
22+
*.tmproj
23+
.vscode/

chart/Chart.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
apiVersion: v2
2+
name: uds-dev-stack
3+
description: UDS dev stack chart
4+
type: application
5+
version: 0.15.2

chart/templates/_helpers.tpl

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
{{/*
2+
Expand the name of the chart.
3+
*/}}
4+
{{- define "uds-dev-stack.name" -}}
5+
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
6+
{{- end }}
7+
8+
{{/*
9+
Create a default fully qualified app name.
10+
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
11+
If release name contains chart name it will be used as a full name.
12+
*/}}
13+
{{- define "uds-dev-stack.fullname" -}}
14+
{{- if .Values.fullnameOverride }}
15+
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
16+
{{- else }}
17+
{{- $name := default .Chart.Name .Values.nameOverride }}
18+
{{- if contains $name .Release.Name }}
19+
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
20+
{{- else }}
21+
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
22+
{{- end }}
23+
{{- end }}
24+
{{- end }}
25+
26+
{{/*
27+
Create chart name and version as used by the chart label.
28+
*/}}
29+
{{- define "uds-dev-stack.chart" -}}
30+
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
31+
{{- end }}
32+
33+
{{/*
34+
Common labels
35+
*/}}
36+
{{- define "uds-dev-stack.labels" -}}
37+
helm.sh/chart: {{ include "uds-dev-stack.chart" . }}
38+
{{ include "uds-dev-stack.selectorLabels" . }}
39+
{{- if .Chart.AppVersion }}
40+
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
41+
{{- end }}
42+
app.kubernetes.io/managed-by: {{ .Release.Service }}
43+
{{- end }}
44+
45+
{{/*
46+
Selector labels
47+
*/}}
48+
{{- define "uds-dev-stack.selectorLabels" -}}
49+
app.kubernetes.io/name: {{ include "uds-dev-stack.name" . }}
50+
app.kubernetes.io/instance: {{ .Release.Name }}
51+
{{- end }}
52+
53+
{{/*
54+
Create the name of the service account to use
55+
*/}}
56+
{{- define "uds-dev-stack.serviceAccountName" -}}
57+
{{- if .Values.serviceAccount.create }}
58+
{{- default (include "uds-dev-stack.fullname" .) .Values.serviceAccount.name }}
59+
{{- else }}
60+
{{- default "default" .Values.serviceAccount.name }}
61+
{{- end }}
62+
{{- end }}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Copyright 2025 Defense Unicorns
2+
# SPDX-License-Identifier: AGPL-3.0-or-later OR LicenseRef-Defense-Unicorns-Commercial
3+
4+
apiVersion: v1
5+
kind: ConfigMap
6+
metadata:
7+
name: coredns-custom
8+
namespace: kube-system
9+
data:
10+
uds.override: |
11+
{{ .Values.coreDnsOverrides | indent 4 }}

chart/templates/localpath-rwx.yaml

Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
# Copyright 2025 Defense Unicorns
2+
# SPDX-License-Identifier: AGPL-3.0-or-later OR LicenseRef-Defense-Unicorns-Commercial
3+
4+
apiVersion: v1
5+
kind: ServiceAccount
6+
metadata:
7+
name: local-path-provisioner-service-account
8+
namespace: {{ .Release.Namespace }}
9+
10+
---
11+
apiVersion: rbac.authorization.k8s.io/v1
12+
kind: ClusterRole
13+
metadata:
14+
name: local-path-provisioner-role
15+
rules:
16+
- apiGroups: [ "" ]
17+
resources: [ "nodes", "persistentvolumeclaims", "configmaps" ]
18+
verbs: [ "get", "list", "watch" ]
19+
- apiGroups: [ "" ]
20+
resources: [ "endpoints", "persistentvolumes", "pods" ]
21+
verbs: [ "*" ]
22+
- apiGroups: [ "" ]
23+
resources: [ "events" ]
24+
verbs: [ "create", "patch" ]
25+
- apiGroups: [ "storage.k8s.io" ]
26+
resources: [ "storageclasses" ]
27+
verbs: [ "get", "list", "watch" ]
28+
29+
---
30+
apiVersion: rbac.authorization.k8s.io/v1
31+
kind: ClusterRoleBinding
32+
metadata:
33+
name: local-path-provisioner-bind
34+
roleRef:
35+
apiGroup: rbac.authorization.k8s.io
36+
kind: ClusterRole
37+
name: local-path-provisioner-role
38+
subjects:
39+
- kind: ServiceAccount
40+
name: local-path-provisioner-service-account
41+
namespace: {{ .Release.Namespace }}
42+
43+
---
44+
apiVersion: apps/v1
45+
kind: Deployment
46+
metadata:
47+
name: local-path-provisioner
48+
namespace: {{ .Release.Namespace }}
49+
spec:
50+
replicas: 1
51+
selector:
52+
matchLabels:
53+
app: local-path-provisioner
54+
template:
55+
metadata:
56+
labels:
57+
app: local-path-provisioner
58+
spec:
59+
serviceAccountName: local-path-provisioner-service-account
60+
containers:
61+
- name: local-path-provisioner
62+
image: {{.Values.images.localPathProvisioner.repository}}:{{.Values.images.localPathProvisioner.tag}}
63+
imagePullPolicy: IfNotPresent
64+
command:
65+
- local-path-provisioner
66+
- --debug
67+
- start
68+
- --config
69+
- /etc/config/config.json
70+
volumeMounts:
71+
- name: config-volume
72+
mountPath: /etc/config/
73+
env:
74+
- name: POD_NAMESPACE
75+
valueFrom:
76+
fieldRef:
77+
fieldPath: metadata.namespace
78+
volumes:
79+
- name: config-volume
80+
configMap:
81+
name: local-path-config
82+
83+
---
84+
apiVersion: storage.k8s.io/v1
85+
kind: StorageClass
86+
metadata:
87+
name: local-path
88+
annotations:
89+
storageclass.kubernetes.io/is-default-class: "true"
90+
provisioner: rancher.io/local-path
91+
volumeBindingMode: WaitForFirstConsumer
92+
reclaimPolicy: Delete
93+
allowVolumeExpansion: true
94+
95+
---
96+
kind: ConfigMap
97+
apiVersion: v1
98+
metadata:
99+
name: local-path-config
100+
namespace: {{ .Release.Namespace }}
101+
data:
102+
config.json: |-
103+
{
104+
"sharedFileSystemPath": "/opt/local-path-provisioner-rwx"
105+
}
106+
setup: |-
107+
#!/bin/sh
108+
set -eu
109+
mkdir -m 0777 -p "$VOL_DIR"
110+
teardown: |-
111+
#!/bin/sh
112+
set -eu
113+
rm -rf "$VOL_DIR"
114+
helperPod.yaml: |-
115+
apiVersion: v1
116+
kind: Pod
117+
metadata:
118+
name: helper-pod
119+
spec:
120+
containers:
121+
- name: helper-pod
122+
image: {{.Values.images.busybox.repository}}:{{.Values.images.busybox.tag}}
123+
imagePullPolicy: IfNotPresent
124+
# This runs as root to have permissions on the host filesystem
125+
securityContext:
126+
runAsUser: 0
127+
runAsGroup: 0

chart/templates/metallb.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Copyright 2025 Defense Unicorns
2+
# SPDX-License-Identifier: AGPL-3.0-or-later OR LicenseRef-Defense-Unicorns-Commercial
3+
4+
apiVersion: metallb.io/v1beta1
5+
kind: IPAddressPool
6+
metadata:
7+
name: dev
8+
namespace: {{ .Release.Namespace }}
9+
spec:
10+
addresses:
11+
- "###ZARF_VAR_BASE_IP###.200-###ZARF_VAR_BASE_IP###.215"
12+
---
13+
apiVersion: metallb.io/v1beta1
14+
kind: L2Advertisement
15+
metadata:
16+
name: empty

0 commit comments

Comments
 (0)