Skip to content

Commit

Permalink
Add dd config
Browse files Browse the repository at this point in the history
  • Loading branch information
amardomingo authored and rifelpet committed Oct 4, 2024
1 parent bff1145 commit 020c066
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 14 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/sync.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Sync upstream
# This runs every day on 1000 UTC
on:
schedule:
- cron: '0 10 * * *'
# Allows manual workflow run
workflow_dispatch:

# Don't seem to be able to restrict this down since
# it needs to be able to push workflows, but that
# permission is not available here.
permissions: write-all

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Sync with upstream
uses: DataDog/sync-upstream-release-tag@main
with:
github_actor: "${GITHUB_ACTOR}"
github_repository: "${GITHUB_REPOSITORY}"
github_token: ${{ secrets.WORKFLOW_TOKEN }}
date_suffix: "%Y%V"
upstream_repo: kubernetes/cloud-provider-aws
22 changes: 22 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
include: https://gitlab-templates.ddbuild.io/compute-delivery/v2/compute-delivery.yml

variables:
KPR_CHART_NAME: k8s-platform-k8s-cloud-controller-manager
test:
stage: verify
tags: [ "arch:amd64" ]
image: registry.ddbuild.io/images/mirror/golang:1.21.1
script:
- make test

build-docker-image:
variables:
IMAGE_NAME: aws-cloud-controller-manager
extends: .build-docker-image

# run-campaign:
# variables:
# CHART_NAME: k8s-platform-k8s-cloud-controller-manager
# COMPONENT: aws-cloud-controller-manager
# SLACK_CHANNEL: compute-ops
# extends: .run-campaign
23 changes: 9 additions & 14 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,15 @@
# This build arg allows the specification of a custom Golang image.
ARG GOLANG_IMAGE=golang:1.22.5

# The distroless image on which the CPI manager image is built.
#
# Please do not use "latest". Explicit tags should be used to provide
# deterministic builds. Follow what kubernetes uses to build
# kube-controller-manager, for example for 1.23.x:
# https://github.com/kubernetes/kubernetes/blob/release-1.24/build/common.sh#L94
ARG DISTROLESS_IMAGE=registry.k8s.io/build-image/go-runner:v2.3.1-go1.22.5-bookworm.0
# Datadog's base docker image
ARG BASE_IMAGE

################################################################################
## BUILD STAGE ##
################################################################################
# Build the manager as a statically compiled binary so it has no dependencies
# libc, muscl, etc.
FROM --platform=linux/amd64 ${GOLANG_IMAGE} as builder
FROM ${GOLANG_IMAGE} as builder

ARG GOPROXY=https://goproxy.io,direct
ARG TARGETOS
Expand All @@ -41,16 +36,16 @@ COPY go.mod go.sum ./
COPY cmd/ cmd/
COPY pkg/ pkg/
RUN GO111MODULE=on CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} GOPROXY=${GOPROXY} \
go build \
-trimpath \
-ldflags="-w -s -X k8s.io/component-base/version.gitVersion=${VERSION}" \
-o=aws-cloud-controller-manager \
cmd/aws-cloud-controller-manager/main.go
go build \
-trimpath \
-ldflags="-w -s -X k8s.io/component-base/version.gitVersion=${VERSION}" \
-o=aws-cloud-controller-manager \
cmd/aws-cloud-controller-manager/main.go

################################################################################
## MAIN STAGE ##
################################################################################
# Copy the manager into the distroless image.
FROM --platform=${TARGETPLATFORM} ${DISTROLESS_IMAGE}
FROM --platform=${TARGETPLATFORM} ${BASE_IMAGE}
COPY --from=builder /build/aws-cloud-controller-manager /bin/aws-cloud-controller-manager
ENTRYPOINT [ "/bin/aws-cloud-controller-manager" ]

0 comments on commit 020c066

Please sign in to comment.