The following resources are composed to implement the referenced Composite Resource Definition (XRD).
ProviderConfig
Object
Object
Object
Object
Object
kind: Composition
apiVersion: apiextensions.crossplane.io/v1
metadata:
name: app-backend-db-google
creationTimestamp: null
labels:
location: local
type: backend-db-google
spec:
compositeTypeRef:
apiVersion: devopstoolkitseries.com/v1alpha1
kind: App
patchSets:
- name: metadata
patches:
- fromFieldPath: metadata.labels
resources:
- name: kubernetes
base:
apiVersion: kubernetes.crossplane.io/v1alpha1
kind: ProviderConfig
spec:
credentials:
source: InjectedIdentity
patches:
- fromFieldPath: spec.id
toFieldPath: metadata.name
readinessChecks:
- type: None
- name: deployment
base:
apiVersion: kubernetes.crossplane.io/v1alpha1
kind: Object
spec:
forProvider:
manifest:
apiVersion: apps/v1
kind: Deployment
spec:
template:
spec:
containers:
- env:
- name: DB_ENDPOINT
valueFrom:
secretKeyRef:
key: endpoint
- name: DB_PASSWORD
valueFrom:
secretKeyRef:
key: password
- name: DB_PORT
valueFrom:
secretKeyRef:
key: port
optional: true
- name: DB_USERNAME
valueFrom:
secretKeyRef:
key: username
- name: DB_NAME
livenessProbe:
httpGet:
path: /
port: 80
name: backend
ports:
- containerPort: 80
readinessProbe:
httpGet:
path: /
port: 80
resources:
limits:
cpu: 250m
memory: 256Mi
requests:
cpu: 125m
memory: 128Mi
patches:
- fromFieldPath: spec.id
toFieldPath: metadata.name
transforms:
- type: string
string:
fmt: "%s-deployment"
- fromFieldPath: spec.id
toFieldPath: spec.forProvider.manifest.metadata.name
- fromFieldPath: spec.parameters.namespace
toFieldPath: spec.forProvider.manifest.metadata.namespace
- fromFieldPath: spec.id
toFieldPath: spec.forProvider.manifest.metadata.labels.app
- fromFieldPath: spec.id
toFieldPath: spec.forProvider.manifest.spec.selector.matchLabels.app
- fromFieldPath: spec.id
toFieldPath: spec.forProvider.manifest.spec.template.metadata.labels.app
- fromFieldPath: spec.parameters.image
toFieldPath: spec.forProvider.manifest.spec.template.spec.containers[0].image
- fromFieldPath: spec.parameters.port
toFieldPath: spec.forProvider.manifest.spec.template.spec.containers[0].ports[0].containerPort
- fromFieldPath: spec.parameters.port
toFieldPath: spec.forProvider.manifest.spec.template.spec.containers[0].livenessProbe.httpGet.port
- fromFieldPath: spec.parameters.port
toFieldPath: spec.forProvider.manifest.spec.template.spec.containers[0].readinessProbe.httpGet.port
- fromFieldPath: spec.id
toFieldPath: spec.forProvider.manifest.spec.template.spec.containers[0].env[0].valueFrom.secretKeyRef.name
- fromFieldPath: spec.id
toFieldPath: spec.forProvider.manifest.spec.template.spec.containers[0].env[1].valueFrom.secretKeyRef.name
- fromFieldPath: spec.id
toFieldPath: spec.forProvider.manifest.spec.template.spec.containers[0].env[2].valueFrom.secretKeyRef.name
- fromFieldPath: spec.id
toFieldPath: spec.forProvider.manifest.spec.template.spec.containers[0].env[3].valueFrom.secretKeyRef.name
- fromFieldPath: spec.id
toFieldPath: spec.forProvider.manifest.spec.template.spec.containers[0].env[4].value
- fromFieldPath: spec.id
toFieldPath: spec.providerConfigRef.name
readinessChecks:
- type: None
- name: service
base:
apiVersion: kubernetes.crossplane.io/v1alpha1
kind: Object
spec:
forProvider:
manifest:
apiVersion: v1
kind: Service
spec:
ports:
- name: http
port: 80
protocol: TCP
targetPort: 80
type: ClusterIP
patches:
- fromFieldPath: spec.id
toFieldPath: metadata.name
transforms:
- type: string
string:
fmt: "%s-service"
- fromFieldPath: spec.id
toFieldPath: spec.forProvider.manifest.metadata.name
- fromFieldPath: spec.parameters.namespace
toFieldPath: spec.forProvider.manifest.metadata.namespace
- fromFieldPath: spec.id
toFieldPath: spec.forProvider.manifest.metadata.labels.app
- fromFieldPath: spec.id
toFieldPath: spec.forProvider.manifest.spec.selector.app
- fromFieldPath: spec.parameters.port
toFieldPath: spec.forProvider.manifest.spec.ports[0].port
- fromFieldPath: spec.parameters.port
toFieldPath: spec.forProvider.manifest.spec.ports[0].targetPort
- fromFieldPath: spec.id
toFieldPath: spec.providerConfigRef.name
readinessChecks:
- type: None
- name: ingress
base:
apiVersion: kubernetes.crossplane.io/v1alpha1
kind: Object
spec:
forProvider:
manifest:
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
annotations:
ingress.kubernetes.io/ssl-redirect: "false"
spec:
rules:
- host: devopstoolkitseries.com
http:
paths:
- backend:
service:
name: devops-toolkit
port:
number: 80
path: /
pathType: ImplementationSpecific
patches:
- fromFieldPath: spec.id
toFieldPath: metadata.name
transforms:
- type: string
string:
fmt: "%s-ingress"
- fromFieldPath: spec.id
toFieldPath: spec.forProvider.manifest.metadata.name
- fromFieldPath: spec.parameters.namespace
toFieldPath: spec.forProvider.manifest.metadata.namespace
- fromFieldPath: spec.id
toFieldPath: spec.forProvider.manifest.metadata.labels.app
- fromFieldPath: spec.parameters.host
toFieldPath: spec.forProvider.manifest.spec.rules[0].host
- fromFieldPath: spec.id
toFieldPath: spec.forProvider.manifest.spec.rules[0].http.paths[0].backend.service.name
- fromFieldPath: spec.parameters.port
toFieldPath: spec.forProvider.manifest.spec.rules[0].http.paths[0].backend.service.port.number
- fromFieldPath: spec.id
toFieldPath: spec.providerConfigRef.name
- type: ToCompositeFieldPath
fromFieldPath: spec.forProvider.manifest.spec.rules[0].host
toFieldPath: status.host
readinessChecks:
- type: None
- name: sql
base:
apiVersion: kubernetes.crossplane.io/v1alpha1
kind: Object
spec:
forProvider:
manifest:
apiVersion: devopstoolkitseries.com/v1alpha1
kind: SQLClaim
spec:
compositionSelector:
matchLabels:
db: postgresql
provider: google-official
parameters:
version: "13"
patches:
- fromFieldPath: spec.id
toFieldPath: metadata.name
transforms:
- type: string
string:
fmt: "%s-sql"
- fromFieldPath: spec.id
toFieldPath: spec.forProvider.manifest.metadata.labels.app
- fromFieldPath: spec.id
toFieldPath: spec.forProvider.manifest.spec.id
- fromFieldPath: spec.parameters.dbVersion
toFieldPath: spec.forProvider.manifest.spec.parameters.version
- fromFieldPath: spec.parameters.db.version
toFieldPath: spec.forProvider.manifest.spec.parameters.version
- fromFieldPath: spec.parameters.db.type
toFieldPath: spec.forProvider.manifest.spec.parameters.version
- fromFieldPath: spec.id
toFieldPath: spec.providerConfigRef.name
- fromFieldPath: spec.parameters.namespace
toFieldPath: spec.forProvider.manifest.metadata.namespace
- name: sql-secret
base:
apiVersion: kubernetes.crossplane.io/v1alpha1
kind: Object
spec:
forProvider:
manifest:
apiVersion: external-secrets.io/v1beta1
kind: ExternalSecret
spec:
dataFrom:
- extract:
key: production-postgresql
refreshInterval: 5m
secretStoreRef:
kind: ClusterSecretStore
name: google
target:
creationPolicy: Owner
patches:
- fromFieldPath: spec.id
toFieldPath: metadata.name
transforms:
- type: string
string:
fmt: "%s-password"
- fromFieldPath: spec.id
toFieldPath: spec.forProvider.manifest.spec.target.name
transforms:
- type: string
string:
fmt: "%s-password"
- fromFieldPath: spec.id
toFieldPath: spec.forProvider.manifest.metadata.name
- fromFieldPath: spec.parameters.namespace
toFieldPath: spec.forProvider.manifest.metadata.namespace
- fromFieldPath: spec.id
toFieldPath: spec.forProvider.manifest.metadata.labels.app
- fromFieldPath: spec.id
toFieldPath: spec.providerConfigRef.name
© 2022 Upbound, Inc.
Discover the building blocksfor your internal cloud platform.