1Password Connect Operator on a Homelab: Secrets Without ConfigMap Drift
Why Homelab Secrets Rot Faster Than Cloud
In a single-admin homelab, secrets management is a constant battle against the inevitable drift between your git repository and your Kubernetes cluster. Unlike cloud teams that have dedicated DevOps engineers and workflows, homelab operators often find themselves manually patching secrets, editing ConfigMaps, and restarting pods to keep everything in sync. This process is error-prone and time-consuming, especially when you have multiple applications running across different namespaces.
Consider the scenario where you have a homelab with several applications: Immich for photo management, Strapi for content management, a private registry for Docker images, and monitoring tools. Each application might require different secrets, and keeping track of them all can be a nightmare. For example, you might have a PostgreSQL database for Immich, and you need to update the password every few months. If you manage this via a ConfigMap, you might forget to update the Secret in the cluster, or you might accidentally commit the wrong value to your git repository.
In a cloud environment, you might use a secrets management tool like HashiCorp Vault or AWS Secrets Manager to handle these secrets. However, in a homelab, you often find yourself relying on manual processes, which can lead to drift and security vulnerabilities. For instance, you might have a kubectl command that you run to update a Secret, but you might forget to run it, or you might run it in the wrong namespace. This can lead to unexpected behavior, such as a pod failing to start because it can't connect to the database.
To address this issue, we can use the 1Password Connect Operator to manage our secrets in a more automated and secure way. The Connect Operator allows us to sync secrets from 1Password to Kubernetes Secrets, ensuring that our secrets are always up-to-date and consistent across the cluster.
Connect vs Operator vs Plain Secrets
Before we dive into the details of the 1Password Connect Operator, let's compare it to other methods of managing secrets in a homelab environment.
When Kubectl Secrets Are Enough
For simple applications that don't require frequent secret updates, using plain Kubernetes Secrets might be sufficient. For example, if you have a small application that only needs a single secret, you can create a Secret and manage it manually. However, this approach becomes cumbersome when you have multiple secrets and multiple applications.
When 1Password Connect Is Enough
If you have a few secrets that you need to update occasionally, you can use 1Password Connect to sync these secrets to Kubernetes Secrets. This is a good option if you don't need the full power of a dedicated secrets management tool.
When the Operator Pays Off
The 1Password Connect Operator is particularly useful when you have a large number of secrets that need to be updated frequently. It automates the process of syncing secrets from 1Password to Kubernetes Secrets, ensuring that your secrets are always up-to-date and consistent. This is especially useful in a homelab environment where you might have multiple namespaces and applications.
For example, in our homelab, we use the 1Password Connect Operator to sync PostgreSQL credentials for the Immich application. This ensures that the PostgreSQL database is always accessible, and the credentials are always up-to-date. We also use the Operator to sync secrets for the private registry, monitoring tools, and other applications.
Operator Install Pattern
To install the 1Password Connect Operator, we follow a specific pattern that ensures the Operator is always up-to-date and running correctly. Here are the steps:
- Namespace Watch: The Operator watches a specific namespace for
OnePasswordItemcustom resource definitions (CRDs). - Connect Token Secret: The Operator requires a Secret that contains the Connect token. This token is used to authenticate with 1Password.
- OnePasswordItem CRD: The
OnePasswordItemCRD is used to define the secrets that need to be synced. - Deployment
secretKeyRef: The Operator's Deployment is configured to usesecretKeyRefto access the Connect token Secret.
Let's go through each step in detail.
Namespace Watch
The Operator watches a specific namespace for OnePasswordItem CRDs. This ensures that any new secrets added to this namespace are automatically synced to Kubernetes Secrets.
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: onepassworditems.1password.com
spec:
group: 1password.com
versions:
- name: v1
served: true
storage: true
schema:
openAPIV3Schema:
type: object
properties:
spec:
type: object
properties:
itemID:
type: string
itemUUID:
type: string
itemTitle:
type: string
itemFields:
type: array
items:
type: object
properties:
name:
type: string
value:
type: string
scope: Namespaced
names:
plural: onepassworditems
singular: onepassworditem
kind: OnePasswordItem
shortNames:
- opitem
Connect Token Secret
The Operator requires a Secret that contains the Connect token. This token is used to authenticate with 1Password. Here is an example of how to create the Connect token Secret:
apiVersion: v1
kind: Secret
metadata:
name: 1password-connect-token
namespace: <app-namespace>
type: Opaque
data:
connect_token: <base64-encoded-connect-token>
OnePasswordItem CRD
The OnePasswordItem CRD is used to define the secrets that need to be synced. Here is an example of how to create a OnePasswordItem CRD:
apiVersion: 1password.com/v1
kind: OnePasswordItem
metadata:
name: immich-postgres-credentials
namespace: <app-namespace>
spec:
itemID: <item-id>
itemUUID: <item-uuid>
itemTitle: PostgreSQL Credentials
itemFields:
- name: Password
value: <password>
Deployment secretKeyRef
The Operator's Deployment is configured to use secretKeyRef to access the Connect token Secret. Here is an example of how to configure the Deployment:
apiVersion: apps/v1
kind: Deployment
metadata:
name: 1password-connect-operator
namespace: <app-namespace>
spec:
replicas: 1
selector:
matchLabels:
app: 1password-connect-operator
template:
metadata:
labels:
app: 1password-connect-operator
spec:
containers:
- name: 1password-connect-operator
image: <connect-operator-image>
env:
- name: CONNECT_TOKEN
valueFrom:
secretKeyRef:
name: 1password-connect-token
key: connect_token
volumeMounts:
- name: config-volume
mountPath: /config
volumes:
- name: config-volume
secret:
secretName: 1password-connect-token
Verification Loop
To ensure that the 1Password Connect Operator is working correctly, we use a verification loop. This loop checks that the secrets are correctly synced and that the applications are using the correct secrets.
./scripts/verify-infra-secrets-1password.sh
We have a script called ./scripts/verify-infra-secrets-1password.sh that verifies the secrets in the cluster. This script checks that the secrets are correctly synced and that the applications are using the correct secrets.
Here is an example of how to use the script:
#!/bin/bash
# Verify PostgreSQL credentials for Immich
echo "Verifying Immich PostgreSQL credentials..."
kubectl get secret immich-postgres-credentials -n <app-namespace> -o yaml | grep -q "password: <expected-password>"
if [ $? -eq 0 ]; then
echo "Immich PostgreSQL credentials are correct."
else
echo "Immich PostgreSQL credentials are incorrect."
exit 1
fi
Immich PostgreSQL Case Study
Let's take a closer look at the Immich PostgreSQL case study. In this case, we have a PostgreSQL database for the Immich application, and we need to ensure that the credentials are correctly synced.
Here is an example of the OnePasswordItem CRD for the Immich PostgreSQL credentials:
apiVersion: 1password.com/v1
kind: OnePasswordItem
metadata:
name: immich-postgres-credentials
namespace: immich
spec:
itemID: <item-id>
itemUUID: <item-uuid>
itemTitle: PostgreSQL Credentials
itemFields:
- name: Password
value: <password>
We can use the ./scripts/verify-infra-secrets-1password.sh script to verify that the credentials are correctly synced:
#!/bin/bash
# Verify PostgreSQL credentials for Immich
echo "Verifying Immich PostgreSQL credentials..."
kubectl get secret immich-postgres-credentials -n immich -o yaml | grep -q "password: <expected-password>"
if [ $? -eq 0 ]; then
echo "Immich PostgreSQL credentials are correct."
else
echo "Immich PostgreSQL credentials are incorrect."
exit 1
fi
Rotation Without Downtime
One of the key benefits of using the 1Password Connect Operator is that it allows us to rotate secrets without downtime. This is particularly useful when you have applications that rely on secrets, such as database credentials or API keys.
Update Vault Item → Reconcile → kubectl rollout restart
To rotate a secret, we update the corresponding item in 1Password, and the Operator will automatically sync the updated secret to Kubernetes. We can then use kubectl rollout restart to restart the application pods, ensuring that they use the updated secret.
Here is an example of how to update the PostgreSQL credentials for Immich:
- Update Vault Item: Update the PostgreSQL credentials in 1Password.
- Reconcile: The Operator will automatically sync the updated credentials to Kubernetes.
- Restart Pods: Use
kubectl rollout restartto restart the Immich pods.
# Update PostgreSQL credentials in 1Password
1password update item <item-id> --field Password <new-password>
# Restart Immich pods
kubectl rollout restart deployment/immich -n immich
Avoiding Stale Env Vars
To avoid stale environment variables, we can use the OnePasswordItem CRD to define the secrets and use secretKeyRef in the application's deployment. This ensures that the application always uses the latest secret.
Here is an example of how to define the PostgreSQL credentials in the OnePasswordItem CRD:
apiVersion: 1password.com/v1
kind: OnePasswordItem
metadata:
name: immich-postgres-credentials
namespace: immich
spec:
itemID: <item-id>
itemUUID: <item-uuid>
itemTitle: PostgreSQL Credentials
itemFields:
- name: Password
value: <password>
And here is an example of how to use secretKeyRef in the application's deployment:
apiVersion: apps/v1
kind: Deployment
metadata:
name: immich
namespace: immich
spec:
replicas: 1
selector:
matchLabels:
app: immich
template:
metadata:
labels:
app: immich
spec:
containers:
- name: immich
image: <immich-image>
env:
- name: POSTGRES_PASSWORD
valueFrom:
secretKeyRef:
name: immich-postgres-credentials
key: Password
What Not to Sync via Items
While the 1Password Connect Operator is a powerful tool for managing secrets, there are some scenarios where it might not be the best choice. Here are some examples of what not to sync via items:
Telegram Bot Tokens in ConfigMap
Telegram bot tokens are sensitive information that should not be stored in ConfigMaps. If you store a bot token in a ConfigMap, you risk exposing it to unauthorized users. Instead, you can use the 1Password Connect Operator to sync the bot token to a Kubernetes Secret.
Here is an example of how to define a bot token in a ConfigMap:
apiVersion: v1
kind: ConfigMap
metadata:
name: telegram-bot-config
namespace: monitoring
data:
bot_token: <telegram-bot-token>
And here is an example of how to define the bot token in a OnePasswordItem CRD:
apiVersion: 1password.com/v1
kind: OnePasswordItem
metadata:
name: telegram-bot-token
namespace: monitoring
spec:
itemID: <item-id>
itemUUID: <item-uuid>
itemTitle: Telegram Bot Token
itemFields:
- name: Bot Token
value: <telegram-bot-token>
Committing Connect Credentials
Committing Connect credentials to your git repository is a bad practice. If you commit the Connect credentials, you risk exposing them to unauthorized users. Instead, you can use the 1Password Connect Operator to sync the Connect credentials to a Kubernetes Secret.
Here is an example of how to define the Connect credentials in a ConfigMap:
apiVersion: v1
kind: ConfigMap
metadata:
name: 1password-connect-credentials
namespace: <app-namespace>
data:
connect_token: <connect-token>
And here is an example of how to define the Connect credentials in a OnePasswordItem CRD:
apiVersion: 1password.com/v1
kind: OnePasswordItem
metadata:
name: 1password-connect-credentials
namespace: <app-namespace>
spec:
itemID: <item-id>
itemUUID: <item-uuid>
itemTitle: 1Password Connect Credentials
itemFields:
- name: Connect Token
value: <connect-token>
Per-App Connect Sprawl
Using a separate Connect instance for each application can lead to per-app Connect sprawl. This can make it difficult to manage and rotate secrets. Instead, you can use a single Connect instance to manage all your secrets.
Here is an example of how to define the Connect credentials in a OnePasswordItem CRD:
apiVersion: 1password.com/v1
kind: OnePasswordItem
metadata:
name: 1password-connect-credentials
namespace: <app-namespace>
spec:
itemID: <item-id>
itemUUID: <item-uuid>
itemTitle: 1Password Connect Credentials
itemFields:
- name: Connect Token
value: <connect-token>
Runbook Pointer
For more detailed information on managing secrets in a homelab environment, please refer to the runbook available at [kb slug 1password-operator-homelab].
By following the steps outlined in this article, you can manage your secrets more securely and efficiently using the 1Password Connect Operator. This approach ensures that your secrets are always up-to-date and consistent, reducing the risk of drift and security vulnerabilities.
For more information on managing secrets in a homelab environment, please refer to the runbook available at [kb slug 1password-operator-homelab].
This article provides a comprehensive guide to using the 1Password Connect Operator in a homelab environment. By following the steps outlined, you can manage your secrets more securely and efficiently, reducing the risk of drift and security vulnerabilities.
1Password Connect Operator在家庭实验室中的應用: Secrets無需ConfigMap漂移
何時家庭實驗室的機密比雲端更新得更快
在單一管理員的家庭實驗室中,機密管理是一個不斷與不可避免的git存儲庫與Kubernetes群集之間偏移作戰。與擁有專門DevOps工程師和工作流程的雲端團隊不同,家庭實驗室操作員經常需要手動修補機密、編輯ConfigMaps並重新啟動pod來保持一切同步。這個過程容易出錯且耗時,特別是當您在不同的命名空間中運行多個應用程式時。
考慮這樣一個場景:您有一個包含多個應用程式的家庭實驗室:Immich用於照片管理,Strapi用於內容管理,私有註冊表用於Docker影像,以及監控工具。每個應用程式可能需要不同的機密,而跟蹤所有這些機密可能會變得非常複雜。例如,您可能為Immich使用了一個PostgreSQL資料庫,並且每幾個月需要更新密碼。如果您通過ConfigMap管理這些機密,您可能會忘記更新群集中的Secret,或者您可能會意外地將錯誤的值提交到git存儲庫。
在雲端環境中,您可以使用HashiCorp Vault或AWS Secrets Manager這樣的機密管理工具來處理這些機密。但是在家庭實驗室中,您通常會依賴手動流程,這可能會導致偏移和安全漏洞。例如,您可能有一個使用kubectl命令來更新Secret的命令,但是您可能會忘記運行它,或者您可能會在錯誤的命名空間中運行它。這可能會導致意想不到的行為,例如因為無法連接到資料庫而使pod無法啟動。
為了解決這個問題,我們可以使用1Password Connect Operator以更自動化和安全的方式來管理我們的機密。Connect Operator允許我們將1Password中的機密同步到Kubernetes Secrets,確保我們的機密始終是最新的且在整個群集中保持一致。
Connect 當!';
-'vs' Operator 當!'; -'vs' 平台 Secrets
在深入探討 1Password Connect Operator 的細節之前,讓我們比較一下它與其他管理 Secrets 的方法在家庭實驗室環境中的應用。
Kubectl Secrets 已足夠的情況
對於不需要頻繁更新 Secrets 的簡單應用程式,使用普通的 Kubernetes Secrets 可能已經足夠。例如,如果你有一個只需要單一 Secrets 的小型應用程式,你可以創建一個 Secrets 並手動管理它。但是,當你有多個 Secrets 和多個應用程式時,這種方法就會變得複雜。
1Password Connect 已足夠的情況
如果你有幾個需要偶爾更新的 Secrets,可以使用 1Password Connect 將這些 Secrets 同步到 Kubernetes Secrets。如果你不需要專門的 Secrets 管理工具的全部功能,這是一個很好的選擇。
Operator 帶來的價值
1Password Connect Operator 特別適合當你需要頻繁更新大量 Secrets 時。它自動化了從 1Password 同步 Secrets 到 Kubernetes Secrets 的過程,確保你的 Secrets 始終是最新的且一致的。這在家庭實驗室環境中尤其有用,因為你可能有多個命名空間和應用程式。
例如,在我們的家庭實驗室中,我們使用 1Password Connect Operator 將 Immich 應用程式的 PostgreSQL 認證資訊進行同步。這樣可以確保 PostgreSQL 資料庫始終可訪問,且認證資訊始終是最新的。我們還使用 Operator 將私有 registry、監控工具和其他應用程式的 Secrets 進行同步。
Operator 安裝模式
為了安裝 1Password Connect Operator,我們遵循特定的模式,確保 Operator 始終保持最新並正確運行。以下是步驟:
- 命名空間監視:Operator 會監視特定的命名空間中的
OnePasswordItem自訂資源定義(CRDs)。 - 連接令牌 Secret:Operator 需要一個 Secret,其中包含連接令牌。此令牌用於與 1Password 進行身份驗證。
- OnePasswordItem CRD:
OnePasswordItemCRD 用於定義需要同步的 Secrets。 - 部署
secretKeyRef:Operator 的 Deployment 設置為使用secretKeyRef來訪問連接令牌 Secret。
接下來,我們詳細介紹每個步驟。
命名空間監視
Operator 會監視特定的命名空間中的 OnePasswordItem CRDs。這確保了任何新增到此命名空間的 Secrets 會自動同步到 Kubernetes Secrets。
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: onepassworditems.1password.com
spec:
group: 1password.com
versions:
- name: v1
served: true
storage: true
schema:
openAPIV3Schema:
type: object
properties:
spec:
type: object
properties:
itemID:
type: string
itemUUID:
type: string
itemTitle:
type: string
itemFields:
type: array
items:
type: object
properties:
name:
type: string
value:
type: string
scope: Namespaced
names:
plural: onepassworditems
singular: onepassworditem
kind: OnePasswordItem
shortNames:
- opitem
連接令牌 Secret
Operator 需要一個 Secret,其中包含連接令牌。此令牌用於與 1Password 進行身份驗證。以下是如何創建連接令牌 Secret 的範例:
apiVersion: v1
kind: Secret
metadata:
name: 1password-connect-token
namespace: <app-命名空間>
type: Opaque
data:
connect_token: <base64-編碼的連接令牌>
OnePasswordItem CRD
OnePasswordItem CRD 用於定義需要同步的 Secrets。以下是如何創建 OnePasswordItem CRD 的範例:
apiVersion: 1password.com/v1
kind: OnePasswordItem
metadata:
name: immich-postgres-credentials
namespace: <app-命名空間>
spec:
itemID: <item-id>
itemUUID: <item-uuid>
itemTitle: PostgreSQL 認證資料
itemFields:
- name: 密碼
value: <密碼>
部署 secretKeyRef
Operator 的 Deployment 設置為使用 secretKeyRef 來訪問連接令牌 Secret。以下是如何配置 Deployment 的範例:
apiVersion: apps/v1
kind: Deployment
metadata:
name: 1password-connect-operator
namespace: <app-命名空間>
spec:
replicas: 1
selector:
matchLabels:
app: 1password-connect-operator
template:
metadata:
labels:
app: 1password-connect-operator
spec:
containers:
- name: 1password-connect-operator
image: <連接操作員影像>
env:
- name: CONNECT_TOKEN
valueFrom:
secretKeyRef:
name: 1password-connect-token
key: connect_token
volumeMounts:
- name: config-volume
mountPath: /config
volumes:
- name: config-volume
secret:
secretName: 1password-connect-token
驗證迴圈
為了確保 1Password Connect Operator 能正確運作,我們使用了一個驗證迴圈。這個迴圈會檢查密碼是否正確同步,以及應用程式是否使用正確的密碼。
./scripts/verify-infra-secrets-1password.sh
我們有一個名為 ./scripts/verify-infra-secrets-1password.sh 的腳本,用於驗證集群中的密碼。這個腳本會檢查密碼是否正確同步,以及應用程式是否使用正確的密碼。
以下是如何使用這個腳本的範例:
#!/bin/bash
# 驗證 Immich 的 PostgreSQL 認證資訊
echo "驗證 Immich 的 PostgreSQL 認證資訊..."
kubectl get secret immich-postgres-credentials -n <app-命名空間> -o yaml | grep -q "password: <預期密碼>"
if [ $? -eq 0 ]; then
echo "Immich 的 PostgreSQL 認證資訊正確。"
else
echo "Immich 的 PostgreSQL 認證資訊不正確。"
exit 1
fi
Immich PostgreSQL 案例研究
接下來,我們來看一個更詳細的 Immich PostgreSQL 案例研究。在這個案例中,我們有一個為 Immich 應用程式使用的 PostgreSQL 資料庫,並且需要確保認證資訊已正確同步。
以下是一個 OnePasswordItem CRD 的範例,用於 Immich 的 PostgreSQL 認證資訊:
apiVersion: 1password.com/v1
kind: OnePasswordItem
metadata:
name: immich-postgres-credentials
namespace: immich
spec:
itemID: <項目ID>
itemUUID: <項目UUID>
itemTitle: PostgreSQL 認證資訊
itemFields:
- name: 密碼
value: <密碼>
我們可以使用 ./scripts/verify-infra-secrets-1password.sh 腳本來驗證認證資訊是否正確同步:
#!/bin/bash
# 驗證 Immich 的 PostgreSQL 認證資訊
echo "驗證 Immich 的 PostgreSQL 認證資訊..."
kubectl get secret immich-postgres-credentials -n immich -o yaml | grep -q "password: <預期密碼>"
if [ $? -eq 0 ]; then
echo "Immich 的 PostgreSQL 認證資訊正確。"
else
echo "Immich 的 PostgreSQL 認證資訊不正確。"
exit 1
fi
無停機的輪替
使用 1Password Connect Operator 的一個重要優點是,它允許我們在無停機的情況下輪替秘鑰。這在應用程式依賴於秘鑰的情況下特別有用,例如資料庫憑證或API金鑰。
更新金鑰庫項目 → 重整 → kubectl rollout restart
要輪替一個秘鑰,我們可以更新 1Password 中對應的項目,然後 Operator 會自動將更新的秘鑰同步到 Kubernetes。然後我們可以使用 kubectl rollout restart 重新啟動應用程式的容器,確保它們使用更新的秘鑰。
以下是如何輪替 Immich 的 PostgreSQL 凭證的範例:
- 更新金鑰庫項目:在 1Password 中更新 PostgreSQL 凭證。
- 重整:Operator 會自動將更新的憑證同步到 Kubernetes。
- 重新啟動容器:使用
kubectl rollout restart重新啟動 Immich 容器。
# 更新 1Password 中的 PostgreSQL 凭證
1password update item <item-id> --field Password <new-password>
# 重新啟動 Immich 容器
kubectl rollout restart deployment/immich -n immich
避免過時的環境變數
為了避免過時的環境變數,我們可以使用 OnePasswordItem CRD 來定義秘鑰,並在應用程式的部署中使用 secretKeyRef。這確保應用程式始終使用最新的秘鑰。
以下是如何在 OnePasswordItem CRD 中定義 PostgreSQL 凭證的範例:
apiVersion: 1password.com/v1
kind: OnePasswordItem
metadata:
name: immich-postgres-credentials
namespace: immich
spec:
itemID: <item-id>
itemUUID: <item-uuid>
itemTitle: PostgreSQL Credentials
itemFields:
- name: Password
value: <password>
以下是如何在應用程式的部署中使用 secretKeyRef 的範例:
apiVersion: apps/v1
kind: Deployment
metadata:
name: immich
namespace: immich
spec:
replicas: 1
selector:
matchLabels:
app: immich
template:
metadata:
labels:
app: immich
spec:
containers:
- name: immich
image: <immich-image>
env:
- name: POSTGRES_PASSWORD
valueFrom:
secretKeyRef:
name: immich-postgres-credentials
key: Password
不應透過項目同步的內容
雖然 1Password Connect Operator 是一個強大的工具,用於管理機密,但在某些情況下,它可能不是最佳選擇。以下是幾個不應透過項目同步的範例:
ConfigMap 中的 Telegram Bot 條碼
Telegram Bot 條碼是敏感資訊,不應該存儲在 ConfigMap 中。如果您將 Bot 條碼存儲在 ConfigMap 中,可能會將其暴露給未授權的使用者。相反地,您可以使用 1Password Connect Operator 將 Bot 條碼同步到 Kubernetes Secret。
以下是如何在 ConfigMap 中定義 Bot 條碼的範例:
apiVersion: v1
kind: ConfigMap
metadata:
name: telegram-bot-config
namespace: monitoring
data:
bot_token: <telegram-bot-token>
以下是如何在 OnePasswordItem CRD 中定義 Bot 條碼的範例:
apiVersion: 1password.com/v1
kind: OnePasswordItem
metadata:
name: telegram-bot-token
namespace: monitoring
spec:
itemID: <item-id>
itemUUID: <item-uuid>
itemTitle: Telegram Bot Token
itemFields:
- name: Bot Token
value: <telegram-bot-token>
提交 Connect 認證
將 Connect 認證提交到您的 git 仓库是不良做法。如果您提交 Connect 認證,可能會將其暴露給未授權的使用者。相反地,您可以使用 1Password Connect Operator 將 Connect 認證同步到 Kubernetes Secret。
以下是如何在 ConfigMap 中定義 Connect 認證的範例:
apiVersion: v1
kind: ConfigMap
metadata:
name: 1password-connect-credentials
namespace: <app-namespace>
data:
connect_token: <connect-token>
以下是如何在 OnePasswordItem CRD 中定義 Connect 認證的範例:
apiVersion: 1password.com/v1
kind: OnePasswordItem
metadata:
name: 1password-connect-credentials
namespace: <app-namespace>
spec:
itemID: <item-id>
itemUUID: <item-uuid>
itemTitle: 1Password Connect Credentials
itemFields:
- name: Connect Token
value: <connect-token>
每個應用程式使用單獨的 Connect 連接
為每個應用程式使用單獨的 Connect 連接會導致每個應用程式的 Connect 連接氾濫。這可能會使機密的管理和輪轉變得複雜。相反地,您可以使用單一的 Connect 連接來管理所有機密。
以下是如何在 OnePasswordItem CRD 中定義 Connect 認證的範例:
apiVersion: 1password.com/v1
kind: OnePasswordItem
metadata:
name: 1password-connect-credentials
namespace: <app-namespace>
spec:
itemID: <item-id>
itemUUID: <item-uuid>
itemTitle: 1Password Connect Credentials
itemFields:
- name: Connect Token
value: <connect-token>
Runbook 指引
如需更多關於在家庭實驗室環境中管理 Secrets 的詳細資訊,請參閱 [kb slug 1password-operator-homelab] 中的 runbook。
透過本篇文章中列出的步驟,您可以使用 1Password Connect Operator 更安全且高效地管理 Secrets。此方法可確保您的 Secrets 始終保持最新且一致,從而降低偏離和安全漏洞的風險。
如需更多關於在家庭實驗室環境中管理 Secrets 的資訊,請參閱 [kb slug 1password-operator-homelab] 中的 runbook。
本文提供了在家庭實驗室環境中使用 1Password Connect Operator 的全面指南。透過遵循本文中的步驟,您可以更安全且高效地管理 Secrets,從而降低偏離和安全漏洞的風險。
Related internal runbook: 1password-operator-homelab (VPN) 相關內部 runbook:1password-operator-homelab(VPN)