-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into nats-s3-hybrid-publishing-backup
- Loading branch information
Showing
20 changed files
with
8,155 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,11 +2,6 @@ name: CI | |
|
||
on: | ||
pull_request: | ||
types: | ||
- opened | ||
- synchronize | ||
- edited | ||
- reopened | ||
push: | ||
branches: | ||
- main | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
cluster/charts/fuel-streams/templates/nats/accounts-secret.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{{- $secret := .Values.natsAccountsSecret }} | ||
{{- if $secret.enabled }} | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
{{- include "k8s.metadata" (dict "context" . "suffix" "-nats-accounts") | nindent 2 }} | ||
labels: | ||
{{- include "fuel-streams.labels" (dict "name" "nats-accounts" "context" .) | nindent 4 }} | ||
app.kubernetes.io/component: nats | ||
type: Opaque | ||
data: | ||
{{- if $secret.data }} | ||
{{- toYaml $secret.data | nindent 2 }} | ||
{{- end }} | ||
{{- end }} |
57 changes: 57 additions & 0 deletions
57
cluster/charts/fuel-streams/templates/nats/certificate.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
{{- $cert := .Values.natsExternalService.certificate}} | ||
{{- $service := .Values.natsExternalService.service }} | ||
{{- if and .Values.natsExternalService.enabled $service.dns }} | ||
apiVersion: cert-manager.io/v1 | ||
kind: Certificate | ||
metadata: | ||
{{- include "k8s.metadata" (dict "context" . "suffix" "-nats-cert") | nindent 2 }} | ||
annotations: | ||
{{- include "set-value" (dict "context" $cert "path" "annotations") | nindent 4 }} | ||
labels: | ||
{{- include "fuel-streams.labels" (dict "name" "nats-client" "context" .) | nindent 4 }} | ||
{{- include "set-value" (dict "context" $cert "path" "labels") | nindent 4 }} | ||
app.kubernetes.io/component: nats | ||
spec: | ||
secretName: {{ include "fuel-streams.fullname" . }}-nats-tls | ||
duration: {{ $cert.duration }} | ||
renewBefore: {{ $cert.renewBefore }} | ||
dnsNames: | ||
- {{ $service.dns }} | ||
issuerRef: | ||
name: {{ $cert.issuer }} | ||
kind: ClusterIssuer | ||
--- | ||
apiVersion: networking.k8s.io/v1 | ||
kind: Ingress | ||
metadata: | ||
{{- include "k8s.metadata" (dict "context" . "suffix" "-nats-cert-validator") | nindent 2 }} | ||
labels: | ||
{{- include "fuel-streams.labels" (dict "name" "nats-client" "context" .) | nindent 4 }} | ||
{{- include "set-value" (dict "context" $cert "path" "labels") | nindent 4 }} | ||
app.kubernetes.io/component: nats | ||
annotations: | ||
cert-manager.io/cluster-issuer: {{ $cert.issuer }} | ||
kubernetes.io/ingress.class: nginx | ||
acme.cert-manager.io/http01-ingress-class: nginx | ||
nginx.ingress.kubernetes.io/ssl-redirect: "false" | ||
nginx.ingress.kubernetes.io/force-ssl-redirect: "false" | ||
cert-manager.io/common-name: {{ $service.dns }} | ||
{{- include "set-value" (dict "context" $cert "path" "annotations") | nindent 4 }} | ||
spec: | ||
ingressClassName: nginx | ||
tls: | ||
- hosts: | ||
- {{ $service.dns }} | ||
secretName: {{ include "fuel-streams.fullname" . }}-nats-tls | ||
rules: | ||
- host: {{ $service.dns }} | ||
http: | ||
paths: | ||
- path: /.well-known/acme-challenge/ | ||
pathType: Prefix | ||
backend: | ||
service: | ||
name: cm-acme-http-solver | ||
port: | ||
number: 8089 | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
# Stage 1: Build | ||
FROM --platform=$BUILDPLATFORM tonistiigi/xx AS xx | ||
FROM --platform=$BUILDPLATFORM rust:1.81.0 AS chef | ||
|
||
# Add package name as build argument | ||
ARG PACKAGE_NAME | ||
ARG TARGETPLATFORM | ||
|
||
RUN cargo install cargo-chef && rustup target add wasm32-unknown-unknown | ||
WORKDIR /build/ | ||
|
||
COPY --from=xx / / | ||
|
||
# hadolint ignore=DL3008 | ||
RUN apt-get update && \ | ||
apt-get install -y --no-install-recommends \ | ||
lld \ | ||
clang \ | ||
libclang-dev \ | ||
&& xx-apt-get update \ | ||
&& xx-apt-get install -y libc6-dev g++ binutils \ | ||
&& apt-get clean \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
|
||
FROM chef AS planner | ||
ENV CARGO_NET_GIT_FETCH_WITH_CLI=true | ||
COPY . . | ||
RUN cargo chef prepare --recipe-path recipe.json | ||
|
||
|
||
FROM chef AS builder | ||
ARG PACKAGE_NAME | ||
ARG DEBUG_SYMBOLS=false | ||
ENV CARGO_NET_GIT_FETCH_WITH_CLI=true | ||
ENV CARGO_PROFILE_RELEASE_DEBUG=$DEBUG_SYMBOLS | ||
COPY --from=planner /build/recipe.json recipe.json | ||
RUN echo $CARGO_PROFILE_RELEASE_DEBUG | ||
# Build our project dependencies, not our application! | ||
RUN \ | ||
--mount=type=cache,target=/usr/local/cargo/registry/index \ | ||
--mount=type=cache,target=/usr/local/cargo/registry/cache \ | ||
--mount=type=cache,target=/usr/local/cargo/git/db \ | ||
--mount=type=cache,target=/build/target \ | ||
xx-cargo chef cook --release --no-default-features -p ${PACKAGE_NAME} --recipe-path recipe.json | ||
# Up to this point, if our dependency tree stays the same, | ||
# all layers should be cached. | ||
COPY . . | ||
# build application | ||
RUN \ | ||
--mount=type=cache,target=/usr/local/cargo/registry/index \ | ||
--mount=type=cache,target=/usr/local/cargo/registry/cache \ | ||
--mount=type=cache,target=/usr/local/cargo/git/db \ | ||
--mount=type=cache,target=/build/target \ | ||
xx-cargo build --release --no-default-features -p ${PACKAGE_NAME} \ | ||
&& xx-verify ./target/$(xx-cargo --print-target-triple)/release/${PACKAGE_NAME} \ | ||
&& cp ./target/$(xx-cargo --print-target-triple)/release/${PACKAGE_NAME} /root/${PACKAGE_NAME} \ | ||
&& cp ./target/$(xx-cargo --print-target-triple)/release/${PACKAGE_NAME}.d /root/${PACKAGE_NAME}.d | ||
|
||
# Stage 2: Run | ||
FROM ubuntu:22.04 AS run | ||
|
||
ARG PACKAGE_NAME | ||
ARG PORT=4000 | ||
ARG P2P_PORT=30333 | ||
ENV IP="${IP}" | ||
ENV PORT="${PORT}" | ||
|
||
WORKDIR /usr/src | ||
|
||
RUN apt-get update -y \ | ||
&& apt-get install -y --no-install-recommends ca-certificates curl \ | ||
&& apt-get autoremove -y \ | ||
&& apt-get clean -y \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
COPY --from=builder /root/${PACKAGE_NAME} . | ||
COPY --from=builder /root/${PACKAGE_NAME}.d . | ||
|
||
COPY /cluster/chain-config ./chain-config | ||
EXPOSE ${PORT} | ||
EXPOSE ${P2P_PORT} | ||
|
||
ENTRYPOINT ["./${PACKAGE_NAME}"] |
Oops, something went wrong.