Skip to content

Commit f29b842

Browse files
yuval-kEItanyapeterj
committed
feat: allow running with vanilla k8s (#3)
* enable websockets (#4) Signed-off-by: Peter Jausovec <peter.jausovec@solo.io> Co-authored-by: Peter Jausovec <peter.jausovec@solo.io> * feat: allow running with vanilla k8s - add a helm chart - allow JWT auth instead of mTLS * update helm chart images * fix rbac. note that JWT verification is not cached and might not work on some k8s distributions that not expose the JWKS * fix: add chart boilerplate headers * fix: support jwt helm install on plain kind * feat: add substrate crds helm chart * feat: make jwt helm installs standalone * fix: make helm defaults cloud-neutral * fix: sync crd chart templates * fix: use agentgateway in helm chart * fix: update agentgateway install overlays * fix: project agentgateway tls key separately --------- Signed-off-by: Peter Jausovec <peter.jausovec@solo.io> Co-authored-by: Eitan Yarmush <eitan.yarmush@solo.io> Co-authored-by: Peter Jausovec <peter.jausovec@solo.io>
1 parent d6860b0 commit f29b842

67 files changed

Lines changed: 4310 additions & 608 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/release.yaml

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,9 @@ jobs:
6767
- name: Install ko
6868
uses: ko-build/setup-ko@v0.7
6969

70+
- name: Install Helm
71+
uses: azure/setup-helm@v4
72+
7073
- name: Log in to GHCR
7174
uses: docker/login-action@v3
7275
with:
@@ -85,7 +88,7 @@ jobs:
8588
run: |
8689
set -o errexit -o nounset -o pipefail
8790
88-
for component in ateapi atelet ateom-gvisor podcertcontroller atenet; do
91+
for component in ateapi atecontroller atelet ateom-gvisor podcertcontroller atenet; do
8992
KO_DOCKER_REPO="${IMAGE_REPOSITORY}/${component}" \
9093
./hack/run-tool.sh ko build \
9194
--tags "${IMAGE_TAGS}" \
@@ -94,6 +97,36 @@ jobs:
9497
"./cmd/${component}"
9598
done
9699
100+
- name: Package and push Helm charts
101+
if: inputs.create_release
102+
env:
103+
HELM_EXPERIMENTAL_OCI: "1"
104+
CHART_REPOSITORY: oci://ghcr.io/kagent-dev/substrate/helm
105+
run: |
106+
set -o errexit -o nounset -o pipefail
107+
108+
tag="${{ steps.tag.outputs.value }}"
109+
chart_version="${tag#v}"
110+
package_dir="${RUNNER_TEMP}/helm-packages"
111+
mkdir -p "${package_dir}"
112+
113+
echo "${{ secrets.GITHUB_TOKEN }}" \
114+
| helm registry login ghcr.io \
115+
--username "${{ github.actor }}" \
116+
--password-stdin
117+
118+
helm package charts/substrate-crds \
119+
--destination "${package_dir}" \
120+
--version "${chart_version}" \
121+
--app-version "${tag}"
122+
helm package charts/substrate \
123+
--destination "${package_dir}" \
124+
--version "${chart_version}" \
125+
--app-version "${tag}"
126+
127+
helm push "${package_dir}/substrate-crds-${chart_version}.tgz" "${CHART_REPOSITORY}"
128+
helm push "${package_dir}/substrate-${chart_version}.tgz" "${CHART_REPOSITORY}"
129+
97130
- name: Create GitHub Release
98131
if: inputs.create_release
99132
uses: softprops/action-gh-release@v2

Makefile

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,11 @@ build: build-images build-atectl
4444

4545
.PHONY: build-images
4646
build-images:
47-
$(KO) build --ldflags "$(LDFLAGS)" ./cmd/ateapi
48-
$(KO) build --ldflags "$(LDFLAGS)" ./cmd/atelet
49-
$(KO) build --ldflags "$(LDFLAGS)" ./cmd/podcertcontroller
50-
$(KO) build --ldflags "$(LDFLAGS)" ./cmd/atenet
47+
$(KO) build --base-import-paths --ldflags "$(LDFLAGS)" ./cmd/ateapi
48+
$(KO) build --base-import-paths --ldflags "$(LDFLAGS)" ./cmd/atecontroller
49+
$(KO) build --base-import-paths --ldflags "$(LDFLAGS)" ./cmd/atelet
50+
$(KO) build --base-import-paths --ldflags "$(LDFLAGS)" ./cmd/podcertcontroller
51+
$(KO) build --base-import-paths --ldflags "$(LDFLAGS)" ./cmd/atenet
5152

5253
.PHONY: build-atectl
5354
build-atectl:
@@ -92,3 +93,19 @@ verify: test
9293
.PHONY: clean
9394
clean:
9495
rm -rf $(BINDIR)
96+
97+
# Render the substrate Helm chart into manifests/ate-install/ (mTLS mode,
98+
# the historical default install). Run this whenever charts/substrate/ changes.
99+
.PHONY: helm-template
100+
helm-template:
101+
@./hack/render-manifests.sh
102+
103+
# Verify that manifests/ate-install/ matches the chart output. Used in CI.
104+
.PHONY: verify-helm-template
105+
verify-helm-template:
106+
@./hack/render-manifests.sh --check
107+
108+
# Verify that the CRD chart mirrors the generated CRDs.
109+
.PHONY: verify-crd-chart
110+
verify-crd-chart:
111+
@./hack/verify/crd-chart.sh

README.md

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,10 @@ To quickly set up the complete environment:
103103
2. Run the following steps:
104104
```shell
105105
# create cluster and local registry
106-
hack/create-kind-cluster.sh
106+
KIND_ENABLE_PODCERT=false hack/create-kind-cluster.sh
107107

108-
# install ate, valkey, rustfs
109-
hack/install-ate-kind.sh --deploy-ate-system
108+
# install ate, valkey, rustfs using Helm in JWT mode
109+
hack/install-ate-kind-jwt.sh
110110

111111
# install counter demo
112112
hack/install-ate-kind.sh --deploy-demo-counter
@@ -126,6 +126,21 @@ kubectl port-forward -n ate-system svc/atenet-router 8000:80
126126
curl -X POST -H "Host: my-counter-1.actors.resources.substrate.ate.dev" -i http://localhost:8000/
127127
```
128128

129+
#### mTLS mode
130+
131+
JWT mode is the default install path and does not require pod certificate
132+
feature gates. To test the older mTLS path, create kind with the
133+
`ClusterTrustBundle` / `PodCertificateRequest` feature gates enabled and use the
134+
mTLS install helper.
135+
136+
```shell
137+
# create cluster WITH podcert feature gates
138+
hack/create-kind-cluster.sh
139+
140+
# install ate using the mTLS manifests path
141+
hack/install-ate-kind.sh --deploy-ate-system
142+
```
143+
129144
### GKE Quickstart (Development)
130145

131146
1. Create and configure your environment file:

manifests/ate-install/ate-system-namespace.yaml renamed to charts/substrate-crds/Chart.yaml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,17 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
apiVersion: v1
16-
kind: Namespace
17-
metadata:
18-
name: ate-system
15+
apiVersion: v2
16+
name: substrate-crds
17+
description: Agent Substrate CustomResourceDefinitions.
18+
type: application
19+
version: 0.1.0
20+
appVersion: "0.1.0"
21+
home: https://github.com/agent-substrate/substrate
22+
sources:
23+
- https://github.com/agent-substrate/substrate
24+
keywords:
25+
- agent
26+
- actor
27+
- substrate
28+
- crds

charts/substrate-crds/README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# substrate-crds
2+
3+
Helm chart for installing the Agent Substrate CRDs.
4+
5+
Install this chart before installing the main `substrate` chart:
6+
7+
```bash
8+
helm upgrade --install substrate-crds ./charts/substrate-crds
9+
helm upgrade --install substrate ./charts/substrate --namespace ate-system --create-namespace
10+
```
11+
12+
The CRD YAMLs in `templates/` mirror `manifests/ate-install/generated/`.
13+
Run `hack/verify/crd-chart.sh` to verify they are in sync.

0 commit comments

Comments
 (0)