mirror of
https://github.com/holos-run/holos.git
synced 2026-03-19 08:44:58 +00:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4c2bc34d58 |
@@ -15,9 +15,6 @@ package holos
|
||||
#Namespace & {
|
||||
metadata: _ns
|
||||
},
|
||||
#SecretStore & {
|
||||
_namespace: _ns.name
|
||||
},
|
||||
]
|
||||
}
|
||||
|
||||
@@ -2,6 +2,15 @@ package holos
|
||||
|
||||
import "encoding/json"
|
||||
|
||||
#DependsOn: _ESO
|
||||
|
||||
#InputKeys: {
|
||||
project: "secrets"
|
||||
component: "eso-creds-refresher"
|
||||
}
|
||||
|
||||
#TargetNamespace: #CredsRefresher.namespace
|
||||
|
||||
// output kubernetes api objects for holos
|
||||
#KubernetesObjects & {
|
||||
apiObjects: {
|
||||
@@ -13,15 +22,6 @@ import "encoding/json"
|
||||
}
|
||||
}
|
||||
|
||||
#InputKeys: {
|
||||
project: "secrets"
|
||||
component: "eso-creds-refresher"
|
||||
}
|
||||
|
||||
#TargetNamespace: #CredsRefresher.namespace
|
||||
|
||||
#DependsOn: Namespaces: name: #InstancePrefix + "-namespaces"
|
||||
|
||||
let NAME = #CredsRefresher.name
|
||||
let AUD = "//iam.googleapis.com/projects/\(#InputKeys.gcpProjectNumber)/locations/global/workloadIdentityPools/holos/providers/k8s-\(#InputKeys.cluster)"
|
||||
let MOUNT = "/var/run/service-account"
|
||||
@@ -0,0 +1,12 @@
|
||||
package holos
|
||||
|
||||
// Components under this directory are part of this collection
|
||||
#InputKeys: project: "secrets"
|
||||
|
||||
// Shared dependencies for all components in this collection.
|
||||
#DependsOn: _Namespaces
|
||||
|
||||
// Common Dependencies
|
||||
_Namespaces: Namespaces: name: "\(#StageName)-secrets-namespaces"
|
||||
_ESO: ESO: name: "\(#InstancePrefix)-eso"
|
||||
_ESOCreds: ESOCreds: name: "\(#InstancePrefix)-eso-creds-refresher"
|
||||
@@ -0,0 +1,34 @@
|
||||
package holos
|
||||
|
||||
#DependsOn: _ESOCreds
|
||||
|
||||
#TargetNamespace: "default"
|
||||
|
||||
#InputKeys: {
|
||||
project: "secrets"
|
||||
component: "stores"
|
||||
}
|
||||
|
||||
// #PlatformNamespaceObjects defines the api objects necessary for eso SecretStores in external clusters to access secrets in a given namespace in the provisioner cluster.
|
||||
#PlatformNamespaceObjects: {
|
||||
_ns: #PlatformNamespace
|
||||
|
||||
objects: [
|
||||
#SecretStore & {
|
||||
_namespace: _ns.name
|
||||
},
|
||||
]
|
||||
}
|
||||
|
||||
#KubernetesObjects & {
|
||||
apiObjects: {
|
||||
for ns in #PlatformNamespaces {
|
||||
for obj in (#PlatformNamespaceObjects & {_ns: ns}).objects {
|
||||
let Kind = obj.kind
|
||||
let NS = ns.name
|
||||
let Name = obj.metadata.name
|
||||
"\(Kind)": "\(NS)/\(Name)": obj
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -9,7 +9,7 @@ package holos
|
||||
component: "validate"
|
||||
}
|
||||
|
||||
#DependsOn: Namespaces: name: #InstancePrefix + "-eso"
|
||||
#DependsOn: _ESO
|
||||
|
||||
#KubernetesObjects & {
|
||||
apiObjects: {
|
||||
@@ -133,9 +133,12 @@ This section configured:
|
||||
|
||||
1. Provisioner Cluster to provide secrets to workload clusters.
|
||||
2. IAM service account `eso-creds-refresher` to identify the credential refresher job.
|
||||
3. Workload identity pool to authenticate the `eso-creds-refresher` Kubernetes service account in an external cluster.
|
||||
4. IAM policy to allow `eso-creds-refresher` to authenticate to the Provisioner Cluster.
|
||||
5. RoleBinding to allow `eso-creds-refresher` to create kubernetes service account tokens representing the credentials for use by SecretStore resources in workload clusters.
|
||||
3. Workload identity pool to authenticate the `system:serviceaccount:holos-system:eso-creds-refresher` Kubernetes service account in all clusters that share the workload identity pool.
|
||||
4. IAM policy to allow the `eso-creds-refresher` IAM service account to authenticate to the Provisioner Cluster.
|
||||
5. RoleBinding to allow the `eso-creds-refresher` IAM service account to create kubernetes service account tokens representing the credentials for use by SecretStore resources in workload clusters.
|
||||
|
||||
> [!NOTE]
|
||||
> Any cluster in the workload identity pool can impersonate the eso-creds-refresher IAM service account.
|
||||
|
||||
## Cluster Setup
|
||||
|
||||
@@ -150,6 +153,12 @@ HOLOS_CLUSTER_NAME=west1
|
||||
ISSUER_URL="https://example.com/clusters/${HOLOS_CLUSTER_NAME}"
|
||||
```
|
||||
|
||||
Alternatively:
|
||||
|
||||
```shell
|
||||
ISSUER_URL="$(kubectl get --raw='/.well-known/openid-configuration' | jq -r .issuer)"
|
||||
```
|
||||
|
||||
```shell
|
||||
gcloud iam workload-identity-pools providers create-oidc \
|
||||
k8s-$HOLOS_CLUSTER_NAME \
|
||||
|
||||
@@ -1 +1 @@
|
||||
3
|
||||
4
|
||||
|
||||
Reference in New Issue
Block a user