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

feat: keptn-gateway service init #3654

Merged
merged 23 commits into from
Aug 13, 2024
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
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
4 changes: 4 additions & 0 deletions .github/actions/spelling/expect.txt
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ changefreq
Chans
Checkmarx
clientgoscheme
clientset
cloudevents
clt
clusterrole
Expand Down Expand Up @@ -408,6 +409,7 @@ Meha
mergo
metricsapi
metricscontroller
metricscount
metricskeptnsh
metricsobject
metricsprovider
Expand Down Expand Up @@ -539,6 +541,8 @@ remediations
replicasets
replicationcontrollers
resourcereference
restapi
returnval
Rexed
rgb
RLock
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/CI.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ jobs:
folder: "scheduler/"
- name: "certificate-operator"
folder: "keptn-cert-manager/"
- name: "keptn-gateway"
folder: "keptn-gateway/"
steps:
- name: Check out code
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
Expand Down Expand Up @@ -138,6 +140,8 @@ jobs:
folder: "runtimes/python-runtime/"
- name: "certificate-operator"
folder: "keptn-cert-manager/"
- name: "keptn-gateway"
folder: "keptn-gateway/"
steps:
- name: Check out code
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ jobs:
folder: "scheduler/"
- name: "certificate-operator"
folder: "keptn-cert-manager/"
- name: "keptn-gateway"
folder: "keptn-gateway/"
steps:
- name: Check out code
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ env:
# renovate: datasource=github-releases depName=kubernetes-sigs/controller-tools
CONTROLLER_TOOLS_VERSION: "v0.15.0"
SCHEDULER_COMPATIBLE_K8S_VERSION: "v0.24.3"
PUBLISHABLE_ITEMS: '[".","lifecycle-operator","metrics-operator","keptn-cert-manager","runtimes/deno-runtime","runtimes/python-runtime","scheduler"]'
PUBLISHABLE_ITEMS: >
'[".","lifecycle-operator","metrics-operator","keptn-cert-manager",
asamonik marked this conversation as resolved.
Show resolved Hide resolved
"runtimes/deno-runtime","runtimes/python-runtime","scheduler", "keptn-gateway]'

jobs:
release-please:
Expand Down Expand Up @@ -101,6 +103,7 @@ jobs:
case "lifecycle-operator":
case "scheduler":
case "metrics-operator":
case "keptn-gateway":
releaseMatrix.push({
name: item,
folder: item,
Expand Down Expand Up @@ -180,6 +183,7 @@ jobs:
temp="${temp##deno-runtime-}"
temp="${temp##scheduler-}"
temp="${temp##lifecycle-operator-}"
temp="${temp##keptn-gateway-}"
echo "IMAGE_TAG=${temp##metrics-operator-}" >> "$GITHUB_OUTPUT"

- name: Build Docker Image
Expand Down
1 change: 1 addition & 0 deletions keptn-gateway/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
keptn-gateway
asamonik marked this conversation as resolved.
Show resolved Hide resolved
52 changes: 52 additions & 0 deletions keptn-gateway/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
FROM --platform=$BUILDPLATFORM golang:1.22.5-alpine3.19 AS builder

ENV CGO_ENABLED=0

WORKDIR /keptn-gateway

COPY go.mod go.sum ./
RUN go mod download

COPY ./*.go ./

ARG RELEASE_VERSION
ARG GIT_HASH
ARG BUILD_TIME
ARG TARGETOS
ARG TARGETARCH

RUN GOOS="$TARGETOS" GOARCH="$TARGETARCH" go build -ldflags "\
-X main.gitCommit=${GIT_HASH} \
-X main.buildTime=${BUILD_TIME} \
-X main.buildVersion=${RELEASE_VERSION} \
-w" \
-o bin/keptn-gateway ./main.go

FROM gcr.io/distroless/static-debian11:debug-nonroot AS debug

LABEL org.opencontainers.image.source="https://github.com/keptn/lifecycle-toolkit" \
org.opencontainers.image.url="https://keptn.sh" \
org.opencontainers.image.title="Keptn Gateway" \
org.opencontainers.image.vendor="Keptn" \
org.opencontainers.image.licenses="Apache-2.0"

COPY --from=builder /keptn-gateway/bin/keptn-gateway /bin/keptn-gateway

WORKDIR /bin

CMD ["keptn-gateway"]

FROM gcr.io/distroless/static-debian11:nonroot AS production

LABEL org.opencontainers.image.source="https://github.com/keptn/lifecycle-toolkit" \
org.opencontainers.image.url="https://keptn.sh" \
org.opencontainers.image.title="Keptn Gateway" \
org.opencontainers.image.vendor="Keptn" \
org.opencontainers.image.licenses="Apache-2.0"

COPY --from=builder /keptn-gateway/bin/keptn-gateway /bin/keptn-gateway
USER 65532:65532

WORKDIR /bin

CMD ["keptn-gateway"]
4 changes: 4 additions & 0 deletions keptn-gateway/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.PHONY: unit-test
unit-test:
go test ./... -v -coverprofile cover-keptn-gateway.out

66 changes: 66 additions & 0 deletions keptn-gateway/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
module keptn.sh/keptn-gateway

go 1.22.5

require (
github.com/keptn/lifecycle-toolkit/metrics-operator v0.0.0-20240805065043-2dbcd0b00232
github.com/stretchr/testify v1.9.0
k8s.io/client-go v0.29.7
)

require (
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/emicklei/go-restful/v3 v3.11.0 // indirect
github.com/evanphx/json-patch/v5 v5.6.0 // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/go-logr/logr v1.4.2 // indirect
github.com/go-openapi/jsonpointer v0.19.6 // indirect
github.com/go-openapi/jsonreference v0.20.2 // indirect
github.com/go-openapi/swag v0.22.3 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/google/gnostic-models v0.6.8 // indirect
github.com/google/go-cmp v0.6.0 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/imdario/mergo v0.3.13 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/client_golang v1.18.0 // indirect
github.com/prometheus/client_model v0.6.1 // indirect
github.com/prometheus/common v0.47.0 // indirect
github.com/prometheus/procfs v0.12.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 // indirect
golang.org/x/net v0.26.0 // indirect
golang.org/x/oauth2 v0.20.0 // indirect
golang.org/x/sys v0.21.0 // indirect
golang.org/x/term v0.21.0 // indirect
golang.org/x/text v0.16.0 // indirect
golang.org/x/time v0.5.0 // indirect
gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
google.golang.org/protobuf v1.34.2 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/api v0.30.3 // indirect
k8s.io/apiextensions-apiserver v0.28.12 // indirect
k8s.io/apimachinery v0.30.3 // indirect
k8s.io/component-base v0.28.12 // indirect
k8s.io/klog/v2 v2.120.1 // indirect
k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 // indirect
k8s.io/utils v0.0.0-20230726121419-3b25d923346b // indirect
sigs.k8s.io/controller-runtime v0.16.6 // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect
sigs.k8s.io/yaml v1.4.0 // indirect
)
Loading
Loading