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 all 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
##### 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>
```
44 changes: 40 additions & 4 deletions bundles/k3d-standard/uds-bundle.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@ packages:
uds-dev-stack:
minio:
variables:
- name: buckets
- name: BUCKETS
description: "Set Minio Buckets"
path: buckets
- name: svcaccts
- name: SVCACCTS
description: "Minio Service Accounts"
path: svcaccts
- name: users
- name: USERS
description: "Minio Users"
path: users
- name: policies
- name: POLICIES
description: "Minio policies"
path: policies

Expand All @@ -39,6 +39,42 @@ packages:
ref: 0.17.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"
- name: LOKI_WRITE_REPLICAS
path: write.replicas
description: "Loki write replicas"
default: "1"
- name: LOKI_READ_REPLICAS
path: read.replicas
description: "Loki read replicas"
default: "1"
- name: LOKI_BACKEND_REPLICAS
path: backend.replicas
description: "Loki backend replicas"
default: "1"
istio-admin-gateway:
uds-istio-config:
variables:
Expand Down
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
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
scalable: false
mjnagel marked this conversation as resolved.
Show resolved Hide resolved
55 changes: 33 additions & 22 deletions src/loki/values/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,28 @@ fullnameOverride: loki
# -- Overrides the chart's cluster label
clusterLabelOverride: null

# Prevent startup issues with service existence/resolution
memberlist:
service:
publishNotReadyAddresses: true

loki:
storage:
type: "filesystem"
bucketNames:
chunks: uds
ruler: uds
admin: uds
type: s3
s3:
endpoint: http://minio.uds-dev-stack.svc.cluster.local:9000
mjnagel marked this conversation as resolved.
Show resolved Hide resolved
secretAccessKey: uds-secret
accessKeyId: uds
s3ForcePathStyle: true
insecure: false
commonConfig:
replication_factor: 1
extraMemberlistConfig:
rejoin_interval: 120s
# Should authentication be enabled
auth_enabled: false
# -- Additional storage config
Expand Down Expand Up @@ -48,29 +65,11 @@ rbac:
# -- Section for configuring optional Helm test
test:
enabled: false
# Configuration for the write pod(s)
write:
resources:
limits:
cpu: 300m
memory: 2Gi
requests:
cpu: 300m
memory: 2Gi
# 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

# 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 @@ -118,5 +117,17 @@ monitoring:
enabled: false
gateway:
enabled: true
# Remove default anti-affinity since this is a 1-replica setup
# Remove default anti-affinity to support single node
affinity: ""

read:
# Remove default anti-affinity to support single node
affinity: ""

write:
# Remove default anti-affinity to support single node
affinity: ""

backend:
# Remove default anti-affinity to support single node
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: 3 additions & 3 deletions tasks/create.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ tasks:
- task: pepr-build

- description: "Create the UDS Core Standard Zarf Package"
cmd: "uds zarf package create packages/standard --confirm --flavor ${FLAVOR}"
cmd: "uds zarf package create packages/standard --confirm --no-progress --flavor ${FLAVOR}"

- name: k3d-standard-bundle
description: "Create the K3d-UDS Core Bundle"
Expand Down Expand Up @@ -41,10 +41,10 @@ tasks:
- task: pepr-build

- description: "Create the Pepr Zarf Package, if it exists"
cmd: "uds zarf package create dist --confirm"
cmd: "uds zarf package create dist --confirm --no-progress"

- description: "Create the requested Zarf Package (must set UDS_PKG environment variable)"
cmd: "uds zarf package create src/${UDS_PKG} --confirm --flavor ${FLAVOR}"
cmd: "uds zarf package create src/${UDS_PKG} --confirm --no-progress --flavor ${FLAVOR}"

- name: pepr-build
description: "Build the UDS Core Pepr Module"
Expand Down