Skip to content

Commit

Permalink
feat!: Rename project from bitwarden-operator to warden-secret-operat…
Browse files Browse the repository at this point in the history
…or to respect trademarks
  • Loading branch information
tomjo committed Dec 28, 2023
1 parent 4c3d784 commit bf0ea9c
Show file tree
Hide file tree
Showing 16 changed files with 216 additions and 213 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,15 @@ jobs:
if: ${{ inputs.upload }}
uses: actions/upload-artifact@c7d193f32edcb7bfad88892161225aeda64e9392 # v4.0.0
with:
name: bitwarden-operator
path: target/release/bitwarden-operator
name: warden-secret-operator
path: target/release/warden-secret-operator
- name: Add binary to release
if: ${{ github.event_name == 'release' && inputs.upload }}
uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 # v0.1.15
with:
tag_name: ${{ inputs.version }}
files: |
bitwarden-operator
warden-secret-operator
- name: Install cosign
if: ${{ inputs.sign }}
uses: sigstore/cosign-installer@9614fae9e5c5eddabb09f90a270fcb487c9f7149 # v3.3.0
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "bitwarden-operator"
name = "warden-secret-operator"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ RUN apt-get update \

USER 200000

COPY /target/release/bitwarden-operator /bitwarden-operator
COPY /target/release/warden-secret-operator /warden-secret-operator

WORKDIR /
CMD ["/bitwarden-operator"]
CMD ["/warden-secret-operator"]
54 changes: 29 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,14 @@
# bitwarden-operator
# warden-secret-operator

Kubernetes operator written in Rust to provision Kubernetes Secret resources sourced from a Bitwarden/Vaultwarden vault.
warden-secret-operator is a Kubernetes Operator written in Rust using [kube-rs](https://kube.rs) to provision Kubernetes Secret resources sourced from a [Bitwarden](https://bitwarden.com)/[Vaultwarden vault](https://github.com/dani-garcia/vaultwarden).

## Motivation
## Motivation / Disclaimer

This was written to scratch my own urge, using Vaultwarden as a source for secrets in my homelab Kubernetes environment.
As well as getting my hands dirty with Rust for the first time.
As well as getting my hands dirty with Rust for the *first time*.
This means the code is probably far from idiomatic, efficient or sane; please suggest improvements!

## Usage

Create a BitwardenSecret resource that references your secret but does not contain it,
this means it is safe to commit to source control.

The type in the BitwardenSecret spec will be used as the type for the Kubernetes Secret resource.
Labels and annotations will also appear on the created secret.

The item field in the spec references the secret in the vault,
it should be in the format `[collection]/secret` where collection is optional.

```yaml
apiVersion: bitwarden-operator.k8s.io/v1alpha1
kind: BitwardenSecret
metadata:
name: example
spec:
item: my-collection/my-secret
type: Opaque
```
## Getting started

### Prerequisites

Expand Down Expand Up @@ -55,7 +36,7 @@ organization = "my-bitwarden-organization-uuid"

#### Environment variables

All configuration environment variables are prefixed with `BW_OPERATOR_`. Followed by the name of the configuration key,
All configuration environment variables are prefixed with `BW_OPERATOR_`. Followed by the name of the configuration key,
where the key is in uppercase and words are separated by underscores.

#### Options
Expand All @@ -70,3 +51,26 @@ where the key is in uppercase and words are separated by underscores.
* **webserver_tls** - enables TLS for the webserver | **Default:** `false`
* **tls_cert_path** - path to the certificate used when TLS is enabled | **Default:** `/certs/tls.crt`
* **tls_key_path** - path to the certificate key used when TLS is enabled | **Default:** `/certs/tls.key`

### Usage

Create a WardenSecret resource that references your secret but does not contain it,
this means it is safe to commit to source control.

The type in the WardenSecret spec will be used as the type for the Kubernetes Secret resource.
Labels and annotations will also appear on the created secret.

The item field in the spec references the secret in the vault,
it should be in the format `[collection]/secret` where collection is optional.

All associated fields and attachment of the vault secret will be mapped to the kubernetes secret.

```yaml
apiVersion: warden-secret-operator.k8s.io/v1alpha1
kind: WardenSecret
metadata:
name: example
spec:
item: my-collection/my-secret
type: Opaque
```
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: bitwardensecrets.tomjo.net
name: wardensecrets.tomjo.net
namespace: default # For easier deployment and avoid permissions collisions on most clusters, the resource is namespace-scoped. More information at: https://kubernetes.io/docs/tasks/extend-kubernetes/custom-resources/custom-resource-definitions/
spec:
group: tomjo.net
Expand All @@ -15,15 +15,15 @@ spec:
# - v1
# clientConfig:
# service:
# namespace: bitwarden-operator
# name: bitwarden-operator-webhook
# namespace: warden-secret-operator
# name: warden-secret-operator-webhook
# path: /crdconvert
names:
kind: BitwardenSecret
plural: bitwardensecrets
singular: bitwardensecret
kind: WardenSecret
plural: wardensecrets
singular: wardensecret
shortNames:
- bitwardensecret
- wardensecret
- bw
scope: Namespaced
versions:
Expand Down
2 changes: 1 addition & 1 deletion deploy/manifests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

This directory contains the manifests for a basic deployment of the application.

You will need to supply your own secret named bitwarden-operator containing following keys:
You will need to supply your own secret named warden-secret-operator containing following keys:
- `BW_OPERATOR_USER`: Bitwarden user
- `BW_OPERATOR_PASS`: Bitwarden password

Expand Down
4 changes: 2 additions & 2 deletions deploy/manifests/bitwarden-operator.configmap.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: bitwarden-operator
name: warden-secret-operator
labels:
app.kubernetes.io/name: bitwarden-operator
app.kubernetes.io/name: warden-secret-operator
data:
RUST_LOG: "info"
18 changes: 9 additions & 9 deletions deploy/manifests/bitwarden-operator.deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,34 @@ apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app.kubernetes.io/name: bitwarden-operator
name: bitwarden-operator
app.kubernetes.io/name: warden-secret-operator
name: warden-secret-operator
spec:
progressDeadlineSeconds: 600
replicas: 1
revisionHistoryLimit: 3
selector:
matchLabels:
app.kubernetes.io/name: bitwarden-operator
app.kubernetes.io/name: warden-secret-operator
strategy:
type: RollingUpdate
template:
metadata:
labels:
app.kubernetes.io/name: bitwarden-operator
app.kubernetes.io/name: warden-secret-operator
spec:
containers:
- envFrom:
- secretRef:
name: bitwarden-operator
name: warden-secret-operator
- configMapRef:
name: bitwarden-operator
image: ghcr.io/tomjo/bitwarden-operator:latest
name: warden-secret-operator
image: ghcr.io/tomjo/warden-secret-operator:latest
imagePullPolicy: Always
name: bitwarden-operator
name: warden-secret-operator
ports:
- containerPort: 8080
name: web
protocol: TCP
serviceAccountName: bitwarden-operator
serviceAccountName: warden-secret-operator
terminationGracePeriodSeconds: 30
4 changes: 2 additions & 2 deletions deploy/manifests/bitwarden-operator.sa.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: bitwarden-operator
name: warden-secret-operator
labels:
app.kubernetes.io/name: bitwarden-operator
app.kubernetes.io/name: warden-secret-operator
6 changes: 3 additions & 3 deletions deploy/manifests/bitwarden-operator.service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ apiVersion: v1
kind: Service
metadata:
labels:
app.kubernetes.io/name: bitwarden-operator
name: bitwarden-operator
app.kubernetes.io/name: warden-secret-operator
name: warden-secret-operator
spec:
ports:
- name: web
port: 8080
protocol: TCP
targetPort: 8080
selector:
app.kubernetes.io/name: bitwarden-operator
app.kubernetes.io/name: warden-secret-operator
type: ClusterIP
Loading

0 comments on commit bf0ea9c

Please sign in to comment.