Skip to content

Commit

Permalink
Merge branch 'main' into jmassa/run_e2e
Browse files Browse the repository at this point in the history
  • Loading branch information
jimassa authored Mar 27, 2024
2 parents 1db7af7 + cb197d8 commit 7341e20
Show file tree
Hide file tree
Showing 10 changed files with 34 additions and 16 deletions.
7 changes: 3 additions & 4 deletions controller/Dockerfile.controller
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,10 @@ ARG VERSION
# Set this if you want to enable Application Insights telemetry.
ARG APP_INSIGHTS_ID

RUN go build -v -o /go/bin/retina/controller -ldflags "-X main.version="$VERSION" -X "main.applicationInsightsID"="$APP_INSIGHTS_ID"" controller/main.go
RUN go build -v -o /go/bin/retina/captureworkload -ldflags "-X main.version="$VERSION" -X "main.applicationInsightsID"="$APP_INSIGHTS_ID"" captureworkload/main.go
RUN --mount=type=cache,target="/root/.cache/go-build" go build -v -o /go/bin/retina/controller -ldflags "-X main.version="$VERSION" -X "main.applicationInsightsID"="$APP_INSIGHTS_ID"" controller/main.go
RUN --mount=type=cache,target="/root/.cache/go-build" go build -v -o /go/bin/retina/captureworkload -ldflags "-X main.version="$VERSION" -X "main.applicationInsightsID"="$APP_INSIGHTS_ID"" captureworkload/main.go
# We only build initretina for linux.
RUN go build -v -o /go/bin/retina/initretina -ldflags "-X main.version="$VERSION" -X "main.applicationInsightsID"="$APP_INSIGHTS_ID"" ././init/retina/main_linux.go

RUN --mount=type=cache,target="/root/.cache/go-build" go build -v -o /go/bin/retina/initretina -ldflags "-X main.version="$VERSION" -X "main.applicationInsightsID"="$APP_INSIGHTS_ID"" ././init/retina/main_linux.go

# ----------------------------------------------------------------------------------- #

Expand Down
4 changes: 2 additions & 2 deletions controller/Dockerfile.windows-2019
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ WORKDIR /usr/src/retina
# Copy the source
COPY . .

RUN go build -v -o /usr/bin/controller.exe -ldflags "-X main.version="$VERSION" -X "main.applicationInsightsID"="$APP_INSIGHTS_ID"" ./controller/
RUN go build -v -o /usr/bin/captureworkload.exe ./captureworkload/
RUN --mount=type=cache,target="/root/.cache/go-build" go build -v -o /usr/bin/controller.exe -ldflags "-X main.version="$VERSION" -X "main.applicationInsightsID"="$APP_INSIGHTS_ID"" ./controller/
RUN --mount=type=cache,target="/root/.cache/go-build" go build -v -o /usr/bin/captureworkload.exe ./captureworkload/

# Copy into final image
FROM mcr.microsoft.com/windows/servercore:ltsc2019
Expand Down
4 changes: 2 additions & 2 deletions controller/Dockerfile.windows-2022
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ WORKDIR /usr/src/retina
# Copy the source
COPY . .

RUN go build -v -o /usr/bin/controller.exe -ldflags "-X main.version="$VERSION" -X "main.applicationInsightsID"="$APP_INSIGHTS_ID"" ./controller/
RUN go build -v -o /usr/bin/captureworkload.exe ./captureworkload/
RUN --mount=type=cache,target="/root/.cache/go-build" go build -v -o /usr/bin/controller.exe -ldflags "-X main.version="$VERSION" -X "main.applicationInsightsID"="$APP_INSIGHTS_ID"" ./controller/
RUN --mount=type=cache,target="/root/.cache/go-build" go build -v -o /usr/bin/captureworkload.exe ./captureworkload/

# Copy into final image
FROM mcr.microsoft.com/windows/servercore:ltsc2022
Expand Down
14 changes: 12 additions & 2 deletions deploy/manifests/controller/helm/retina/templates/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ spec:
spec:
hostNetwork: true
serviceAccountName: {{ .Values.serviceAccount.name }}
nodeSelector:
kubernetes.io/os: linux
initContainers:
- name: init-retina
image: {{ .Values.image.initRepository }}:{{ .Values.image.tag }}
Expand Down Expand Up @@ -111,6 +109,12 @@ spec:
{{- end }}
nodeSelector:
kubernetes.io/os: linux
{{- if .Values.nodeSelector }}
{{- toYaml .Values.nodeSelector | nindent 8 }}
{{- end }}
{{- if .Values.tolerations }}
tolerations: {{- toYaml .Values.tolerations | nindent 8 }}
{{- end }}
{{- end }}
---
{{- if .Values.os.windows}}
Expand Down Expand Up @@ -185,6 +189,12 @@ spec:
{{- end }}
nodeSelector:
kubernetes.io/os: windows
{{- if .Values.nodeSelector }}
{{- toYaml .Values.nodeSelector | nindent 8 }}
{{- end }}
{{- if .Values.tolerations }}
tolerations: {{- toYaml .Values.tolerations | nindent 8 }}
{{- end }}
volumes:
{{- range $name, $mountPath := .Values.volumeMounts_win }}
- name: {{ $name }}
Expand Down
9 changes: 9 additions & 0 deletions deploy/manifests/controller/helm/retina/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -113,3 +113,12 @@ resources:
limits:
memory: "300Mi"
cpu: "500m"

## @param nodeSelector [object] Node labels for pod assignment
## Ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/
##
nodeSelector: {}
## @param tolerations [array] Tolerations for pod assignment
## Ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/
##
tolerations: []
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ require (
github.com/Microsoft/hcsshim v0.12.0-rc.3
github.com/cakturk/go-netstat v0.0.0-20200220111822-e5b49efee7a5
github.com/cilium/cilium v1.15.3
github.com/cilium/ebpf v0.13.2
github.com/cilium/ebpf v0.14.0
github.com/florianl/go-tc v0.4.3
github.com/golang/mock v1.6.0
github.com/inspektor-gadget/inspektor-gadget v0.25.1-0.20240223044605-4ac24c3e3b7f
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,8 @@ github.com/cilium/cilium v1.15.3/go.mod h1:ojlr/BoauoO2o2884BGO2ukxK953ieha3eSOh
github.com/cilium/ebpf v0.5.0/go.mod h1:4tRaxcgiL706VnOzHOdBlY8IEAIdxINsQBcU4xJJXRs=
github.com/cilium/ebpf v0.7.0/go.mod h1:/oI2+1shJiTGAMgl6/RgJr36Eo1jzrRcAWbcXO2usCA=
github.com/cilium/ebpf v0.8.1/go.mod h1:f5zLIM0FSNuAkSyLAN7X+Hy6yznlF1mNiWUMfxMtrgk=
github.com/cilium/ebpf v0.13.2 h1:uhLimLX+jF9BTPPvoCUYh/mBeoONkjgaJ9w9fn0mRj4=
github.com/cilium/ebpf v0.13.2/go.mod h1:DHp1WyrLeiBh19Cf/tfiSMhqheEiK8fXFZ4No0P1Hso=
github.com/cilium/ebpf v0.14.0 h1:0PsxAjO6EjI1rcT+rkp6WcCnE0ZvfkXBYiMedJtrSUs=
github.com/cilium/ebpf v0.14.0/go.mod h1:DHp1WyrLeiBh19Cf/tfiSMhqheEiK8fXFZ4No0P1Hso=
github.com/cilium/proxy v0.0.0-20231031145409-f19708f3d018 h1:R/QlThqx099hS6req1k2Q87fvLSRgCEicQGate9vxO4=
github.com/cilium/proxy v0.0.0-20231031145409-f19708f3d018/go.mod h1:p044XccCmONGIUbx3bJ7qvHXK0RcrdvIvbTGiu/RjUA=
github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6Dob7S7YxXgwXpfOuvO54S+tGdZdw9fuRZt25Ag=
Expand Down
2 changes: 1 addition & 1 deletion operator/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ WORKDIR /workspace
COPY . .

RUN make manifests
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags "-X main.version="$VERSION" -X "main.applicationInsightsID"="$APP_INSIGHTS_ID"" -a -o retina-operator operator/main.go
RUN --mount=type=cache,target="/root/.cache/go-build" CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags "-X main.version="$VERSION" -X "main.applicationInsightsID"="$APP_INSIGHTS_ID"" -a -o retina-operator operator/main.go

FROM scratch
WORKDIR /
Expand Down
2 changes: 1 addition & 1 deletion operator/Dockerfile.windows-2019
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ WORKDIR /usr/src/retina
# Copy the source
COPY . .

RUN go build -v -ldflags "-X main.version="$VERSION" -X "main.applicationInsightsID"="$APP_INSIGHTS_ID"" -o -o /usr/bin/retina-operator.exe retina-operator operator/main.go
RUN --mount=type=cache,target="/root/.cache/go-build" go build -v -ldflags "-X main.version="$VERSION" -X "main.applicationInsightsID"="$APP_INSIGHTS_ID"" -o -o /usr/bin/retina-operator.exe retina-operator operator/main.go

# Copy into final image
FROM mcr.microsoft.com/windows/nanoserver:ltsc2019
Expand Down
2 changes: 1 addition & 1 deletion operator/Dockerfile.windows-2022
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ WORKDIR /usr/src/retina
# Copy the source
COPY . .

RUN go build -v -ldflags "-X main.version="$VERSION" -X "main.applicationInsightsID"="$APP_INSIGHTS_ID"" -o -o /usr/bin/retina-operator.exe retina-operator operator/main.go
RUN --mount=type=cache,target="/root/.cache/go-build" go build -v -ldflags "-X main.version="$VERSION" -X "main.applicationInsightsID"="$APP_INSIGHTS_ID"" -o -o /usr/bin/retina-operator.exe retina-operator operator/main.go

# Copy into final image
FROM mcr.microsoft.com/windows/nanoserver:ltsc2022
Expand Down

0 comments on commit 7341e20

Please sign in to comment.