Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: upload samples #23

Merged
merged 1 commit into from
Jun 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 1 addition & 20 deletions chart/.helmignore
Original file line number Diff line number Diff line change
@@ -1,23 +1,4 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
samples/
28 changes: 28 additions & 0 deletions chart/samples/api.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Backend API Calls - Examples

## Get a Widget

### Calling an External API

```sh
kubectl get widget.templates.krateo.io/external-api \
--kubeconfig=$PWD/cyberjoker.json \
-n demo-system -o yaml
```

### Calling an Internal API

```sh
kubectl get widget.templates.krateo.io/internal-api \
--kubeconfig=$PWD/cyberjoker.json \
-n demo-system -o yaml
```

## Get a Form

```sh
kubectl get form.templates.krateo.io/fireworksapp \
--kubeconfig=$PWD/cyberjoker.json \
-n demo-system -o yaml
```

5 changes: 5 additions & 0 deletions chart/samples/compositiondefinition.patch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
status:
apiVersion: composition.krateo.io/v0-1-0
kind: FireworksApp
packageUrl: "hello world"

10 changes: 10 additions & 0 deletions chart/samples/compositiondefinition.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: core.krateo.io/v1alpha1
kind: CompositionDefinition
metadata:
annotations:
"krateo.io/connector-verbose": "true"
name: fireworksapp
namespace: demo-system
spec:
chart:
url: https://github.com/krateoplatformops/krateo-v2-template-fireworksapp/releases/download/0.1.0/fireworks-app-0.1.0.tgz
187 changes: 187 additions & 0 deletions chart/samples/core.krateo.io_compositiondefinitions.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,187 @@
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.14.0
name: compositiondefinitions.core.krateo.io
spec:
group: core.krateo.io
names:
categories:
- krateo
- defs
- core
kind: CompositionDefinition
listKind: CompositionDefinitionList
plural: compositiondefinitions
singular: compositiondefinition
scope: Namespaced
versions:
- additionalPrinterColumns:
- jsonPath: .status.conditions[?(@.type=='Ready')].status
name: READY
type: string
- jsonPath: .metadata.creationTimestamp
name: AGE
type: date
- jsonPath: .status.apiVersion
name: API VERSION
priority: 10
type: string
- jsonPath: .status.kind
name: KIND
priority: 10
type: string
- jsonPath: .status.packageUrl
name: PACKAGE URL
priority: 10
type: string
name: v1alpha1
schema:
openAPIV3Schema:
description: CompositionDefinition is a definition type with a spec and a
status.
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/sig-architecture/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/sig-architecture/api-conventions.md#types-kinds
type: string
metadata:
type: object
spec:
properties:
chart:
properties:
credentials:
description: 'Credentials: credentials for private repos'
properties:
passwordRef:
description: A SecretKeySelector is a reference to a secret
key in an arbitrary namespace.
properties:
key:
description: The key to select.
type: string
name:
description: Name of the referenced object.
type: string
namespace:
description: Namespace of the referenced object.
type: string
required:
- key
- name
- namespace
type: object
username:
type: string
required:
- passwordRef
- username
type: object
repo:
description: 'Repo: helm repo name (for helm repo urls only)'
maxLength: 256
type: string
x-kubernetes-validations:
- message: Repo is immutable
rule: self == oldSelf
url:
description: 'Url: oci or tgz full url'
type: string
version:
description: 'Version: desired chart version'
maxLength: 20
type: string
x-kubernetes-validations:
- message: Version is immutable
rule: self == oldSelf
required:
- url
type: object
x-kubernetes-validations:
- message: Version is required once set
rule: '!has(oldSelf.version) || has(self.version)'
- message: Repo is required once set
rule: '!has(oldSelf.repo) || has(self.repo)'
deletionPolicy:
default: Delete
description: |-
DeletionPolicy specifies what will happen to the underlying external
when this managed resource is deleted - either "Delete" or "Orphan" the
external resource.
enum:
- Orphan
- Delete
type: string
type: object
status:
description: CompositionDefinitionStatus is the status of a CompositionDefinition.
properties:
apiVersion:
description: 'APIVersion: the generated custom resource API version'
type: string
conditions:
description: Conditions of the resource.
items:
description: A Condition that may apply to a resource.
properties:
lastTransitionTime:
description: |-
LastTransitionTime is the last time this condition transitioned from one
status to another.
format: date-time
type: string
message:
description: |-
A Message containing details about this condition's last transition from
one status to another, if any.
type: string
reason:
description: A Reason for this condition's last transition from
one status to another.
type: string
status:
description: Status of this condition; is it currently True,
False, or Unknown?
type: string
type:
description: |-
Type of this condition. At most one of each condition type may apply to
a resource at any point in time.
type: string
required:
- lastTransitionTime
- reason
- status
- type
type: object
type: array
error:
description: 'Error: error messages - actually only used if an error
occurred during role and clusterrole creation'
type: string
kind:
description: 'Kind: the generated custom resource Kind'
type: string
packageUrl:
description: 'PackageURL: .tgz or oci chart direct url'
type: string
type: object
type: object
served: true
storage: true
subresources:
status: {}
10 changes: 10 additions & 0 deletions chart/samples/endpoint.sample.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
apiVersion: v1
kind: Secret
type: Opaque
metadata:
name: typicode-endpoint
namespace: demo-system
stringData:
server-url: https://jsonplaceholder.typicode.com
---
13 changes: 13 additions & 0 deletions chart/samples/form.sample.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
apiVersion: templates.krateo.io/v1alpha1
kind: Form
metadata:
name: fireworksapp
namespace: demo-system
spec:
# schemaDefinitionRef:
# name: fireworksapp
# namespace: demo-system
compositionDefinitionRef:
name: fireworksapp
namespace: demo-system
28 changes: 28 additions & 0 deletions chart/samples/rbac.composition.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: compositions-viewer
namespace: demo-system
rules:
- apiGroups:
- composition.krateo.io
resources:
- '*'
verbs:
- get
- list
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: compositions-viewer
namespace: demo-system
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: compositions-viewer
subjects:
- kind: Group
name: devs
apiGroup: rbac.authorization.k8s.io
28 changes: 28 additions & 0 deletions chart/samples/rbac.compositiondefinitions.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: compositiondefinitions-viewer
namespace: demo-system
rules:
- apiGroups:
- core.krateo.io
resources:
- compositiondefinitions
verbs:
- get
- list
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: compositiondefinitions-viewer
namespace: demo-system
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: compositiondefinitions-viewer
subjects:
- kind: Group
name: devs
apiGroup: rbac.authorization.k8s.io
26 changes: 26 additions & 0 deletions chart/samples/rbac.crds.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: crds-viewer
rules:
- apiGroups:
- apiextensions.k8s.io
resources:
- customresourcedefinitions
verbs:
- get
- list
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: crds-viewer
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: crds-viewer
subjects:
- kind: Group
name: devs
apiGroup: rbac.authorization.k8s.io
Loading
Loading