Skip to content

Commit 472d0f4

Browse files
authored
Merge branch 'main' into main
2 parents 60b5887 + 13261f3 commit 472d0f4

File tree

14 files changed

+451
-66
lines changed

14 files changed

+451
-66
lines changed
File renamed without changes.

.github/workflows/integration.yaml

+183
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,183 @@
1+
name: Build images and run E2E tests.
2+
3+
on:
4+
merge_group:
5+
workflow_dispatch:
6+
7+
permissions:
8+
contents: read
9+
10+
jobs:
11+
retina-images:
12+
name: Build Agent Images
13+
runs-on: ubuntu-latest
14+
15+
strategy:
16+
matrix:
17+
platform: ["linux"]
18+
arch: ["amd64", "arm64"]
19+
20+
steps:
21+
- name: Checkout code
22+
uses: actions/checkout@v4
23+
24+
- uses: actions/setup-go@v4
25+
with:
26+
go-version: ">=1.21.0"
27+
- run: go version
28+
29+
- name: Set up QEMU
30+
uses: docker/setup-qemu-action@v3
31+
32+
- name: Az CLI login
33+
uses: azure/login@v1
34+
with:
35+
creds: ${{ secrets.AZURE_CREDENTIALS }}
36+
37+
- name: Build Images
38+
shell: bash
39+
run: |
40+
set -euo pipefail
41+
az acr login -n acnpublic
42+
echo "TAG=$(make version)" >> $GITHUB_ENV
43+
make retina-image \
44+
IMAGE_NAMESPACE=${{ github.repository }} \
45+
PLATFORM=${{ matrix.platform }}/${{ matrix.arch }} \
46+
IMAGE_REGISTRY=acnpublic.azurecr.io \
47+
BUILDX_ACTION=--push
48+
49+
retina-win-images:
50+
name: Build Agent Windows Images
51+
runs-on: ubuntu-latest
52+
53+
strategy:
54+
matrix:
55+
platform: ["windows"]
56+
arch: ["amd64"]
57+
58+
steps:
59+
- name: Checkout code
60+
uses: actions/checkout@v4
61+
62+
- uses: actions/setup-go@v4
63+
with:
64+
go-version: ">=1.21.0"
65+
- run: go version
66+
67+
- name: Set up QEMU
68+
uses: docker/setup-qemu-action@v3
69+
70+
- name: Az CLI login
71+
uses: azure/login@v1
72+
with:
73+
creds: ${{ secrets.AZURE_CREDENTIALS }}
74+
75+
- name: Build Images
76+
shell: bash
77+
run: |
78+
set -euo pipefail
79+
az acr login -n acnpublic
80+
echo "TAG=$(make version)" >> $GITHUB_ENV
81+
make retina-image-win \
82+
IMAGE_NAMESPACE=${{ github.repository }} \
83+
PLATFORM=${{ matrix.platform }}/${{ matrix.arch }} \
84+
IMAGE_REGISTRY=acnpublic.azurecr.io \
85+
BUILDX_ACTION=--push
86+
87+
operator-images:
88+
name: Build Operator Images
89+
runs-on: ubuntu-latest
90+
91+
strategy:
92+
matrix:
93+
platform: ["linux"]
94+
arch: ["amd64"]
95+
96+
steps:
97+
- name: Checkout code
98+
uses: actions/checkout@v4
99+
100+
- uses: actions/setup-go@v4
101+
with:
102+
go-version: ">=1.21.0"
103+
- run: go version
104+
105+
- name: Set up QEMU
106+
uses: docker/setup-qemu-action@v3
107+
108+
- name: Az CLI login
109+
uses: azure/login@v1
110+
with:
111+
creds: ${{ secrets.AZURE_CREDENTIALS }}
112+
113+
- name: Build Images
114+
shell: bash
115+
run: |
116+
set -euo pipefail
117+
az acr login -n acnpublic
118+
echo "TAG=$(make version)" >> $GITHUB_ENV
119+
make retina-operator-image \
120+
IMAGE_NAMESPACE=${{ github.repository }} \
121+
PLATFORM=${{ matrix.platform }}/${{ matrix.arch }} \
122+
IMAGE_REGISTRY=acnpublic.azurecr.io \
123+
BUILDX_ACTION=--push
124+
125+
manifests:
126+
name: Generate Manifests
127+
runs-on: ubuntu-latest
128+
needs: [retina-images, retina-win-images, operator-images]
129+
130+
strategy:
131+
matrix:
132+
components: ["retina", "operator"]
133+
134+
steps:
135+
- name: Checkout code
136+
uses: actions/checkout@v4
137+
138+
- name: Setup QEMU
139+
uses: docker/setup-qemu-action@v3
140+
141+
- name: Azure CLI login
142+
uses: azure/login@v1
143+
with:
144+
creds: ${{ secrets.AZURE_CREDENTIALS }}
145+
146+
- name: Generate Manifests
147+
shell: bash
148+
run: |
149+
set -euo pipefail
150+
az acr login -n acnpublic
151+
make manifest COMPONENT=${{ matrix.components }} \
152+
IMAGE_REGISTRY=acnpublic.azurecr.io \
153+
154+
e2e:
155+
name: Run E2E Tests
156+
runs-on: ubuntu-latest
157+
needs: [manifests]
158+
159+
permissions:
160+
id-token: write
161+
contents: read
162+
163+
steps:
164+
- name: Checkout code
165+
uses: actions/checkout@v4
166+
167+
- name: Setup go
168+
uses: actions/setup-go@v4
169+
with:
170+
go-version: ">=1.21.0"
171+
- run: go version
172+
173+
- name: Az CLI login
174+
uses: azure/login@v1
175+
with:
176+
creds: ${{ secrets.AZURE_CREDENTIALS }}
177+
178+
- name: Run E2E Tests
179+
shell: bash
180+
run: |
181+
set -euo pipefail
182+
export AZURE_SUBSCRIPTION_ID=${{ secrets.AZURE_SUBSCRIPTION }}
183+
go test -v ./test/e2e/scenarios/retina/*.go -timeout 30m -tags=e2e -count=1 -args -image-tag=$(make version) -image-registry=acnpublic.azurecr.io -image-namespace=${{ github.repository}}

.github/workflows/release-charts.yaml

+4-1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ jobs:
1717
steps:
1818
- name: Checkout code
1919
uses: actions/checkout@v4
20+
with:
21+
fetch-depth: 0
2022

2123
- uses: azure/[email protected]
2224
id: install
@@ -29,5 +31,6 @@ jobs:
2931
run: |
3032
set -euo pipefail
3133
export TAG=$(make version)
34+
echo $TAG
3235
helm package ./deploy/manifests/controller/helm/retina --version $TAG
33-
helm push retina-*.tgz oci://ghcr.io/${{ github.repository }}/charts
36+
helm push retina-$TAG.tgz oci://ghcr.io/${{ github.repository }}/charts

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ coverage: # Code coverage.
343343
manifests:
344344
cd crd && make manifests && make generate
345345

346-
HELM_IMAGE_TAG ?= v0.0.1
346+
HELM_IMAGE_TAG ?= v0.0.2
347347

348348
# basic/node-level mode
349349
helm-install: manifests

README.md

+31-18
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,20 @@ Retina has two major features:
3737

3838
### Metrics Quick Install Guide
3939

40-
Prerequisites: Go, Helm
41-
42-
1. Clone the repo, then install Retina on your Kubernetes cluster
40+
Retina can be installed using the Helm chart from GHCR:
41+
42+
```bash
43+
helm upgrade --install retina oci://ghcr.io/microsoft/retina/charts/retina \
44+
--version v0.0.2 \
45+
--set image.tag=v0.0.2 \
46+
--set operator.tag=v0.0.2 \
47+
--set logLevel=info \
48+
--set enabledPlugin_linux="\[dropreason\,packetforward\,linuxutil\,dns\]"
49+
```
4350

44-
```bash
45-
make helm-install
46-
```
51+
Set the `version` and image `tag` arguments to the desired version, if different.
4752

48-
2. Follow steps in [Using Prometheus and Grafana](https://retina.sh/docs/installation/prometheus-unmanaged) to set up metrics collection and visualization.
53+
After Helm install, follow steps in [Using Prometheus and Grafana](https://retina.sh/docs/installation/prometheus-unmanaged) to set up metrics collection and visualization.
4954

5055
### Captures Quick Start Guide
5156

@@ -82,15 +87,23 @@ For further CLI documentation, see [Capture with Retina CLI](https://retina.sh/d
8287

8388
#### Captures via CRD
8489

85-
Prerequisites: Go, Helm
86-
87-
1. Clone the repo, then install Retina with Capture operator support on your Kubernetes cluster
88-
89-
```bash
90-
make helm-install-with-operator
91-
```
90+
Install Retina using Helm:
91+
92+
```bash
93+
helm upgrade --install retina oci://ghcr.io/microsoft/retina/charts/retina \
94+
--version v0.0.2 \
95+
--set image.tag=v0.0.2 \
96+
--set operator.tag=v0.0.2 \
97+
--set image.pullPolicy=Always \
98+
--set logLevel=info \
99+
--set os.windows=true \
100+
--set operator.enabled=true \
101+
--set operator.enableRetinaEndpoint=true \
102+
--skip-crds \
103+
--set enabledPlugin_linux="\[dropreason\,packetforward\,linuxutil\,dns\,packetparser\]"
104+
```
92105

93-
2. Follow steps in [Capture CRD](https://retina.sh/docs/captures/#option-2-capture-crd-custom-resource-definition) for documentation of the CRD and examples for setting up Captures.
106+
Then follow steps in [Capture CRD](https://retina.sh/docs/captures/#option-2-capture-crd-custom-resource-definition) for documentation of the CRD and examples for setting up Captures.
94107

95108
## Contributing
96109

@@ -129,9 +142,9 @@ This project has adopted the [Microsoft Open Source Code of Conduct](https://ope
129142

130143
## Contact
131144

132-
For bugs or feature requests, open an [issue](https://github.com/microsoft/retina/issues).
133-
For security or vulnerability concerns, see [SECURITY.md](SECURITY.md).
134-
For other communication, contact the maintainers at <[email protected]>
145+
For bugs or feature requests, open an [issue](https://github.com/microsoft/retina/issues).
146+
For security or vulnerability concerns, see [SECURITY.md](SECURITY.md).
147+
For other communication, contact the maintainers at <[email protected]>.
135148

136149
[goreport-img]: https://goreportcard.com/badge/github.com/microsoft/retina
137150
[goreport]: https://goreportcard.com/report/github.com/microsoft/retina

deploy/manifests/controller/helm/retina/templates/daemonset.yaml

+4-2
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ spec:
5858
{{- end}}
5959
{{- end}}
6060
ports:
61-
- containerPort: {{ .Values.retinaPort }}
61+
- name: retina
62+
containerPort: {{ .Values.retinaPort }}
6263
resources:
6364
limits:
6465
memory: {{ .Values.resources.limits.memory | quote }}
@@ -152,7 +153,8 @@ spec:
152153
- name: retinawin
153154
image: {{ .Values.image.repository }}:{{ .Values.image.tag }}
154155
ports:
155-
- containerPort: {{ .Values.retinaPort }}
156+
- name: retina
157+
containerPort: {{ .Values.retinaPort }}
156158
command:
157159
- powershell.exe
158160
- -command
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{{- if .Values.metrics.podMonitor.enabled }}
2+
apiVersion: monitoring.coreos.com/v1
3+
kind: PodMonitor
4+
metadata:
5+
name: {{ include "retina.fullname" . }}
6+
namespace: {{ ternary .Values.metrics.podMonitor.namespace .Values.namespace (not (empty .Values.metrics.podMonitor.namespace)) }}
7+
labels:
8+
k8s-app: {{ include "retina.name" . }}
9+
{{- if .Values.metrics.podMonitor.additionalLabels }}
10+
{{- .Values.metrics.podMonitor.additionalLabels | nindent 4 }}
11+
{{- end }}
12+
spec:
13+
podMetricsEndpoints:
14+
- port: retina
15+
path: /metrics
16+
{{- if .Values.metrics.podMonitor.interval }}
17+
interval: {{ .Values.metrics.podMonitor.interval }}
18+
{{- end }}
19+
{{- if .Values.metrics.podMonitor.scrapeTimeout }}
20+
scrapeTimeout: {{ .Values.metrics.podMonitor.scrapeTimeout }}
21+
{{- end }}
22+
{{- if .Values.metrics.podMonitor.scheme }}
23+
scheme: {{ .Values.metrics.podMonitor.scheme }}
24+
{{- end }}
25+
{{- if .Values.metrics.podMonitor.tlsConfig }}
26+
tlsConfig: {{- .Values.metrics.podMonitor.tlsConfig | nindent 8 }}
27+
{{- end }}
28+
{{- if .Values.metrics.podMonitor.relabelings }}
29+
relabelings:
30+
{{- .Values.metrics.podMonitor.relabelings | nindent 8 }}
31+
{{- end }}
32+
namespaceSelector:
33+
matchNames:
34+
- {{ .Values.namespace }}
35+
selector:
36+
matchLabels:
37+
app: {{ include "retina.name" . }}
38+
{{- end }}

0 commit comments

Comments
 (0)