Skip to content

Commit 863458f

Browse files
authored
refactor(dir): update directory to latest version (#142)
Signed-off-by: Árpád Csepi <csepi.arpad@outlook.com>
1 parent ce387ec commit 863458f

File tree

17 files changed

+431
-490
lines changed

17 files changed

+431
-490
lines changed

.github/actions/deploy-ads/action.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ inputs:
88
directory-image-tag:
99
description: 'Set slim container image version'
1010
required: false
11-
default: 'v0.2.5'
11+
default: 'v0.4.0'
1212
directory-chart-tag:
1313
description: 'Set slim chart version'
1414
required: false
15-
default: 'v0.2.5'
15+
default: 'v0.4.0'
1616
kind-cluster-name:
1717
description: 'Set kind cluster name where components are deployed'
1818
required: false
@@ -28,7 +28,7 @@ inputs:
2828
dirctl-bin-version:
2929
description: 'Version of dirctl binary'
3030
required: false
31-
default: 'v0.2.1'
31+
default: 'v0.4.0'
3232
network-namespace-prefix:
3333
description: 'Set cluster namespace where directory network are deployed'
3434
required: false
@@ -65,7 +65,6 @@ runs:
6565
--wait-for-jobs \
6666
--timeout "15m"
6767
68-
6968
- name: Set OS and Architecture variables
7069
if: ${{ inputs.deploy-dir-network == 'true' }}
7170
id: os_arch

integrations/agntcy-dir/Taskfile.yml

Lines changed: 77 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ vars:
1212
## Image config
1313
IMAGE_REPO: '{{ .IMAGE_REPO | default "ghcr.io/agntcy" }}'
1414

15-
DIRECTORY_IMAGE_TAG: '{{ .DIRECTORY_IMAGE_TAG | default "v0.2.7" }}'
16-
DIRECTORY_CHART_TAG: '{{ .DIRECTORY_CHART_TAG | default "v0.2.7" }}'
15+
DIRECTORY_IMAGE_TAG: '{{ .DIRECTORY_IMAGE_TAG | default "v0.4.0" }}'
16+
DIRECTORY_CHART_TAG: '{{ .DIRECTORY_CHART_TAG | default "v0.4.0" }}'
1717
DIRECTORY_NAMESPACE: '{{ .DIRECTORY_NAMESPACE | default "default" }}'
1818

1919
REMOVE_CONTAINERS: '{{ .REMOVE_CONTAINERS | default "true" }}'
@@ -41,7 +41,7 @@ vars:
4141
else
4242
printf $DIRCTL_BIN_PATH
4343
fi
44-
DIRCTL_BIN_VERSION: '{{ .DIRCTL_BIN_VERSION | default "v0.2.7" }}'
44+
DIRCTL_BIN_VERSION: '{{ .DIRCTL_BIN_VERSION | default "v0.4.0" }}'
4545

4646
tasks:
4747
k8s:port-forward:setup:
@@ -65,13 +65,31 @@ tasks:
6565

6666
test-env:deploy:
6767
desc: Deploy Agntcy directory test env
68+
vars:
69+
HELM_VALUES: './components/helm/values.yaml'
70+
71+
# Generate credentials
72+
HTPASSWD_USERNAME: 'apiserver'
73+
HTPASSWD_PASSWORD:
74+
sh: openssl rand -hex 16
75+
HTPASSWD_AUTH_HEADER:
76+
sh: echo -n "apiserver:{{ .HTPASSWD_PASSWORD }}" | base64
77+
HTPASSWD_SYNC_USERNAME: 'sync-user'
78+
HTPASSWD_SYNC_PASSWORD:
79+
sh: openssl rand -hex 16
6880
cmds:
6981
- |
7082
helm upgrade agntcy-dir \
7183
oci://{{ .IMAGE_REPO }}/dir/helm-charts/dir \
7284
--version {{ .DIRECTORY_CHART_TAG }} \
85+
-f {{ .HELM_VALUES }} \
7386
--set apiserver.image.tag="{{ .DIRECTORY_IMAGE_TAG }}" \
74-
--set apiserver.config.oci.registry_address="agntcy-dir-zot:5000" \
87+
--set apiserver.config.store.oci.registry_address="agntcy-dir-zot:5000" \
88+
--set apiserver.config.store.oci.auth_config.username="{{ .HTPASSWD_USERNAME }}" \
89+
--set apiserver.config.store.oci.auth_config.password="{{ .HTPASSWD_PASSWORD }}" \
90+
--set apiserver.config.sync.auth_config.username="{{ .HTPASSWD_SYNC_USERNAME }}" \
91+
--set apiserver.config.sync.auth_config.password="{{ .HTPASSWD_SYNC_PASSWORD }}" \
92+
--set apiserver.zot.authHeader="{{ .HTPASSWD_AUTH_HEADER }}" \
7593
--namespace {{ .DIRECTORY_NAMESPACE }} \
7694
--create-namespace \
7795
--install \
@@ -88,21 +106,45 @@ tasks:
88106
desc: Deploy Directory network peers
89107
deps:
90108
- download:dirctl-bin
91-
env:
92-
DIRECTORY_LOGGER_LOG_LEVEL: ERROR
109+
vars:
110+
HELM_VALUES: './components/helm/values.yaml'
111+
112+
# Generate credentials
113+
HTPASSWD_USERNAME: 'apiserver'
114+
HTPASSWD_PASSWORD:
115+
sh: openssl rand -hex 16
116+
HTPASSWD_AUTH_HEADER:
117+
sh: echo -n "apiserver:{{ .HTPASSWD_PASSWORD }}" | base64
118+
HTPASSWD_SYNC_USERNAME: 'sync-user'
119+
HTPASSWD_SYNC_PASSWORD:
120+
sh: openssl rand -hex 16
93121
cmds:
94122
- |
95-
test -f /tmp/node.privkey || openssl genpkey -algorithm ED25519 -out /tmp/node.privkey
96-
bootstrap_peerid=$({{ .DIRCTL_BIN_PATH }}/dirctl network info /tmp/node.privkey)
123+
# Generate private key if it doesn't exist
124+
- |
125+
test -f /tmp/node.privkey || {{.DIRCTL_BIN_PATH}}/dirctl network init --output /tmp/node.privkey
126+
127+
# Generate the bootstrap peer ID and export it to the environment file
128+
- |
129+
bootstrap_peerid=$({{.DIRCTL_BIN_PATH}}/dirctl network info /tmp/node.privkey)
97130
echo "PEER ID: ${bootstrap_peerid}"
98131
echo BOOTSTRAP_PEER_ID="${bootstrap_peerid}" > .env
132+
133+
- |
99134
helm upgrade agntcy-dir \
100135
oci://{{ .IMAGE_REPO }}/dir/helm-charts/dir \
101136
--version {{ .DIRECTORY_CHART_TAG }} \
137+
-f {{ .HELM_VALUES }} \
138+
-f ./components/config/bootstrap.yaml \
102139
--set apiserver.image.tag="{{ .DIRECTORY_IMAGE_TAG }}" \
140+
--set apiserver.config.store.oci.registry_address="agntcy-dir-zot:5000" \
141+
--set apiserver.config.routing.directory_api_address="agntcy-dir-apiserver.bootstrap.svc.cluster.local:8888" \
103142
--set apiserver.privKey="$(cat /tmp/node.privkey)" \
104-
--set apiserver.config.oci.registry_address="agntcy-dir-zot:5000" \
105-
-f ./components/config/bootstrap.yaml \
143+
--set apiserver.config.store.oci.auth_config.username="{{ .HTPASSWD_USERNAME }}" \
144+
--set apiserver.config.store.oci.auth_config.password="{{ .HTPASSWD_PASSWORD }}" \
145+
--set apiserver.config.sync.auth_config.username="{{ .HTPASSWD_SYNC_USERNAME }}" \
146+
--set apiserver.config.sync.auth_config.password="{{ .HTPASSWD_SYNC_PASSWORD }}" \
147+
--set apiserver.zot.authHeader="{{ .HTPASSWD_AUTH_HEADER }}" \
106148
--namespace bootstrap \
107149
--create-namespace \
108150
--install \
@@ -114,18 +156,40 @@ tasks:
114156
desc: Deploy Directory network peers
115157
deps:
116158
- test-env:bootstrap:deploy
159+
vars:
160+
HELM_VALUES_PATH: './components/helm/values.yaml'
161+
# Generate credentials
162+
HTPASSWD_USERNAME: 'apiserver'
163+
HTPASSWD_PASSWORD:
164+
sh: openssl rand -hex 16
165+
HTPASSWD_AUTH_HEADER:
166+
sh: echo -n "apiserver:{{ .HTPASSWD_PASSWORD }}" | base64
167+
HTPASSWD_SYNC_USERNAME: 'sync-user'
168+
HTPASSWD_SYNC_PASSWORD:
169+
sh: openssl rand -hex 16
170+
117171
cmds:
172+
# Deploy the peer servers using Helm
118173
- for:
119174
matrix:
120175
PEER: ['peer1', 'peer2', 'peer3']
121176
cmd: |
122177
export $(cat .env)
178+
123179
helm upgrade agntcy-dir \
124-
oci://{{ .IMAGE_REPO }}/dir/helm-charts/dir \
180+
oci://{{ .IMAGE_REPO }}/dir/helm-charts/dir \
181+
-f {{ .HELM_VALUES_PATH }} \
125182
--version {{ .DIRECTORY_CHART_TAG }} \
126-
--set apiserver.image.tag="{{ .DIRECTORY_IMAGE_TAG }}" \
183+
--set apiserver.config.store.oci.registry_address="agntcy-dir-zot.{{ .ITEM.PEER }}.svc.cluster.local:5000" \
127184
--set apiserver.config.routing.bootstrap_peers[0]="/dns4/agntcy-dir-apiserver-routing.bootstrap.svc.cluster.local/tcp/8999/p2p/${BOOTSTRAP_PEER_ID}" \
128-
--set apiserver.config.oci.registry_address="agntcy-dir-zot:5000" \
185+
--set apiserver.config.routing.directory_api_address="agntcy-dir-apiserver.{{ .ITEM.PEER }}.svc.cluster.local:8888" \
186+
--set-json 'apiserver.extraVolumes=[{"name":"zot-config-storage","hostPath":{"path":"/opt/zot-config-{{ .ITEM.PEER }}","type":"DirectoryOrCreate"}}]' \
187+
--set-json 'apiserver.zot.extraVolumes=[{"name":"zot-config-storage","hostPath":{"path":"/opt/zot-config-{{ .ITEM.PEER }}","type":"DirectoryOrCreate"}}]' \
188+
--set apiserver.config.store.oci.auth_config.username="{{ .HTPASSWD_USERNAME }}" \
189+
--set apiserver.config.store.oci.auth_config.password="{{ .HTPASSWD_PASSWORD }}" \
190+
--set apiserver.zot.authHeader="{{ .HTPASSWD_AUTH_HEADER }}" \
191+
--set apiserver.config.sync.auth_config.username="{{ .HTPASSWD_SYNC_USERNAME }}" \
192+
--set apiserver.config.sync.auth_config.password="{{ .HTPASSWD_SYNC_PASSWORD }}" \
129193
--namespace "{{ .ITEM.PEER }}" \
130194
--create-namespace \
131195
--install \
Lines changed: 191 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,191 @@
1+
# Copyright AGNTCY Contributors (https://github.com/agntcy)
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
apiserver:
5+
image:
6+
repository: ghcr.io/agntcy/dir-apiserver
7+
tag: v0.4.0
8+
pullPolicy: IfNotPresent
9+
pullSecrets:
10+
- name: regcred
11+
12+
service:
13+
type: NodePort
14+
15+
log_level: 'DEBUG'
16+
17+
# Server configuration
18+
config:
19+
# listen_address: "0.0.0.0:8888"
20+
# healthcheck_address: "0.0.0.0:8889"
21+
22+
# Authentication settings (handles identity verification)
23+
# Supports both X.509 (X.509-SVID) and JWT (JWT-SVID) authentication
24+
authn:
25+
# Enable authentication
26+
enabled: false
27+
# Authentication mode: "x509" or "jwt"
28+
# - x509: Uses X.509-SVID from mutual TLS peer certificates
29+
# - jwt: Uses JWT-SVID from Authorization header
30+
mode: 'x509'
31+
# SPIFFE Workload API socket path (injected by SPIRE agent)
32+
socket_path: 'unix:///run/spire/agent-sockets/api.sock'
33+
# Expected audiences for JWT validation (only used in JWT mode)
34+
audiences:
35+
- 'spiffe://example.org/dir-server'
36+
37+
# Authorization settings (handles access control policies)
38+
# Requires authentication to be enabled first
39+
authz:
40+
# Enable authorization policies
41+
enabled: false
42+
# Trust domain for this Directory server
43+
# Used to distinguish internal (same trust domain) vs external requests
44+
trust_domain: 'example.org'
45+
46+
# Store settings for the storage backend.
47+
store:
48+
# Storage provider to use.
49+
provider: 'oci'
50+
51+
# OCI-backed store
52+
oci:
53+
# Path to a local directory that will be to hold data instead of remote.
54+
# If this is set to non-empty value, only local store will be used.
55+
# local_dir: ""
56+
57+
# Cache directory to use for metadata.
58+
# cache_dir: ""
59+
60+
# Registry address to connect to
61+
# registry_address: 'dir-zot.dir-server.svc.cluster.local:5000'
62+
# All data will be stored under this repo.
63+
# Objects are pushed as tags, manifests, and blobs.
64+
# repository_name: ""
65+
66+
# Auth credentials to use.
67+
auth_config:
68+
insecure: 'true'
69+
access_token: access-token
70+
refresh_token: refresh-token
71+
72+
# Routing settings for the peer-to-peer network.
73+
routing:
74+
# Address to use for routing
75+
# listen_address: '/ipv4/0.0.0.0/tcp/5555'
76+
77+
# Path to private key file for peer ID.
78+
# key_path: /tmp/agntcy-dir/node.privkey
79+
80+
# Nodes to use for bootstrapping of the DHT.
81+
# We read initial routing tables here and get introduced
82+
# to the network.
83+
# bootstrap_peers:
84+
# - /ip4/1.1.1.1/tcp/1
85+
# - /ip4/1.1.1.1/tcp/2
86+
87+
# GossipSub configuration for efficient label announcements
88+
# When enabled, labels are propagated via GossipSub mesh to ALL subscribed peers
89+
# When disabled, falls back to DHT+Pull mechanism (higher bandwidth, limited reach)
90+
# Default: true (recommended for production)
91+
gossipsub:
92+
enabled: true
93+
94+
refresh_interval: '1s'
95+
96+
# Sync configuration
97+
sync:
98+
# How frequently the scheduler checks for pending syncs
99+
scheduler_interval: '1s'
100+
101+
# Maximum number of sync workers running concurrently
102+
worker_count: 1
103+
104+
# Timeout for individual sync operations
105+
worker_timeout: '10m'
106+
107+
# Registry monitor configuration
108+
registry_monitor:
109+
check_interval: '30s'
110+
111+
# Authentication configuration for sync operations
112+
auth_config:
113+
username: ''
114+
password: ''
115+
116+
# Publication configuration
117+
publication:
118+
# How frequently the scheduler checks for pending publications
119+
scheduler_interval: '1s'
120+
121+
# Maximum number of publication workers running concurrently
122+
worker_count: 1
123+
124+
# Timeout for individual publication operations
125+
worker_timeout: '30m'
126+
127+
# Events configuration
128+
events:
129+
# Channel buffer size per subscriber
130+
# Larger buffers allow subscribers to fall behind temporarily without dropping events
131+
# Default: 100
132+
subscriber_buffer_size: 100
133+
134+
# Enable logging when events are dropped due to slow consumers
135+
# Default: true
136+
log_slow_consumers: true
137+
138+
# Enable debug logging of all published events (verbose in production)
139+
# Default: false
140+
log_published_events: false
141+
142+
# SPIRE configuration
143+
spire:
144+
enabled: false
145+
trustDomain: example.org
146+
federation: []
147+
# # Config: https://github.com/spiffe/spire-controller-manager/blob/main/docs/clusterfederatedtrustdomain-crd.md
148+
# - trustDomain: dir-cluster
149+
# bundleEndpointURL: https://0.0.0.0:8081
150+
# bundleEndpointProfile:
151+
# type: https_web
152+
153+
extraVolumeMounts: []
154+
155+
# Zot registry configuration (subchart)
156+
zot:
157+
extraVolumeMounts: []
158+
extraVolumes: []
159+
160+
mountSecret: false
161+
mountConfig: true
162+
configFiles:
163+
config.json: |-
164+
{
165+
"distSpecVersion": "1.1.1",
166+
"storage": {
167+
"rootDirectory": "/var/lib/registry"
168+
},
169+
"http": {
170+
"address": "0.0.0.0",
171+
"port": "5000"
172+
},
173+
"log": {
174+
"level": "info"
175+
},
176+
"extensions": {
177+
"search": {
178+
"enable": true
179+
},
180+
"trust": {
181+
"enable": true,
182+
"cosign": true,
183+
"notation": false
184+
}
185+
}
186+
}
187+
188+
# Configure zot to use the config file from the shared mounted volume
189+
extraArgs:
190+
- 'serve'
191+
- '/etc/zot/config.json'

0 commit comments

Comments
 (0)