เจตนาเดียวของนักพัฒนา รูปแบบการส่งมอบข้อมูลรับรองสองแบบ
ข้อมูล
พื้นที่
สิ่งที่เคลื่อนและสิ่งที่คงไว้
| ไฟล์ | เป้า | เป้า |
|---|---|---|
aggregate.yaml | ไฟล์ | ไฟล์ |
| Manifest | manifest-local.yaml | manifest-store.yaml |
| Release | release-local.yaml | release-store.yaml |
Manifests ทั้ง
$ diff manifest-local.yaml manifest-store.yaml7c7< name: credential-shape-local-manifest---> name: credential-shape-store-manifest16c16< core/referenced-secret:1.0.0: helm/k8s-secret-from-parameter:1.0.0---> core/referenced-secret:1.0.0: helm/k8s-external-secret:1.0.0Releases ทั้ง
$ diff release-local.yaml release-store.yaml7c7< name: credential-shape-local---> name: credential-shape-store12c12< manifest: credential-shape-local-manifest---> manifest: credential-shape-store-manifestReleases ทั้งenvironment เดียวกัน นี่
ฝั่งนักพัฒนา ครั้งเดียว
aggregate.yaml เติม
features: password: type: core/referenced-secret values: key: POSTGRES_PASSWORD origin: postgres-superuser-password app_user_password: type: core/referenced-secret values: key: APP_USER_PASSWORD origin: postgres-app-passwordcore/referenced-secret ระบุ ทรัพยากร ข้อมูลname และ key ของprovides ของ
สิ่งที่แต่ละเป้าหมายส่งออก
การ
เป้าk8s-secret-from-parameter ที่ dist/helm/helm/db--password--db-secret-db-password.yaml:
apiVersion: v1kind: Secretmetadata: name: db-password [… omitted: the labels and annotations naming the aggregate, component, environment, compiler and provider versions, boundary and Recipe — the same set every rendered document carries]stringData: POSTGRES_PASSWORD: "postgres-superuser-password"เป้าk8s-external-secret ที่ dist/helm/helm/db--password--db-externalsecret-db-password.yaml:
apiVersion: external-secrets.io/v1kind: ExternalSecretmetadata: name: db-password [… omitted: the same label and annotation set as above]spec: refreshInterval: "1h" secretStoreRef: name: platform-secret-store kind: ClusterSecretStore target: name: db-password creationPolicy: Owner data: - secretKey: POSTGRES_PASSWORD remoteRef: key: "postgres-superuser-password"กลุ่ม API ต่างdb-password
การlocal/ และ store/):
$ diff -r local storeOnly in store/helm/helm: db--app-zuuser-zupassword--db-externalsecret-db-app-user-password.yamlOnly in local/helm/helm: db--app-zuuser-zupassword--db-secret-db-app-user-password.yamlOnly in store/helm/helm: db--password--db-externalsecret-db-password.yamlOnly in local/helm/helm: db--password--db-secret-db-password.yamlสี่db--password-- คือpassword บน db และ db--app-zuuser-zupassword-- คือapp_user_password โดย-zu เพราะ
สี่diff -r ไม่
การอ้างอิงที่ไม่เคลื่อน
คอนเทนเนอร์secretKeyRef บล็อก
- name: POSTGRES_PASSWORD valueFrom: secretKeyRef: name: db-password key: POSTGRES_PASSWORD- name: APP_USER_PASSWORD valueFrom: secretKeyRef: name: db-app-user-password key: APP_USER_PASSWORDเหมือนname และ key ที่
ความ
origin มีความหมายตามที่ FeatureRecipe บอก
core/referenced-secret ประกาศ origin เป็น
k8s-secret-from-parameterเขียนค่า นั้น ลง ใน Secret เป็น เนื้อหา k8s-external-secretอ่านค่า นั้น เป็น คีย์ ที่ จะ ดึง จาก ที่ จัด เก็บ
คอมไพเลอร์
ชื่อที่เผยแพร่ และขีดล่างในชื่อสล็อต
Component ตั้งapp_user_password ชื่อprovides.name ที่db-app-user-password:
- name: APP_USER_PASSWORD valueFrom: secretKeyRef: name: db-app-user-passwordFeatureRecipes ทั้ง
สิ่งที่เป้าหมายที่จัดเก็บคาดหวังจากคลัสเตอร์
ExternalSecret เป็นClusterSecretStore ชื่อ platform-secret-store อยู่ ไม่มี
คลัสเตอร์k8s-external-secret จึง
ร่างตัวอย่าง
คุณ
เขียน
aggrega draft --example credential-shape-per-targetจาก
cd credential-shape-per-targetบิลด์
aggrega build --release release-local.yaml --auto-pullaggrega build --release release-store.yaml --auto-pull--auto-pull หา
ทั้งdist/ และ aggrega build ไม่
out=$(mktemp -d)rm -rf dist && aggrega build --release release-local.yaml --auto-pull && cp -r dist "$out/local"rm -rf dist && aggrega build --release release-store.yaml --auto-pull && cp -r dist "$out/store"( cd "$out" && diff -r local store )เพื่อ--verify-determinism ทุก
aggrega build --release release-local.yaml --verify-determinismaggrega build --release release-store.yaml --verify-determinismกับผู้ช่วย AI
ผู้
ใช้เครื่องมือของ Aggrega เท่านั้น และอย่าสร้างโฟลเดอร์เอง หากโฟลเดอร์พื้นที่ทำงานยังไม่มีโฟลเดอร์ `credential-shape-per-target` เรียกเครื่องมือ `draft` หนึ่งครั้งโดยตั้ง `example` เป็น `credential-shape-per-target` และไม่ระบุ `dir` เครื่องมือจะเขียนตัวอย่างลงในโฟลเดอร์ `credential-shape-per-target` ใหม่ จากนั้นเรียกเครื่องมือ `build` หนึ่งครั้งต่อ Release ตามลำดับนี้ — `release-local.yaml`, `release-store.yaml` — โดยแต่ละครั้งตั้ง `workspace_root` เป็น `credential-shape-per-target` ตั้ง `release` เป็นไฟล์นั้น ตั้ง `auto_pull` เป็น true และตั้ง `write` เป็น true บอกฉันว่าการบิลด์แต่ละครั้งเขียนไฟล์ใดบ้าง ไฟล์เหล่านั้นอยู่ใต้ `credential-shape-per-target/dist/`ไฟล์
aggregate.yaml— เจตนาของ นัก พัฒนา: ส่วน ประกอบ dbหนึ่งรายการ ชนิด core/datastore/postgresโดยสล็อต ข้อมูล รับรอง ทั้ง สอง เติม ด้วย core/referenced-secretใช้โดย ไม่ เปลี่ยน ใน ทั้ง สอง Releases manifest-local.yaml— ผูกcore/referenced-secretกับk8s-secret-from-parameterซึ่งเรนเดอร์ Secret ของ Kubernetes จาก เนื้อหา ที่ เขียน ไว้ manifest-store.yaml— ผูก Feature เดียวกันกับ k8s-external-secretซึ่งเรนเดอร์ ExternalSecret ที่ ระบุ รายการ ใน ที่ จัด เก็บ เหมือน กับ manifest-local.yamlทุกประการ ยกเว้น ชื่อ ของ ตนเอง และ บรรทัด เดียว นั้น release-local.yaml,release-store.yaml— Releases ทั้งสอง รายการ เหมือน กัน ยกเว้น ชื่อ ของ ตนเอง และ Manifest ที่ แต่ละ รายการ ชี้ ไป .aggrega-config.yaml— ระบุชื่อ รีจิสทรี hub ที่ เอนทิตี ของ แค็ตตาล็อก หา ค่า มา
ค่า origin ที่