forked from crossplane/crossplane
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request crossplane#399 from negz/lafarge
Proposed design and API resources for Complex Workloads
- Loading branch information
Showing
24 changed files
with
2,193 additions
and
0 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
105 changes: 105 additions & 0 deletions
105
cluster/charts/crossplane/crds/workload/v1alpha1/kubernetesapplication.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
apiVersion: apiextensions.k8s.io/v1beta1 | ||
kind: CustomResourceDefinition | ||
metadata: | ||
creationTimestamp: null | ||
labels: | ||
controller-tools.k8s.io: "1.0" | ||
name: kubernetesapplications.workload.crossplane.io | ||
spec: | ||
additionalPrinterColumns: | ||
- JSONPath: .status.clusterRef.name | ||
name: CLUSTER | ||
type: string | ||
- JSONPath: .status.state | ||
name: STATUS | ||
type: string | ||
- JSONPath: .status.desiredResources | ||
name: DESIRED | ||
type: integer | ||
- JSONPath: .status.submittedResources | ||
name: SUBMITTED | ||
type: integer | ||
group: workload.crossplane.io | ||
names: | ||
kind: KubernetesApplication | ||
plural: kubernetesapplications | ||
scope: Namespaced | ||
validation: | ||
openAPIV3Schema: | ||
properties: | ||
apiVersion: | ||
description: 'APIVersion defines the versioned schema of this representation | ||
of an object. Servers should convert recognized schemas to the latest | ||
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources' | ||
type: string | ||
kind: | ||
description: 'Kind is a string value representing the REST resource this | ||
object represents. Servers may infer this from the endpoint the client | ||
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' | ||
type: string | ||
metadata: | ||
type: object | ||
spec: | ||
properties: | ||
clusterSelector: | ||
description: ClusterSelector selects the clusters to which this application | ||
may be scheduled. | ||
type: object | ||
resourceTemplates: | ||
description: ResourceTemplates specifies a set of Kubernetes application | ||
resources managed by this application. | ||
items: | ||
properties: | ||
metadata: | ||
type: object | ||
spec: | ||
properties: | ||
secrets: | ||
description: Secrets upon which this application resource | ||
depends. These secrets will be propagated to the Kubernetes | ||
cluster to which this application is scheduled. | ||
items: | ||
type: object | ||
type: array | ||
template: | ||
description: A Template for a Kubernetes resource to be submitted | ||
to the KubernetesCluster to which this application resource | ||
is scheduled. The resource must be understood by the KubernetesCluster. | ||
Crossplane requires only that the resource contains standard | ||
Kubernetes type and object metadata. | ||
type: object | ||
required: | ||
- template | ||
type: object | ||
type: object | ||
type: array | ||
required: | ||
- resourceTemplates | ||
type: object | ||
status: | ||
properties: | ||
clusterRef: | ||
description: Cluster to which this application has been scheduled. | ||
type: object | ||
desiredResources: | ||
description: Desired resources of this application, i.e. the number | ||
of resources that match this application's resource selector. | ||
format: int64 | ||
type: integer | ||
state: | ||
description: State of the application. | ||
type: string | ||
submittedResources: | ||
description: Submitted resources of this workload, i.e. the subset of | ||
desired resources that have been successfully submitted to their scheduled | ||
Kubernetes cluster. | ||
format: int64 | ||
type: integer | ||
type: object | ||
version: v1alpha1 | ||
status: | ||
acceptedNames: | ||
kind: "" | ||
plural: "" | ||
conditions: [] | ||
storedVersions: [] |
80 changes: 80 additions & 0 deletions
80
cluster/charts/crossplane/crds/workload/v1alpha1/kubernetesapplicationresource.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
apiVersion: apiextensions.k8s.io/v1beta1 | ||
kind: CustomResourceDefinition | ||
metadata: | ||
creationTimestamp: null | ||
labels: | ||
controller-tools.k8s.io: "1.0" | ||
name: kubernetesapplicationresources.workload.crossplane.io | ||
spec: | ||
additionalPrinterColumns: | ||
- JSONPath: .spec.template.kind | ||
name: TEMPLATE-KIND | ||
type: string | ||
- JSONPath: .spec.template.metadata.name | ||
name: TEMPLATE-NAME | ||
type: string | ||
- JSONPath: .status.clusterRef.name | ||
name: CLUSTER | ||
type: string | ||
- JSONPath: .status.state | ||
name: STATUS | ||
type: string | ||
group: workload.crossplane.io | ||
names: | ||
kind: KubernetesApplicationResource | ||
plural: kubernetesapplicationresources | ||
scope: Namespaced | ||
validation: | ||
openAPIV3Schema: | ||
properties: | ||
apiVersion: | ||
description: 'APIVersion defines the versioned schema of this representation | ||
of an object. Servers should convert recognized schemas to the latest | ||
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources' | ||
type: string | ||
kind: | ||
description: 'Kind is a string value representing the REST resource this | ||
object represents. Servers may infer this from the endpoint the client | ||
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' | ||
type: string | ||
metadata: | ||
type: object | ||
spec: | ||
properties: | ||
secrets: | ||
description: Secrets upon which this application resource depends. These | ||
secrets will be propagated to the Kubernetes cluster to which this | ||
application is scheduled. | ||
items: | ||
type: object | ||
type: array | ||
template: | ||
description: A Template for a Kubernetes resource to be submitted to | ||
the KubernetesCluster to which this application resource is scheduled. | ||
The resource must be understood by the KubernetesCluster. Crossplane | ||
requires only that the resource contains standard Kubernetes type | ||
and object metadata. | ||
type: object | ||
required: | ||
- template | ||
type: object | ||
status: | ||
properties: | ||
clusterRef: | ||
description: Cluster to which this application has been scheduled. | ||
type: object | ||
remote: | ||
description: Remote status of the resource templated by this application | ||
resource. | ||
type: object | ||
state: | ||
description: State of the application. | ||
type: string | ||
type: object | ||
version: v1alpha1 | ||
status: | ||
acceptedNames: | ||
kind: "" | ||
plural: "" | ||
conditions: [] | ||
storedVersions: [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
113 changes: 113 additions & 0 deletions
113
cluster/examples/workloads/kubernetes/wordpress-gcp/app.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
apiVersion: compute.crossplane.io/v1alpha1 | ||
kind: KubernetesCluster | ||
metadata: | ||
name: wordpress-demo-cluster | ||
namespace: complex | ||
labels: | ||
app: wordpress-demo | ||
spec: | ||
classReference: | ||
name: standard-cluster | ||
namespace: crossplane-system | ||
--- | ||
apiVersion: storage.crossplane.io/v1alpha1 | ||
kind: MySQLInstance | ||
metadata: | ||
name: sql | ||
namespace: complex | ||
spec: | ||
classReference: | ||
name: standard-mysql | ||
namespace: crossplane-system | ||
engineVersion: "5.7" | ||
--- | ||
apiVersion: workload.crossplane.io/v1alpha1 | ||
kind: KubernetesApplication | ||
metadata: | ||
name: wordpress-demo | ||
namespace: complex | ||
labels: | ||
app: wordpress-demo | ||
spec: | ||
clusterSelector: | ||
matchLabels: | ||
app: wordpress-demo | ||
resourceTemplates: | ||
- metadata: | ||
name: wordpress-demo-namespace | ||
labels: | ||
app: wordpress-demo | ||
spec: | ||
template: | ||
apiVersion: v1 | ||
kind: Namespace | ||
metadata: | ||
name: wordpress | ||
labels: | ||
app: wordpress | ||
- metadata: | ||
name: wordpress-demo-deployment | ||
labels: | ||
app: wordpress-demo | ||
spec: | ||
secrets: | ||
- name: sql # Resource claim secret name is derived from claim name | ||
template: | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
namespace: wordpress | ||
name: wordpress | ||
labels: | ||
app: wordpress | ||
morelabels: arebetter | ||
spec: | ||
selector: | ||
matchLabels: | ||
app: wordpress | ||
template: | ||
metadata: | ||
labels: | ||
app: wordpress | ||
spec: | ||
containers: | ||
- name: wordpress | ||
image: wordpress:4.6.1-apache | ||
env: | ||
- name: WORDPRESS_DB_HOST | ||
valueFrom: | ||
secretKeyRef: | ||
name: wordpress-demo-deployment-sql | ||
key: endpoint | ||
- name: WORDPRESS_DB_USER | ||
valueFrom: | ||
secretKeyRef: | ||
name: wordpress-demo-deployment-sql | ||
key: username | ||
- name: WORDPRESS_DB_PASSWORD | ||
valueFrom: | ||
secretKeyRef: | ||
name: wordpress-demo-deployment-sql | ||
key: password | ||
ports: | ||
- containerPort: 80 | ||
name: wordpress | ||
- metadata: | ||
name: wordpress-demo-service | ||
labels: | ||
app: wordpress-demo | ||
spec: | ||
template: | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
namespace: wordpress | ||
name: wordpress | ||
labels: | ||
app: wordpress | ||
spec: | ||
ports: | ||
- port: 80 | ||
selector: | ||
app: wordpress | ||
type: LoadBalancer |
Oops, something went wrong.