You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The OnePasswordItem CRD "itemPath" and annotations "operator.1password.io/item-path" makes it difficult to create a consistent staging and production deployment, where the only variant is the vault that's used.
Consider separating this into two fields: "vault" and "item".
Use cases
If I have a production and a staging environment, I want to have them be nearly identical. However, I want them to use different credentials... in terms of 1Password, separating them into two different vaults ("staging", "prod") seem to be the most logical choice.
However, this means your OnePasswordItem need to have an itemPath in the syntax of vaults/<vault_id_or_title>/items/<item_id_or_title>. Unfortunately, partial strings replacements with tools like Kustomize is not possible. It prefers the full text replacement of certain fields (for example using the ReplacementTransformer).
Proposed solution
I would suggest altering OnePasswordItem to look like:
apiVersion: onepassword.com/v1kind: OnePasswordItemmetadata:
name: <item_name> #this name will also be used for naming the generated kubernetes secretspec:
vault: "<vault_id_or_title>"item: "<item_id_or_title>"
...and the Deployment annotation could look like:
apiVersion: apps/v1kind: Deploymentmetadata:
name: deployment-exampleannotations:
operator.1password.io/item-vault: "<vault_id_or_title>"operator.1password.io/item-item: "<item_id_or_title>"# This is a really bad name, but follows conventionoperator.1password.io/item-name: "<secret_name>"
One interesting side-effect of this decoupling, is that vault: or operator.1password.io/item-vault would be optional. It means that the Onepassword-Operator could be expanded to include a "default vault".
So for my use case: My stored OnePasswordItem and operator.1password.io/ annotations would include an item: or operator.1password.io/item-item, but when I deploy these configurations to staging, I'd merely set the "default vault" to be staging on my Onepassword-Operator. Then for production, I'd simply set the Onepassword-Operator's "default vault" to production. It's a single change and trivial to maintain.
Is there a workaround to accomplish this today?
The only option would be to use External Secrets in conjunction with staker/Reloader. Unfortunately, this comes at the expense of needing two different annotations (one for External Secrets and a second for Reloader).
References & Prior Work
See link above.
The text was updated successfully, but these errors were encountered:
I've added your request to our internal tracker. I can't make promises about implementation, but I wanted to make sure you knew we've seen your suggestion.
Summary
The OnePasswordItem CRD "itemPath" and annotations "operator.1password.io/item-path" makes it difficult to create a consistent staging and production deployment, where the only variant is the vault that's used.
Consider separating this into two fields: "vault" and "item".
Use cases
If I have a production and a staging environment, I want to have them be nearly identical. However, I want them to use different credentials... in terms of 1Password, separating them into two different vaults ("staging", "prod") seem to be the most logical choice.
However, this means your
OnePasswordItem
need to have anitemPath
in the syntax ofvaults/<vault_id_or_title>/items/<item_id_or_title>
. Unfortunately, partial strings replacements with tools like Kustomize is not possible. It prefers the full text replacement of certain fields (for example using the ReplacementTransformer).Proposed solution
I would suggest altering
OnePasswordItem
to look like:...and the
Deployment
annotation could look like:One interesting side-effect of this decoupling, is that
vault:
oroperator.1password.io/item-vault
would be optional. It means that the Onepassword-Operator could be expanded to include a "default vault".So for my use case: My stored
OnePasswordItem
andoperator.1password.io/
annotations would include anitem:
oroperator.1password.io/item-item
, but when I deploy these configurations to staging, I'd merely set the "default vault" to bestaging
on my Onepassword-Operator. Then for production, I'd simply set the Onepassword-Operator's "default vault" toproduction
. It's a single change and trivial to maintain.Is there a workaround to accomplish this today?
The only option would be to use External Secrets in conjunction with staker/Reloader. Unfortunately, this comes at the expense of needing two different annotations (one for External Secrets and a second for Reloader).
References & Prior Work
See link above.
The text was updated successfully, but these errors were encountered: