Compare commits

..

3 Commits

Author SHA1 Message Date
ce7609ce66 feat: Generate crds in Dockerfile
Some checks failed
Build and deploy / build (push) Failing after 1s
2025-12-21 06:40:17 +01:00
dfa7381aa5 feat: Update workflow to use docker bake 2025-12-21 06:38:13 +01:00
72bb27aae0 chore: Update dependencies 2025-12-21 06:19:04 +01:00
9 changed files with 18 additions and 53 deletions

View File

@@ -9,7 +9,7 @@ on:
jobs:
build:
uses: infra/workflows/.gitea/workflows/docker.yaml@956337b9bd5e72a93d3a57513cd421e7554dd61d
uses: dreaded_x/workflows/.gitea/workflows/rust-kubernetes.yaml@ef78704b98c72e4a6b8340f9bff7b085a7bdd95c
secrets: inherit
with:
webhook_url: ${{ secrets.WEBHOOK_URL }}

View File

@@ -1,7 +1,7 @@
FROM rust:1.92 AS base
ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse
RUN cargo install cargo-chef --locked --version 0.1.73 && \
cargo install cargo-auditable --locked --version 0.7.2
RUN cargo install cargo-chef --locked --version 0.1.71 && \
cargo install cargo-auditable --locked --version 0.6.6
WORKDIR /app
FROM base AS planner
@@ -18,8 +18,8 @@ ENV RELEASE_VERSION=${RELEASE_VERSION}
RUN cargo auditable build --release && /app/target/release/crdgen > /crds.yaml
FROM scratch AS manifests
COPY --from=builder /crds.yaml /
COPY --from=base /crds.yaml /
FROM gcr.io/distroless/cc-debian13:nonroot AS runtime
FROM gcr.io/distroless/cc-debian12:nonroot AS runtime
COPY --from=builder /app/target/release/lldap-controller /lldap-controller
CMD ["/lldap-controller"]

View File

@@ -2,27 +2,13 @@ variable "TAG_BASE" {}
variable "RELEASE_VERSION" {}
group "default" {
targets = ["lldap-controller", "manifests"]
targets = ["lldap-controller", "generate-crds"]
}
target "docker-metadata-action" {}
target "cache" {
cache-from = [
{
type = "gha",
}
]
cache-to = [
{
type = "gha",
mode = "max"
}
]
}
target "lldap-controller" {
inherits = ["docker-metadata-action", "cache"]
inherits = ["docker-metadata-action"]
context = "./"
dockerfile = "Dockerfile"
tags = [for tag in target.docker-metadata-action.tags : "${TAG_BASE}:${tag}"]
@@ -30,7 +16,6 @@ target "lldap-controller" {
}
target "manifests" {
inherits = ["cache"]
context = "./"
dockerfile = "Dockerfile"
target = "manifests"

View File

@@ -2,11 +2,9 @@ kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: lldap-controller
namespace: lldap
subjects:
- kind: ServiceAccount
name: lldap-controller
namespace: lldap
roleRef:
kind: ClusterRole
name: lldap-controller

View File

@@ -2,7 +2,6 @@ kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: lldap-controller
namespace: lldap
rules:
- apiGroups:
- lldap.huizinga.dev

View File

@@ -2,7 +2,6 @@ apiVersion: apps/v1
kind: Deployment
metadata:
name: lldap-controller
namespace: lldap
labels:
app: lldap-controller
app.kubernetes.io/name: lldap-controller
@@ -19,17 +18,12 @@ spec:
kubectl.kubernetes.io/default-container: lldap-controller
spec:
serviceAccountName: lldap-controller
securityContext:
runAsNonRoot: true
runAsUser: 1000
runAsGroup: 1000
fsGroup: 1000
seccompProfile:
type: RuntimeDefault
securityContext: {}
containers:
- name: lldap-controller
image: '{{ index .images "lldap-controller" }}'
image: git.huizinga.dev/dreaded_x/lldap-controller@${DIGEST}
imagePullPolicy: IfNotPresent
securityContext: {}
resources:
limits:
cpu: 200m
@@ -49,16 +43,10 @@ spec:
- name: LLDAP_USERNAME
value: admin
- name: LLDAP_PASSWORD_FILE
value: /secrets/credentials/admin-pass
value: /secrets/credentials/lldap-ldap-user-pass
- name: LLDAP_BIND_DN
value: uid={username},ou=people,dc=huizinga,dc=dev
securityContext:
allowPrivilegeEscalation: false
runAsNonRoot: true
capabilities:
drop:
- ALL
volumes:
- name: credentials
secret:
secretName: credentials
secretName: lldap-credentials

View File

@@ -1,9 +1,9 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: lldap
resources:
- namespace.yaml
- crds.yaml
- service-account.yaml
- cluster-role.yaml
- cluster-role-binding.yaml
- deployment.yaml
- ./crds.yaml
- ./service-account.yaml
- ./cluster-role.yaml
- ./cluster-role-binding.yaml
- ./deployment.yaml

View File

@@ -1,4 +0,0 @@
apiVersion: v1
kind: Namespace
metadata:
name: lldap

View File

@@ -2,7 +2,6 @@ apiVersion: v1
kind: ServiceAccount
metadata:
name: lldap-controller
namespace: lldap
labels:
app: lldap-controller
app.kubernetes.io/name: lldap-controller