🔐 External Services Setup
📋 Overview
graph TD
subgraph "1Password Integration"
A[1Password Account] --> B[1Password Connect]
B --> C[Connect Token]
B --> D[Connect Credentials]
end
subgraph "Cloudflare Integration"
E[Cloudflare Account] --> F[DNS API Token]
E --> G[Tunnel Token]
G --> H[Tunnel Credentials]
end
🔑 1Password Setup
Overview
1Password integration requires two distinct components:
1. Connect Credentials (1password-credentials.json
)
- Used to authenticate the 1Password Connect server
- Contains server identity and verification keys
- Generated once per cluster
- Connect Token
- Used by applications to access the Connect server
- Scoped to specific vaults
- Can be rotated without regenerating credentials
Setup Steps
-
Create 1Password Connect Server 🛠️
# Install 1Password CLI brew install 1password-cli # macOS # or curl -sS https://downloads.1password.com/linux/keys/1password.asc | \ sudo gpg --dearmor --output /usr/share/keyrings/1password-archive-keyring.gpg # Generate Connect Credentials op connect server create k3s-cluster # This creates 1password-credentials.json
-
Create Connect Token 🎟️
-
Required Vault Items 📝 Create these items in your 1Password vault:
-
cert-manager-cloudflare
-
cloudflared-tunnel
☁️ Cloudflare Setup
Required Tokens
- DNS API Token 🔑
- Used by cert-manager for DNS01 challenges
-
Permissions needed:
- Zone - DNS - Edit
- Zone - Zone - Read
-
Tunnel Token 🌐
- Used by cloudflared for tunnel authentication
- Created automatically when setting up the tunnel
Setup Steps
-
Create DNS API Token 🔧
-
Create Cloudflare Tunnel 🚇
# Install cloudflared brew install cloudflare/cloudflare/cloudflared # macOS # or wget -q https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64.deb sudo dpkg -i cloudflared-linux-amd64.deb # Login to Cloudflare cloudflared tunnel login # Create tunnel cloudflared tunnel create k3s-cluster # Get tunnel credentials cloudflared tunnel token --cred-file tunnel-creds.json k3s-cluster
-
Configure DNS Records 📡
🔒 Secret Structure
1Password Connect Secrets
# 1password-credentials secret
apiVersion: v1
kind: Secret
metadata:
name: 1password-credentials
namespace: 1passwordconnect
type: Opaque
stringData:
1password-credentials.json: |
{
"verifier": "...",
"connector": "..."
}
# Connect token secret
apiVersion: v1
kind: Secret
metadata:
name: 1password-operator-token
namespace: 1passwordconnect
type: Opaque
stringData:
token: "your-connect-token"
Cloudflare Secrets
# DNS API token secret
apiVersion: v1
kind: Secret
metadata:
name: cloudflare-api-token
namespace: cert-manager
type: Opaque
stringData:
api-token: "your-dns-api-token"
# Tunnel credentials secret
apiVersion: v1
kind: Secret
metadata:
name: cloudflare-tunnel
namespace: cloudflared
type: Opaque
stringData:
credentials.json: |
{
"AccountTag": "...",
"TunnelSecret": "...",
"TunnelID": "..."
}
✅ Validation
1Password Connect
# Test credentials
curl -v http://1password-connect:8080/heartbeat \
-H "Authorization: Bearer $CONNECT_TOKEN"
# Test secret access
kubectl get secret -n external-secrets
kubectl get externalsecret -A
Cloudflare
# Test DNS API token
curl -X GET "https://api.cloudflare.com/client/v4/user/tokens/verify" \
-H "Authorization: Bearer $DNS_API_TOKEN"
# Test tunnel connection
cloudflared tunnel info k3s-cluster
kubectl get pods -n cloudflared
🔍 Troubleshooting
1Password Issues
-
Connection Issues 🔌
-
Secret Sync Issues 🔄
Cloudflare Issues
-
DNS Issues 🌐
-
Tunnel Issues 🚇