Skip to content

Commit

Permalink
quickstart: update quickstart to use hidden fields
Browse files Browse the repository at this point in the history
_Platform, _Organization, _Fleets, _Istio, _ArgoConfig, _Namespaces,
_ArgoCD, _ReferenceGrant, _BankOfHolos, _CertManager, _ExternalSecrets

_Helm, _Kubernetes, _Kustomize

This patch also uses the v1alpha4 platform generated from holos version
0.97.2-3-g7863a07
  • Loading branch information
jeffmccune committed Oct 31, 2024
1 parent 80573ba commit 900a455
Show file tree
Hide file tree
Showing 117 changed files with 265 additions and 223 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ package v1alpha4
// Model represents the platform model holos gets from from the
// PlatformService.GetPlatform rpc method and provides to CUE using a tag.
// Injected as the tag "holos_model".
model: {...} @go(Model,map[string]any)
model?: {...} @go(Model,map[string]any)

// Tags represents cue @tag variables injected into the holos render component
// command from the holos render platform command. Tags with a "holos_"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,18 +59,33 @@ import (
artifact: "\(_path)/\(Name).gen.yaml"
let ResourcesOutput = "resources.gen.yaml"
let IntermediateOutput = "combined.gen.yaml"
generators: [{
kind: "Resources"
output: ResourcesOutput
resources: Resources
}]
generators: [
{
kind: "Resources"
output: ResourcesOutput
resources: Resources
},
for x in KustomizeConfig.Files {
kind: "File"
output: x.Source
file: source: x.Source
},
for x in KustomizeConfig.Resources {
kind: "File"
output: x.Source
file: source: x.Source
},
]
transformers: [
core.#Transformer & {
kind: "Kustomize"
inputs: [ResourcesOutput]
inputs: [for x in generators {x.output}]
output: IntermediateOutput
kustomize: kustomization: KustomizeConfig.Kustomization & {
resources: inputs
resources: [
ResourcesOutput,
for x in KustomizeConfig.Resources {x.Source},
]
}
},
_Transformer & {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ spec:
server: https://kubernetes.default.svc
project: platform
source:
path: deploy/clusters/workload/components/app-projects
path: deploy/clusters/local/components/app-projects
repoURL: https://github.com/holos-run/bank-of-holos
targetRevision: main
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ spec:
server: https://kubernetes.default.svc
project: platform
source:
path: deploy/clusters/workload/components/argocd-crds
path: deploy/clusters/local/components/argocd-crds
repoURL: https://github.com/holos-run/bank-of-holos
targetRevision: main
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ spec:
server: https://kubernetes.default.svc
project: platform
source:
path: deploy/clusters/workload/components/argocd
path: deploy/clusters/local/components/argocd
repoURL: https://github.com/holos-run/bank-of-holos
targetRevision: main
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ spec:
server: https://kubernetes.default.svc
project: bank-backend
source:
path: deploy/clusters/workload/components/bank-accounts-db
path: deploy/clusters/local/components/bank-accounts-db
repoURL: https://github.com/holos-run/bank-of-holos
targetRevision: main
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ spec:
server: https://kubernetes.default.svc
project: bank-backend
source:
path: deploy/clusters/workload/components/bank-backend-config
path: deploy/clusters/local/components/bank-backend-config
repoURL: https://github.com/holos-run/bank-of-holos
targetRevision: main
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ spec:
server: https://kubernetes.default.svc
project: bank-backend
source:
path: deploy/clusters/workload/components/bank-balance-reader
path: deploy/clusters/local/components/bank-balance-reader
repoURL: https://github.com/holos-run/bank-of-holos
targetRevision: main
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ spec:
server: https://kubernetes.default.svc
project: bank-backend
source:
path: deploy/clusters/workload/components/bank-contacts
path: deploy/clusters/local/components/bank-contacts
repoURL: https://github.com/holos-run/bank-of-holos
targetRevision: main
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ spec:
server: https://kubernetes.default.svc
project: bank-frontend
source:
path: deploy/clusters/workload/components/bank-frontend
path: deploy/clusters/local/components/bank-frontend
repoURL: https://github.com/holos-run/bank-of-holos
targetRevision: main
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ spec:
server: https://kubernetes.default.svc
project: bank-backend
source:
path: deploy/clusters/workload/components/bank-ledger-db
path: deploy/clusters/local/components/bank-ledger-db
repoURL: https://github.com/holos-run/bank-of-holos
targetRevision: main
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ spec:
server: https://kubernetes.default.svc
project: bank-backend
source:
path: deploy/clusters/workload/components/bank-ledger-writer
path: deploy/clusters/local/components/bank-ledger-writer
repoURL: https://github.com/holos-run/bank-of-holos
targetRevision: main
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ spec:
server: https://kubernetes.default.svc
project: bank-security
source:
path: deploy/clusters/workload/components/bank-secrets
path: deploy/clusters/local/components/bank-secrets
repoURL: https://github.com/holos-run/bank-of-holos
targetRevision: main
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ spec:
server: https://kubernetes.default.svc
project: bank-backend
source:
path: deploy/clusters/workload/components/bank-transaction-history
path: deploy/clusters/local/components/bank-transaction-history
repoURL: https://github.com/holos-run/bank-of-holos
targetRevision: main
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ spec:
server: https://kubernetes.default.svc
project: bank-backend
source:
path: deploy/clusters/workload/components/bank-userservice
path: deploy/clusters/local/components/bank-userservice
repoURL: https://github.com/holos-run/bank-of-holos
targetRevision: main
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ spec:
server: https://kubernetes.default.svc
project: platform
source:
path: deploy/clusters/workload/components/cert-manager
path: deploy/clusters/local/components/cert-manager
repoURL: https://github.com/holos-run/bank-of-holos
targetRevision: main
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ spec:
server: https://kubernetes.default.svc
project: platform
source:
path: deploy/clusters/workload/components/external-secrets-crds
path: deploy/clusters/local/components/external-secrets-crds
repoURL: https://github.com/holos-run/bank-of-holos
targetRevision: main
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ spec:
server: https://kubernetes.default.svc
project: platform
source:
path: deploy/clusters/workload/components/external-secrets
path: deploy/clusters/local/components/external-secrets
repoURL: https://github.com/holos-run/bank-of-holos
targetRevision: main
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ spec:
server: https://kubernetes.default.svc
project: platform
source:
path: deploy/clusters/workload/components/gateway-api
path: deploy/clusters/local/components/gateway-api
repoURL: https://github.com/holos-run/bank-of-holos
targetRevision: main
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ spec:
server: https://kubernetes.default.svc
project: platform
source:
path: deploy/clusters/workload/components/httproutes
path: deploy/clusters/local/components/httproutes
repoURL: https://github.com/holos-run/bank-of-holos
targetRevision: main
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ spec:
server: https://kubernetes.default.svc
project: platform
source:
path: deploy/clusters/workload/components/istio-base
path: deploy/clusters/local/components/istio-base
repoURL: https://github.com/holos-run/bank-of-holos
targetRevision: main
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ spec:
server: https://kubernetes.default.svc
project: platform
source:
path: deploy/clusters/workload/components/istio-cni
path: deploy/clusters/local/components/istio-cni
repoURL: https://github.com/holos-run/bank-of-holos
targetRevision: main
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ spec:
server: https://kubernetes.default.svc
project: platform
source:
path: deploy/clusters/workload/components/istio-gateway
path: deploy/clusters/local/components/istio-gateway
repoURL: https://github.com/holos-run/bank-of-holos
targetRevision: main
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ spec:
server: https://kubernetes.default.svc
project: platform
source:
path: deploy/clusters/workload/components/istio-ztunnel
path: deploy/clusters/local/components/istio-ztunnel
repoURL: https://github.com/holos-run/bank-of-holos
targetRevision: main
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ spec:
server: https://kubernetes.default.svc
project: platform
source:
path: deploy/clusters/workload/components/istiod
path: deploy/clusters/local/components/istiod
repoURL: https://github.com/holos-run/bank-of-holos
targetRevision: main
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ spec:
server: https://kubernetes.default.svc
project: platform
source:
path: deploy/clusters/workload/components/local-ca
path: deploy/clusters/local/components/local-ca
repoURL: https://github.com/holos-run/bank-of-holos
targetRevision: main
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ spec:
server: https://kubernetes.default.svc
project: platform
source:
path: deploy/clusters/workload/components/namespaces
path: deploy/clusters/local/components/namespaces
repoURL: https://github.com/holos-run/bank-of-holos
targetRevision: main
2 changes: 1 addition & 1 deletion examples/environments/projects/app-projects.cue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import ap "argoproj.io/appproject/v1alpha1"
#AppProject: ap.#AppProject & {
metadata: name: string
metadata: namespace: _ArgoCD.Namespace
spec: description: string | *"Holos managed AppProject for \(#Organization.DisplayName)"
spec: description: string | *"Holos managed AppProject for \(_Organization.DisplayName)"
spec: clusterResourceWhitelist: [{group: "*", kind: "*"}]
spec: destinations: [{namespace: "*", server: "*"}]
spec: sourceRepos: ["*"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ _Kubernetes: #Kubernetes & {
containers: [{
env: [{
name: "BANK_NAME"
value: #Organization.DisplayName
value: _Organization.DisplayName
}, {
name: "ENV_PLATFORM"
value: "local"
Expand Down
10 changes: 5 additions & 5 deletions examples/environments/projects/bank-of-holos/v2/stack.cue
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ _Stack: {
}

// Annotate with stack version
Resources: [_]: [_]: metadata: annotations: "stack.\(#Organization.Domain)/version": Tags.stack_version
Resources: [_]: [_]: metadata: annotations: "stack.\(_Organization.Domain)/version": Tags.stack_version

// Resources to make available in each of the namespaces.
Resources: {
Expand Down Expand Up @@ -149,10 +149,10 @@ _Stack: {
}

CommonLabels: {
"environment.\(#Organization.Domain)/name": Tags.environment
"owner.\(#Organization.Domain)/name": Tags.owner
"stack.\(#Organization.Domain)/name": BankName
"stack.\(#Organization.Domain)/tier": Tags.tier
"environment.\(_Organization.Domain)/name": Tags.environment
"owner.\(_Organization.Domain)/name": Tags.owner
"stack.\(_Organization.Domain)/name": BankName
"stack.\(_Organization.Domain)/tier": Tags.tier

// These are the common labels from upstream
application: BankName
Expand Down
8 changes: 8 additions & 0 deletions fleets.cue
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package holos

import api "github.com/holos-run/holos/api/author/v1alpha4"

// Manage a workload cluster named local for use with the guides.
_Fleets: api.#StandardFleets & {
workload: clusters: local: _
}
4 changes: 2 additions & 2 deletions platform/app-projects.cue
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package holos

// Manage the Component on every Cluster in the Platform
for Fleet in #Fleets {
for Fleet in _Fleets {
for Cluster in Fleet.clusters {
#Platform: Components: "\(Cluster.name):app-projects": {
_Platform: Components: "\(Cluster.name):app-projects": {
name: "app-projects"
component: "projects/platform/components/app-projects"
cluster: Cluster.name
Expand Down
6 changes: 3 additions & 3 deletions platform/argocd.cue
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
package holos

// Manage the Component on every Cluster in the Platform
for Fleet in #Fleets {
for Fleet in _Fleets {
for Cluster in Fleet.clusters {
#Platform: Components: "\(Cluster.name):argocd-crds": {
_Platform: Components: "\(Cluster.name):argocd-crds": {
name: "argocd-crds"
component: "projects/platform/components/argocd/crds"
cluster: Cluster.name
}
#Platform: Components: "\(Cluster.name):argocd": {
_Platform: Components: "\(Cluster.name):argocd": {
name: "argocd"
component: "projects/platform/components/argocd/argocd"
cluster: Cluster.name
Expand Down
4 changes: 2 additions & 2 deletions platform/bank-of-holos.cue
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ let COMPONENTS = {
}

// Manage on workload clusters only
for Cluster in #Fleets.workload.clusters {
for Cluster in _Fleets.workload.clusters {
for Component in COMPONENTS {
#Platform: Components: "\(Cluster.name):\(Component.name)": {
_Platform: Components: "\(Cluster.name):\(Component.name)": {
name: Component.name
component: "projects/bank-of-holos/\(Component.owner)/components/\(Component.name)"
cluster: Cluster.name
Expand Down
4 changes: 2 additions & 2 deletions platform/cert-manager.cue
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package holos

// Manage the component on every cluster in the platform
for Fleet in #Fleets {
for Fleet in _Fleets {
for Cluster in Fleet.clusters {
#Platform: Components: "\(Cluster.name):cert-manager": {
_Platform: Components: "\(Cluster.name):cert-manager": {
name: "cert-manager"
component: "projects/platform/components/cert-manager"
cluster: Cluster.name
Expand Down
6 changes: 3 additions & 3 deletions platform/external-secrets.cue
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
package holos

// Manage the component on every cluster in the platform
for Fleet in #Fleets {
for Fleet in _Fleets {
for Cluster in Fleet.clusters {
#Platform: Components: "\(Cluster.name):external-secrets-crds": {
_Platform: Components: "\(Cluster.name):external-secrets-crds": {
name: "external-secrets-crds"
component: "projects/platform/components/external-secrets-crds"
cluster: Cluster.name
}
#Platform: Components: "\(Cluster.name):external-secrets": {
_Platform: Components: "\(Cluster.name):external-secrets": {
name: "external-secrets"
component: "projects/platform/components/external-secrets"
cluster: Cluster.name
Expand Down
4 changes: 0 additions & 4 deletions platform/fleets.cue

This file was deleted.

4 changes: 2 additions & 2 deletions platform/gateway-api.cue
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package holos

// Manage on every Cluster in the Platform
for Fleet in #Fleets {
for Fleet in _Fleets {
for Cluster in Fleet.clusters {
#Platform: Components: "\(Cluster.name):gateway-api": {
_Platform: Components: "\(Cluster.name):gateway-api": {
name: "gateway-api"
component: "projects/platform/components/gateway-api"
cluster: Cluster.name
Expand Down
Loading

0 comments on commit 900a455

Please sign in to comment.