Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: switch loki to simple scalable #156

Merged
merged 58 commits into from
Mar 26, 2024
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
3239359
chore: switch loki to simple scalable
rjferguson21 Feb 8, 2024
93ca97f
Merge remote-tracking branch 'origin/main' into loki-scalable
rjferguson21 Feb 8, 2024
3b9e1a7
yaml lint
rjferguson21 Feb 8, 2024
0fb1b68
loki cleanup
rjferguson21 Feb 8, 2024
f3c9eba
single package bundle test
rjferguson21 Feb 8, 2024
404e512
Merge remote-tracking branch 'origin/main' into loki-scalable
rjferguson21 Feb 12, 2024
14c3a3c
test bundle for config
rjferguson21 Feb 12, 2024
8e6808f
Merge remote-tracking branch 'origin/main' into loki-scalable
rjferguson21 Feb 12, 2024
55b93c7
Merge remote-tracking branch 'origin/main' into loki-scalable
rjferguson21 Feb 12, 2024
974762a
remove old values for scalable
rjferguson21 Feb 14, 2024
e22f421
ha by default, single bucket
rjferguson21 Feb 14, 2024
23fcf08
fix bucket name
rjferguson21 Feb 15, 2024
03f0a40
update readme
rjferguson21 Feb 15, 2024
379daaa
update to latest uds-k3d
rjferguson21 Feb 16, 2024
7444f5f
update to use default uds-k3d minio config
rjferguson21 Feb 16, 2024
50a86df
uds-k3d ref
rjferguson21 Feb 16, 2024
c7c1148
remove test bundle
rjferguson21 Feb 16, 2024
954f21a
update to allow nodes to be specified
rjferguson21 Feb 20, 2024
51ee6ac
Merge remote-tracking branch 'origin/main' into loki-scalable
rjferguson21 Feb 20, 2024
1ebde49
yaml lint
rjferguson21 Feb 20, 2024
6924e8d
posix check
rjferguson21 Feb 20, 2024
a208df3
Merge remote-tracking branch 'origin/main' into loki-scalable
rjferguson21 Feb 27, 2024
166fa9b
Merge branch 'main' into loki-scalable
MxNxPx Mar 12, 2024
a8d4412
fix: some ci tweaks (#247)
MxNxPx Mar 12, 2024
5e64cb8
Merge branch 'main' into loki-scalable
MxNxPx Mar 18, 2024
5dde09c
Merge branch 'main' into loki-scalable
MxNxPx Mar 18, 2024
8abd0f4
rollback multi-node ci loki single package
rjferguson21 Mar 18, 2024
4536285
fix lint
rjferguson21 Mar 18, 2024
94fec6b
add node logs
rjferguson21 Mar 19, 2024
1afa473
add pod logs
rjferguson21 Mar 19, 2024
69c3b7c
all containers
rjferguson21 Mar 19, 2024
79d10f6
k3s version test
rjferguson21 Mar 20, 2024
368a3ed
Merge branch 'main' into loki-scalable
rjferguson21 Mar 20, 2024
2db985a
k3d args
rjferguson21 Mar 20, 2024
edf7599
fail happy
rjferguson21 Mar 20, 2024
4770d83
no k3d update
rjferguson21 Mar 20, 2024
179dc47
remove debug
rjferguson21 Mar 21, 2024
a6a7ebf
fix: loki values for startup
mjnagel Mar 21, 2024
dc78a0c
Merge branch 'main' into loki-scalable
mjnagel Mar 21, 2024
ef61bce
fix docs headers
rjferguson21 Mar 22, 2024
9b40c36
add empty values yaml
rjferguson21 Mar 22, 2024
3d7c2e8
skip neuvector test
rjferguson21 Mar 22, 2024
8d6d0d2
add logs promtail
rjferguson21 Mar 22, 2024
6a0ebea
promtail logs
rjferguson21 Mar 22, 2024
b39003b
add neuvector
rjferguson21 Mar 22, 2024
223a6b3
debug logs
rjferguson21 Mar 22, 2024
a5ee0a1
yaml lint
rjferguson21 Mar 22, 2024
309c90c
yaml lint
rjferguson21 Mar 22, 2024
bb30e47
test with no netpol
rjferguson21 Mar 22, 2024
162a420
node filter
rjferguson21 Mar 22, 2024
575f4ea
test k3s image
rjferguson21 Mar 22, 2024
56e2ff2
16 core
rjferguson21 Mar 25, 2024
17979f0
router metrics, 8 core
rjferguson21 Mar 25, 2024
f146c0b
all metrics
rjferguson21 Mar 25, 2024
ffe5f40
custom k3s image
rjferguson21 Mar 25, 2024
a90b5dd
test 1.28
rjferguson21 Mar 26, 2024
b008a50
Merge remote-tracking branch 'origin/main' into loki-scalable
rjferguson21 Mar 26, 2024
a96c9f0
clean up debug
rjferguson21 Mar 26, 2024
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
76 changes: 63 additions & 13 deletions bundles/k3d-standard/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,76 @@ This bundle is used for demonstration, development, and testing of UDS Core. In
- [MetalLB](https://metallb.universe.tf/) - Provides type: LoadBalancer for cluster resources and Istio Gateways
- [HAProxy](https://www.haproxy.org/) - Utilizes k3d host port mapping to bind ports 80 and 443, facilitating local FQDN-based routing through ACLs to MetalLB load balancer backends for Istio Gateways serving *.uds.dev, keycloak.uds.dev, and *.admin.uds.dev.

## Configuration
## Available Overrides
## Package: uds-k3d
mjnagel marked this conversation as resolved.
Show resolved Hide resolved
##### uds-dev-stack (minio)
| Variable | Description | Path |
|----------|-------------|------|
| `BUCKETS` | Set Minio Buckets | buckets |
| `SVCACCTS` | Minio Service Accounts | svcaccts |
| `USERS` | Minio Users | users |
| `POLICIES` | Minio policies | policies |

### Minio

You can customize the Minio setup at deploy time via your ```uds-config.yaml```.
## Package: core
##### loki (loki)
| Variable | Description | Path |
|----------|-------------|------|
| `LOKI_CHUNKS_BUCKET` | The object storage bucket for Loki chunks | loki.storage.bucketNames.chunks |
| `LOKI_RULER_BUCKET` | The object storage bucket for Loki ruler | loki.storage.bucketNames.ruler |
| `LOKI_ADMIN_BUCKET` | The object storage bucket for Loki admin | loki.storage.bucketNames.admin |
| `LOKI_S3_ENDPOINT` | The S3 endpoint | loki.storage.s3.endpoint |
| `LOKI_S3_REGION` | The S3 region | loki.storage.s3.region |
| `LOKI_S3_ACCESS_KEY_ID` | The S3 Access Key ID | loki.storage.s3.accessKeyId |
| `LOKI_S3_SECRET_ACCESS_KEY` | The S3 Secret Access Key | loki.storage.s3.secretAccessKey |

Example:
##### istio-admin-gateway (uds-istio-config)
| Variable | Description | Path |
|----------|-------------|------|
| `ADMIN_TLS_CERT` | The TLS cert for the admin gateway (must be base64 encoded) | tls.cert |
| `ADMIN_TLS_KEY` | The TLS key for the admin gateway (must be base64 encoded) | tls.key |

##### istio-tenant-gateway (uds-istio-config)
| Variable | Description | Path |
|----------|-------------|------|
| `TENANT_TLS_CERT` | The TLS cert for the tenant gateway (must be base64 encoded) | tls.cert |
| `TENANT_TLS_KEY` | The TLS key for the tenant gateway (must be base64 encoded) | tls.key |


## Override Examples:

### Minio Customization

You can customize the Minio deployed with uds-k3d at deploy time via your ```uds-config.yaml```.

```yaml
variables:
uds-k3d-dev:
set:
buckets:
- name: "myfavoritebucket"
policy: "public"
purge: false
users:
- accessKey: console
secretKey: "console-secret"
policy: consoleAdmin
BUCKETS:
- name: "myfavoritebucket"
policy: "public"
purge: false
USERS:
- accessKey: console
secretKey: "console-secret"
policy: consoleAdmin
```

For more details on how to customize the Minio deployment, please see [Configuring Minio](https://github.com/defenseunicorns/uds-k3d/blob/main/docs/MINIO.md).

### Loki example using AWS S3
By default Loki will be configured to use the uds-k3d built in Minio, but variables are exposed with this bundle to configure external object storage

You can customize the Loki setup at deploy time via ```uds-config.yaml```

```yaml
variables:
core:
LOKI_CHUNKS_BUCKET: loki
LOKI_RULES_BUCKET: loki
LOKI_ADMIN_BUCKET: loki
LOKI_S3_ENDPOINT: loki.s3.us-east-1.amazonaws.com
LOKI_S3_REGION: us-east-1
LOKI_S3_ACCESS_KEY_ID: <ACCESS_KEY_ID>
LOKI_S3_SECRET_ACCESS_KEY: <SECRET_ACCESS_KEY>
```
30 changes: 30 additions & 0 deletions bundles/k3d-standard/uds-bundle.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ packages:
overrides:
uds-dev-stack:
minio:
values:
- path: "users"
value:
- accessKey: logging
secretKey: "logging-secret"
policy: readwrite
variables:
- name: buckets
description: "Set Minio Buckets"
Expand All @@ -39,6 +45,30 @@ packages:
ref: 0.12.0
# x-release-please-end
overrides:
loki:
mjnagel marked this conversation as resolved.
Show resolved Hide resolved
loki:
variables:
- name: LOKI_CHUNKS_BUCKET
description: "The object storage bucket for Loki chunks"
path: loki.storage.bucketNames.chunks
- name: LOKI_RULER_BUCKET
description: "The object storage bucket for Loki ruler"
path: loki.storage.bucketNames.ruler
- name: LOKI_ADMIN_BUCKET
description: "The object storage bucket for Loki admin"
path: loki.storage.bucketNames.admin
- name: LOKI_S3_ENDPOINT
description: "The S3 endpoint"
path: loki.storage.s3.endpoint
- name: LOKI_S3_REGION
description: "The S3 region"
path: loki.storage.s3.region
- name: LOKI_S3_ACCESS_KEY_ID
description: "The S3 Access Key ID"
path: loki.storage.s3.accessKeyId
- name: LOKI_S3_SECRET_ACCESS_KEY
path: loki.storage.s3.secretAccessKey
description: "The S3 Secret Access Key"
istio-admin-gateway:
uds-istio-config:
variables:
Expand Down
25 changes: 25 additions & 0 deletions bundles/k3d-test/uds-bundle.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
kind: UDSBundle
metadata:
name: k3d-core-test
description: A UDS bundle for deploying uds-k3d-dev for CI/test
version: test

packages:
- name: uds-k3d-dev
repository: ghcr.io/defenseunicorns/packages/uds-k3d
# renovate: datasource=github-tags depName=defenseunicorns/uds-k3d versioning=semver
ref: 0.3.1
overrides:
uds-dev-stack:
minio:
values:
- path: "users"
value:
- accessKey: logging
secretKey: "logging-secret"
policy: readwrite

- name: init
repository: ghcr.io/defenseunicorns/packages/init
# renovate: datasource=github-tags depName=defenseunicorns/zarf versioning=semver
ref: v0.32.2
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if .Values.scalable }}
{{- if .Capabilities.APIVersions.Has "security.istio.io/v1beta1" }}
apiVersion: "security.istio.io/v1beta1"
kind: PeerAuthentication
metadata:
Expand Down
1 change: 0 additions & 1 deletion src/loki/chart/values.yaml

This file was deleted.

39 changes: 22 additions & 17 deletions src/loki/values/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,17 @@ clusterLabelOverride: null

loki:
storage:
type: "filesystem"
bucketNames:
chunks: test
ruler: test
admin: test
type: s3
s3:
endpoint: http://minio.uds-dev-stack.svc.cluster.local:9000
mjnagel marked this conversation as resolved.
Show resolved Hide resolved
secretAccessKey: logging-secret
accessKeyId: logging
s3ForcePathStyle: true
insecure: false
commonConfig:
replication_factor: 1
# Should authentication be enabled
Expand Down Expand Up @@ -50,27 +60,18 @@ test:
enabled: false
# Configuration for the write pod(s)
write:
resources:
limits:
cpu: 300m
memory: 2Gi
requests:
cpu: 300m
memory: 2Gi
# Remove default anti-affinity since this is a 1-replica setup
affinity: ""
rjferguson21 marked this conversation as resolved.
Show resolved Hide resolved

# Configuration for the read pod(s)
read:
# -- Resource requests and limits for the read
resources:
limits:
cpu: 300m
memory: 2Gi
requests:
cpu: 300m
memory: 2Gi
# Remove default anti-affinity since this is a 1-replica setup
affinity: ""

# Configuration for the single binary node(s)
singleBinary:
# -- Number of replicas for the single binary
replicas: 1
replicas: 0
# -- Resource requests and limits for the single binary
resources:
limits:
Expand Down Expand Up @@ -120,3 +121,7 @@ gateway:
enabled: true
# Remove default anti-affinity since this is a 1-replica setup
affinity: ""

backend:
# Remove default anti-affinity since this is a 1-replica setup
affinity: ""
2 changes: 1 addition & 1 deletion src/loki/zarf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ components:

- name: loki
required: true
description: "Install Loki using Chainguard images"
description: "Install Loki using registry1 images"
only:
flavor: "registry1"
import:
Expand Down
6 changes: 6 additions & 0 deletions tasks/create.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ tasks:
- description: "Create the UDS Core Istio Only Bundle"
cmd: "uds create bundles/k3d-istio --confirm --no-progress --architecture=${ZARF_ARCHITECTURE}"

- name: k3d-test-bundle
description: "Create the test Bundle"
actions:
- description: "Create the test Bundle"
cmd: "uds create bundles/k3d-test --confirm --no-progress --architecture=${ZARF_ARCHITECTURE}"

- name: single-package
description: "Create a single Zarf Package, must set UDS_PKG environment variable"
actions:
Expand Down
5 changes: 5 additions & 0 deletions tasks/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ tasks:
- description: "Deploy the requested Zarf Package (must set UDS_PKG environment variable)"
cmd: uds zarf package deploy build/zarf-package-uds-core-${UDS_PKG}-${UDS_ARCH}.tar.zst --confirm

- name: k3d-test-bundle
actions:
- description: "Deploy the UDS Test Bundle"
cmd: uds deploy bundles/k3d-test/uds-bundle-k3d-core-test-${UDS_ARCH}-test.tar.zst --confirm --no-progress

- name: latest-package-release
actions:
- description: "Get latest tag version from OCI"
Expand Down
6 changes: 4 additions & 2 deletions tasks/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ tasks:
- name: single-package
description: "Build and test a single package, must set UDS_PKG environment variable"
actions:
- task: create:k3d-test-bundle
- task: deploy:k3d-test-bundle
- task: create:single-package
- task: setup:k3d-test-cluster
- task: deploy:single-package

- description: "Validate the package"
Expand Down Expand Up @@ -37,7 +38,8 @@ tasks:
- name: uds-core-upgrade
description: "Test an upgrade from the latest released UDS Core package to current branch"
actions:
- task: setup:k3d-test-cluster
- task: create:k3d-test-bundle
- task: deploy:k3d-test-bundle
- task: deploy:latest-package-release
- task: create:standard-package
- task: deploy:standard-package
Expand Down
Loading