mirror of
https://github.com/external-secrets/external-secrets.git
synced 2024-12-14 11:57:59 +00:00
✨Add standalone Dockerfile (#1328)
This commit is contained in:
parent
acdd9d7c67
commit
3658afd0a2
3 changed files with 68 additions and 9 deletions
24
.dockerignore
Normal file
24
.dockerignore
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
.git
|
||||||
|
.github
|
||||||
|
.gitignore
|
||||||
|
.golangci.yaml
|
||||||
|
ADOPTERS.md
|
||||||
|
CNAME
|
||||||
|
Dockerfile
|
||||||
|
Dockerfile.standalone
|
||||||
|
LICENSE
|
||||||
|
Makefile
|
||||||
|
PROJECT
|
||||||
|
README.md
|
||||||
|
SECURITY.md
|
||||||
|
assets
|
||||||
|
changelog.json
|
||||||
|
config
|
||||||
|
cover.out
|
||||||
|
deploy
|
||||||
|
design
|
||||||
|
docs
|
||||||
|
hack
|
||||||
|
overrides
|
||||||
|
site
|
||||||
|
terraform
|
18
Dockerfile.standalone
Normal file
18
Dockerfile.standalone
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
# This version of Dockerfile is for building without external dependencies.
|
||||||
|
FROM golang:1.18-alpine AS builder
|
||||||
|
ENV CGO_ENABLED=0 GOOS=linux GOARCH=amd64
|
||||||
|
WORKDIR /app
|
||||||
|
# Avoid invalidating the `go mod download` cache when only code has changed.
|
||||||
|
COPY go.mod go.sum /app/
|
||||||
|
RUN go mod download
|
||||||
|
COPY . /app/
|
||||||
|
RUN go build -o external-secrets main.go
|
||||||
|
|
||||||
|
|
||||||
|
FROM gcr.io/distroless/static AS app
|
||||||
|
COPY --from=builder /app/external-secrets /bin/external-secrets
|
||||||
|
|
||||||
|
# Run as UID for nobody
|
||||||
|
USER 65534
|
||||||
|
|
||||||
|
ENTRYPOINT ["/bin/external-secrets"]
|
|
@ -1,8 +1,8 @@
|
||||||
You can test a feature that was not yet released using the following method, use it at your own discretion:
|
You can test a feature that was not yet released using the following methods, use them at your own discretion:
|
||||||
|
|
||||||
|
### Helm
|
||||||
1. Create a `values.yaml` file with the following content:
|
1. Create a `values.yaml` file with the following content:
|
||||||
|
```yaml
|
||||||
```
|
|
||||||
replicaCount: 1
|
replicaCount: 1
|
||||||
|
|
||||||
image:
|
image:
|
||||||
|
@ -14,13 +14,30 @@ image:
|
||||||
# -- If set, install and upgrade CRDs through helm chart.
|
# -- If set, install and upgrade CRDs through helm chart.
|
||||||
installCRDs: false
|
installCRDs: false
|
||||||
```
|
```
|
||||||
|
1. Install the crds
|
||||||
2. Install the crds
|
```shell
|
||||||
```
|
|
||||||
make crds.install
|
make crds.install
|
||||||
```
|
```
|
||||||
|
1. Install the external-secrets Helm chart indicating the values file created before:
|
||||||
3. Install the external-secrets Helm chart indicating the values file created before:
|
|
||||||
```
|
```
|
||||||
helm install external-secrets external-secrets/external-secrets -f values.yaml
|
helm install external-secrets external-secrets/external-secrets -f values.yaml
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
### Manual
|
||||||
|
1. Build the Docker image
|
||||||
|
```shell
|
||||||
|
docker build -f Dockerfile.standalone -t my-org/external-secrets:latest .
|
||||||
|
```
|
||||||
|
1. Apply the `bundle.yaml`
|
||||||
|
```shell
|
||||||
|
kubectl apply -f deploy/crds/bundle.yaml
|
||||||
|
```
|
||||||
|
1. Modify your configs to use the image
|
||||||
|
```yaml
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: external-secrets|external-secrets-webhook|external-secrets-cert-controller
|
||||||
|
...
|
||||||
|
image: my-org/external-secrets:latest
|
||||||
|
```
|
||||||
|
|
Loading…
Reference in a new issue