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

Backport into master from V0.5.8 #278

Draft
wants to merge 27 commits into
base: private/master/trilok/backport_metrics_fixes_from_0.5.7
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
580b799
Minor Fixes in Makefile (#135)
joey00072 Feb 29, 2024
be01b1c
Run go mod tidy and fix img-test in Teamcity build (#138)
cruizen Mar 6, 2024
f431329
update hostplumber:v0.5.4 (#157)
joey00072 Mar 11, 2024
7d9b433
PMK-6377 Changing the label for hostplumber (#180)
vedantjoshi84 May 10, 2024
633173d
Revert "PMK-6377 Changing the label for hostplumber (#180)" (#181)
poojaghumre May 10, 2024
764c688
PMK-6377 Changing labels for hostplumber (#188)
vedantjoshi84 May 20, 2024
ec59180
Making setupENV change (#189)
vedantjoshi84 May 20, 2024
aab84b6
Updating the hostplumber plugin version to 0.5.5 (#191)
vedantjoshi84 May 21, 2024
0685a84
[PMK-6474] : Restrict TLS cipher suites for kube-rbac-proxy container…
cruizen Jul 16, 2024
50db5df
[Backport for PMK 5.10] Added ability to customize hostplumber metric…
manasabsv26 Jul 16, 2024
134cf86
Added metricsPort to hostplumber plugin (#230)
jayanth-tjvrr Aug 14, 2024
28d7eb5
Update sampleplugins.yaml (#241)
cruizen Sep 5, 2024
d630800
revert: Update to alpine3.18 base for ovs
shweta50 Apr 21, 2024
08c9617
Create GitHub workflows to build luigi and openvswitch image
shweta50 Apr 21, 2024
0e7cd10
Build hostplumber image via github action
shweta50 Jul 11, 2024
ba9d013
update hostplumber to v0.5.7 and move ovs, hostplumber images to quay.io
shweta50 Sep 23, 2024
609c425
Bump docker/setup-buildx-action from 1 to 3 (#253)
dependabot[bot] Sep 24, 2024
790eb1e
Bump docker/login-action from 1 to 3 (#254)
dependabot[bot] Sep 24, 2024
2821ba6
Bump docker/build-push-action from 3 to 6 (#251)
dependabot[bot] Sep 24, 2024
abbdc1d
Bump docker/setup-qemu-action from 2 to 3 (#250)
dependabot[bot] Sep 24, 2024
21f0ddf
Bump actions/checkout from 3 to 4 (#252)
dependabot[bot] Sep 24, 2024
ae09991
Remove v2 for luigi and hostplumber, updates go-to-1.22 , deps, alpin…
cruizen Nov 18, 2024
341847b
Bump anchore/scan-action from 4 to 5 (#263)
dependabot[bot] Nov 18, 2024
32695aa
Revert updates to go.mod in Atherton including client-go 1.29 and con…
cruizen Nov 25, 2024
127b87f
Update golang to 1.23 (#276)
cruizen Nov 25, 2024
6612b05
Update GitHub action for Trivy and add dependabot.yml
cruizen Nov 25, 2024
dc46e52
use quay images instead of docker (#279)
deepak07dbz Dec 2, 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
28 changes: 28 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file

version: 2
updates:
- package-ecosystem: "gomod" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
- package-ecosystem: "docker"
directory: "/"
schedule:
interval: "weekly"
- package-ecosystem: "docker"
directory: "/hostplumber"
schedule:
interval: "weekly"
- package-ecosystem: "docker"
directory: "/dhcp-controller"
schedule:
interval: "weekly"

2 changes: 1 addition & 1 deletion .github/workflows/anchore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
- name: Build the Docker image
run: docker build . --file Dockerfile --tag platform9/luigi_dev:latest
- name: Run the Anchore Grype scan action
uses: anchore/scan-action@v3
uses: anchore/scan-action@v5
id: scan
with:
image: "platform9/luigi_dev:latest"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
uses: actions/setup-go@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
go-version: 1.21
go-version: 1.22
check-latest: true
cache: true
- name: Print the version of golang
Expand All @@ -37,7 +37,7 @@ jobs:
uses: actions/setup-go@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
go-version: 1.21
go-version: 1.22
check-latest: true
cache: true
- name: Print the version of golang
Expand Down
42 changes: 42 additions & 0 deletions .github/workflows/hostplumber-multiarch-build-and-push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
name: docker
on:
push:
branches:
- 'master'
- 'v*'
- 'private/**'
paths:
- hostplumber/**

jobs:
buildx:
env:
USERNAME: ${{ secrets.QUAY_USERNAME }}
PASSWORD: ${{ secrets.QUAY_PASSWORD }}
OVERRIDE_HOSTPLUMBER_VERSION: ${{ secrets.OVERRIDE_HOSTPLUMBER_VERSION || '' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup Docker BuildX
uses: docker/setup-buildx-action@v3

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

# setup Docker buld action
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to the Quay Registry
uses: docker/login-action@v3
with:
registry: quay.io
username: ${{ env.USERNAME }}
password: ${{ env.PASSWORD }}

- name: Build/Push image to Quay Container Registry
run:
TEAMCITY_BUILD_ID=${{ github.run_number }}
make -C hostplumber img-build-push
40 changes: 40 additions & 0 deletions .github/workflows/luigi-build-and-push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
name: docker
on:
push:
branches:
- 'master'
- 'v*'
- 'private/**'

jobs:
buildx:
env:
USERNAME: ${{ secrets.QUAY_USERNAME }}
PASSWORD: ${{ secrets.QUAY_PASSWORD }}
OVERRIDE_LUIGI_VERSION: ${{ secrets.OVERRIDE_LUIGI_VERSION || '' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup Docker BuildX
uses: docker/setup-buildx-action@v3

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

# setup Docker buld action
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to the Quay Registry
uses: docker/login-action@v3
with:
registry: quay.io
username: ${{ env.USERNAME }}
password: ${{ env.PASSWORD }}

- name: Build/Push image to Quay Container Registry
run:
TEAMCITY_BUILD_ID=${{ github.run_number }}
make img-build-push
53 changes: 53 additions & 0 deletions .github/workflows/ovs-build-and-push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
---
name: docker
on:
push:
branches:
- 'master'
- 'v*'
- 'private/**'
paths:
- hostplumber/**

jobs:
buildx:
env:
USERNAME: ${{ secrets.QUAY_USERNAME }}
PASSWORD: ${{ secrets.QUAY_PASSWORD }}
BUILD_ARGS: ""
PLATFORMS: linux/amd64
BRANCH: ${{ github.head_ref || github.ref_name }}
PUSH: true
runs-on: ubuntu-latest
steps:
- name: Set env
run:
echo "TAG=$(echo "${{ env.BRANCH }}" | tr -d /)" >> $GITHUB_ENV

- uses: actions/checkout@v4

- name: Setup Docker BuildX
uses: docker/setup-buildx-action@v3

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

# setup Docker buld action
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to the Quay Registry
uses: docker/login-action@v3
with:
registry: quay.io
username: ${{ env.USERNAME }}
password: ${{ env.PASSWORD }}

- name: Build/Push image to Quay Container Registry
uses: docker/build-push-action@v6
with:
context: hostplumber/pkg/ovs-docker
tags: quay.io/platform9/openvswitch:${{ env.TAG }}-${{ github.run_number }}
push: ${{ env.PUSH }}
build-args: ${{ env.BUILD_ARGS}}
platforms: ${{ env.PLATFORMS }}
7 changes: 4 additions & 3 deletions .github/workflows/trivy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,19 @@ jobs:
runs-on: "ubuntu-latest"
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Build an image from Dockerfile
run: |
docker build -t docker.io/platform9/luigi:${{ github.sha }} .

- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@7b7aa264d83dc58691451798b4d117d53d21edfe
uses: aquasecurity/trivy-action@master
with:
image-ref: 'docker.io/platform9/luigi:${{ github.sha }}'
ignore-unfixed: true
vuln-type: 'os,library'
format: 'template'
template: '@/contrib/sarif.tpl'
output: 'trivy-results.sarif'
severity: 'CRITICAL,HIGH'

Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build the manager binary
FROM golang:1.21 as builder
FROM golang:1.23 AS builder

WORKDIR /workspace
# Copy the Go Modules manifests
Expand All @@ -23,7 +23,7 @@ RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -o manager main.go
# Refer to https://github.com/GoogleContainerTools/distroless for more details
#FROM gcr.io/distroless/static:nonroot

FROM alpine:3.18
FROM alpine:3.20
RUN apk add --no-cache bash
WORKDIR /
COPY --from=builder /workspace/manager .
Expand Down
25 changes: 16 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
SHELL=/bin/bash
# Image URL to use all building/pushing image targets
#IMG ?= controller:latest
VER_LABEL=$(shell ./get-label.bash)
IMG ?= platform9/luigi-plugins:$(VER_LABEL)
ifndef OVERRIDE_LUIGI_VERSION
IMG_TAG = $(shell ./get-label.bash)
else
ifneq ($(strip $(OVERRIDE_LUIGI_VERSION)),)
IMG_TAG ?= $(OVERRIDE_LUIGI_VERSION)
else
IMG_TAG = $(shell ./get-label.bash)
endif
endif
IMG ?= quay.io/platform9/luigi-plugins:$(IMG_TAG)
# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary.
ENVTEST_K8S_VERSION = 1.23
ENVTEST_K8S_VERSION = 1.29

# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
ifeq (,$(shell go env GOBIN))
Expand Down Expand Up @@ -128,7 +136,7 @@ ENVTEST ?= $(LOCALBIN)/setup-envtest

## Tool Versions
KUSTOMIZE_VERSION ?= v3.8.7
CONTROLLER_TOOLS_VERSION ?= v0.8.0
CONTROLLER_TOOLS_VERSION ?= v0.16.3

KUSTOMIZE_INSTALL_SCRIPT ?= "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh"
.PHONY: kustomize
Expand All @@ -147,17 +155,16 @@ $(ENVTEST): $(LOCALBIN)
GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest

img-test:
docker run --rm -v $(SRCROOT):/luigi -w /luigi golang:1.21-alpine3.18 bash -c "GOFLAGS=-buildvcs=false make test"
docker run --rm -v $(SRCROOT):/luigi -w /luigi golang:1.23 bash -c "GOFLAGS=-buildvcs=false make test"

img-build: $(BUILD_DIR) img-test
img-build: $(BUILD_DIR) img-test
docker build --network host . -t ${IMG}
echo ${IMG} > $(BUILD_DIR)/container-tag

img-build-push: img-build
docker login
docker push ${IMG}
echo ${IMG} > $(BUILD_DIR)/container-tag

scan: $(BUILD_ROOT)
docker run -v $(BUILD_ROOT)/luigi:/out -v /var/run/docker.sock:/var/run/docker.sock -v $(HOME)/.trivy:/root/.cache aquasec/trivy image -s CRITICAL,HIGH -f json --vuln-type library -o /out/library_vulnerabilities.json --exit-code 22 ${IMG}
docker run -v $(BUILD_ROOT)/luigi:/out -v /var/run/docker.sock:/var/run/docker.sock -v $(HOME)/.trivy:/root/.cache aquasec/trivy image -s CRITICAL,HIGH -f json --vuln-type os -o /out/os_vulnerabilities.json --exit-code 22 ${IMG}
docker run -v $(BUILD_ROOT)/luigi:/out -v /var/run/docker.sock:/var/run/docker.sock -v $(HOME)/.trivy:/root/.cache aquasec/trivy image -s CRITICAL,HIGH -f json --scanners vuln --vuln-type library -o /out/library_vulnerabilities.json --exit-code 22 ${IMG}
docker run -v $(BUILD_ROOT)/luigi:/out -v /var/run/docker.sock:/var/run/docker.sock -v $(HOME)/.trivy:/root/.cache aquasec/trivy image -s CRITICAL,HIGH -f json --scanners vuln --vuln-type os -o /out/os_vulnerabilities.json --exit-code 22 ${IMG}
Loading