build(core): fix build & deploy scripts / manifests (#483)

Signed-off-by: maslow <wangfugen@126.com>
This commit is contained in:
Maslow 2022-12-06 00:46:36 +08:00 committed by GitHub
parent c1c4a98417
commit f0a857718e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
28 changed files with 155 additions and 1678 deletions

View File

@ -19,7 +19,7 @@ jobs:
strategy:
max-parallel: 2
matrix:
module: [application, database, gateway, oss]
module: [application, database, gateway, oss, instance]
steps:
- name: Checkout
uses: actions/checkout@v3

View File

@ -13,22 +13,4 @@ resources:
kind: Application
path: github.com/labring/laf/core/controllers/application/api/v1
version: v1
- api:
crdVersion: v1
namespaced: true
controller: true
domain: laf.dev
group: application
kind: Bundle
path: github.com/labring/laf/core/controllers/application/api/v1
version: v1
- api:
crdVersion: v1
namespaced: true
controller: true
domain: laf.dev
group: application
kind: CreationForm
path: github.com/labring/laf/core/controllers/application/api/v1
version: v1
version: "3"

View File

@ -40,38 +40,8 @@ spec:
maxLength: 24
minLength: 3
type: string
bundleName:
description: Bundle Name for the application
type: string
region:
description: Region
maxLength: 24
minLength: 3
type: string
runtimeName:
description: Runtime Name of the application
type: string
state:
default: Running
description: State of the application
enum:
- Running
- Stopped
type: string
required:
- appid
- bundleName
- region
- runtimeName
type: object
status:
description: ApplicationStatus defines the observed state of Application
properties:
bundleName:
description: Bundle Name for the application
type: string
bundleSpec:
description: BundleSpec of the application
bundle:
description: Bundle of the application
properties:
databaseCapacity:
anyOf:
@ -118,14 +88,6 @@ spec:
description: Network Traffic Outbound for the bundle
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
priority:
description: Priority for the bundle. The default value is 0,
which means that the bundle is not currently available for creating
new applications.
format: int32
maximum: 1000
minimum: 0
type: integer
requestCPU:
anyOf:
- type: integer
@ -153,11 +115,30 @@ spec:
- limitCPU
- limitMemory
- networkTrafficOutbound
- priority
- requestCPU
- requestMemory
- storageCapacity
type: object
region:
description: Region
maxLength: 24
minLength: 3
type: string
state:
default: Running
description: State of the application
enum:
- Running
- Stopped
type: string
required:
- appid
- bundle
- region
type: object
status:
description: ApplicationStatus defines the observed state of Application
properties:
conditions:
description: 'Conditions:'
items:
@ -227,73 +208,9 @@ spec:
- type
type: object
type: array
runtimeName:
description: Runtime Name for the application
type: string
runtimeSpec:
description: RuntimeSpec of the application
properties:
deprecated:
description: Deprecated
type: boolean
image:
description: Images of the runtime
properties:
init:
description: Init image (e.g. docker.io/lafyun/app-service-init:latest)
- install the dependencies (e.g. npm install) - prepare
the functions (deploy & compile)
type: string
main:
description: Main image (e.g. docker.io/lafyun/app-service:latest)
type: string
sidecar:
description: Sidecar image
type: string
required:
- main
type: object
type:
description: Type of the runtime. eg. node:laf, node:tcb, go:laf,
python:laf, php:laf, etc.
type: string
version:
description: Version of the runtime
properties:
autoUpgradeFrom:
description: Versions that should auto upgrade from
items:
type: string
type: array
breakBefore:
description: Version that is breaking from
type: string
mustUpgradeFrom:
description: Versions that must upgrade from
items:
type: string
type: array
upgradeFrom:
description: Versions that suggested to upgrade from
items:
type: string
type: array
version:
description: Version is the version of the runtime
type: string
type: object
required:
- image
- type
- version
type: object
state:
description: State of the application
type: string
required:
- bundleName
- bundleSpec
- runtimeName
type: object
type: object
served: true

View File

@ -1,130 +0,0 @@
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.9.0
creationTimestamp: null
name: bundles.application.laf.dev
spec:
group: application.laf.dev
names:
kind: Bundle
listKind: BundleList
plural: bundles
singular: bundle
scope: Namespaced
versions:
- name: v1
schema:
openAPIV3Schema:
description: Bundle is the Schema for the bundles API
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:
description: BundleSpec defines the desired state of Bundle
properties:
databaseCapacity:
anyOf:
- type: integer
- type: string
description: Database capacity for the bundle
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
displayName:
description: DisplayName for the bundle
type: string
limitCPU:
anyOf:
- type: integer
- type: string
description: Limit CPU for the bundle
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
limitMemory:
anyOf:
- type: integer
- type: string
description: Limit Memory for the bundle
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
networkBandwidthInbound:
anyOf:
- type: integer
- type: string
description: Network Bandwidth Inbound for the bundle
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
networkBandwidthOutbound:
anyOf:
- type: integer
- type: string
description: Network Bandwidth Outbound for the bundle
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
networkTrafficOutbound:
anyOf:
- type: integer
- type: string
description: Network Traffic Outbound for the bundle
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
priority:
description: Priority for the bundle. The default value is 0, which
means that the bundle is not currently available for creating new
applications.
format: int32
maximum: 1000
minimum: 0
type: integer
requestCPU:
anyOf:
- type: integer
- type: string
description: Request CPU for the bundle
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
requestMemory:
anyOf:
- type: integer
- type: string
description: Request Memory for the bundle
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
storageCapacity:
anyOf:
- type: integer
- type: string
description: Storage capacity for the bundle
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
required:
- databaseCapacity
- displayName
- limitCPU
- limitMemory
- networkTrafficOutbound
- priority
- requestCPU
- requestMemory
- storageCapacity
type: object
status:
description: BundleStatus defines the observed state of Bundle
type: object
type: object
served: true
storage: true
subresources:
status: {}

View File

@ -1,144 +0,0 @@
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.9.0
creationTimestamp: null
name: creationforms.application.laf.dev
spec:
group: application.laf.dev
names:
kind: CreationForm
listKind: CreationFormList
plural: creationforms
singular: creationform
scope: Namespaced
versions:
- name: v1
schema:
openAPIV3Schema:
description: CreationForm is the Schema for the creationforms API
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:
description: CreationFormSpec defines the desired state of CreationForm
properties:
bundleName:
description: Bundle Name for the application
type: string
displayName:
description: DisplayName for the application
maxLength: 63
minLength: 3
type: string
region:
description: Region
maxLength: 24
minLength: 3
type: string
runtimeName:
description: RuntimeSpec Name of the application
type: string
required:
- bundleName
- displayName
- region
- runtimeName
type: object
status:
description: CreationFormStatus defines the observed state of CreationForm
properties:
appid:
type: string
conditions:
description: 'Conditions - Type: Validated - Type: ValidRuntime -
Type: ValidBundle - Type: Created'
items:
description: "Condition contains details for one aspect of the current
state of this API Resource. --- This struct is intended for direct
use as an array at the field path .status.conditions. For example,
\n type FooStatus struct{ // Represents the observations of a
foo's current state. // Known .status.conditions.type are: \"Available\",
\"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge
// +listType=map // +listMapKey=type Conditions []metav1.Condition
`json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\"
protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields }"
properties:
lastTransitionTime:
description: lastTransitionTime is the last time the condition
transitioned from one status to another. This should be when
the underlying condition changed. If that is not known, then
using the time when the API field changed is acceptable.
format: date-time
type: string
message:
description: message is a human readable message indicating
details about the transition. This may be an empty string.
maxLength: 32768
type: string
observedGeneration:
description: observedGeneration represents the .metadata.generation
that the condition was set based upon. For instance, if .metadata.generation
is currently 12, but the .status.conditions[x].observedGeneration
is 9, the condition is out of date with respect to the current
state of the instance.
format: int64
minimum: 0
type: integer
reason:
description: reason contains a programmatic identifier indicating
the reason for the condition's last transition. Producers
of specific condition types may define expected values and
meanings for this field, and whether the values are considered
a guaranteed API. The value should be a CamelCase string.
This field may not be empty.
maxLength: 1024
minLength: 1
pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$
type: string
status:
description: status of the condition, one of True, False, Unknown.
enum:
- "True"
- "False"
- Unknown
type: string
type:
description: type of condition in CamelCase or in foo.example.com/CamelCase.
--- Many .condition.type values are consistent across resources
like Available, but because arbitrary conditions can be useful
(see .node.status.conditions), the ability to deconflict is
important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt)
maxLength: 316
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
type: string
required:
- lastTransitionTime
- message
- reason
- status
- type
type: object
type: array
created:
type: boolean
namespace:
type: string
type: object
type: object
served: true
storage: true
subresources:
status: {}

View File

@ -3,8 +3,6 @@
# It should be run by config/default
resources:
- bases/application.laf.dev_applications.yaml
- bases/application.laf.dev_bundles.yaml
- bases/application.laf.dev_creationforms.yaml
#+kubebuilder:scaffold:crdkustomizeresource
patchesStrategicMerge:

View File

@ -1,7 +0,0 @@
# The following patch adds a directive for certmanager to inject CA into the CRD
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME)
name: bundles.application.laf.dev

View File

@ -1,7 +0,0 @@
# The following patch adds a directive for certmanager to inject CA into the CRD
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME)
name: creationforms.application.laf.dev

View File

@ -1,16 +0,0 @@
# The following patch enables a conversion webhook for the CRD
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: bundles.application.laf.dev
spec:
conversion:
strategy: Webhook
webhook:
clientConfig:
service:
namespace: system
name: webhook-service
path: /convert
conversionReviewVersions:
- v1

View File

@ -1,16 +0,0 @@
# The following patch enables a conversion webhook for the CRD
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: creationforms.application.laf.dev
spec:
conversion:
strategy: Webhook
webhook:
clientConfig:
service:
namespace: system
name: webhook-service
path: /convert
conversionReviewVersions:
- v1

View File

@ -31,58 +31,6 @@ rules:
- get
- patch
- update
- apiGroups:
- application.laf.dev
resources:
- bundles
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- application.laf.dev
resources:
- bundles/finalizers
verbs:
- update
- apiGroups:
- application.laf.dev
resources:
- bundles/status
verbs:
- get
- patch
- update
- apiGroups:
- application.laf.dev
resources:
- creationforms
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- application.laf.dev
resources:
- creationforms/finalizers
verbs:
- update
- apiGroups:
- application.laf.dev
resources:
- creationforms/status
verbs:
- get
- patch
- update
- apiGroups:
- database.laf.dev
resources:
@ -109,58 +57,6 @@ rules:
- get
- patch
- update
- apiGroups:
- database.laf.dev
resources:
- stores
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- database.laf.dev
resources:
- stores/finalizers
verbs:
- update
- apiGroups:
- database.laf.dev
resources:
- stores/status
verbs:
- get
- patch
- update
- apiGroups:
- gateway.laf.dev
resources:
- domains
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- gateway.laf.dev
resources:
- domains/finalizers
verbs:
- update
- apiGroups:
- gateway.laf.dev
resources:
- domains/status
verbs:
- get
- patch
- update
- apiGroups:
- gateway.laf.dev
resources:
@ -187,58 +83,6 @@ rules:
- get
- patch
- update
- apiGroups:
- gateway.laf.dev
resources:
- routes
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- gateway.laf.dev
resources:
- routes/finalizers
verbs:
- update
- apiGroups:
- gateway.laf.dev
resources:
- routes/status
verbs:
- get
- patch
- update
- apiGroups:
- instance.laf.dev
resources:
- clusters
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- instance.laf.dev
resources:
- clusters/finalizers
verbs:
- update
- apiGroups:
- instance.laf.dev
resources:
- clusters/status
verbs:
- get
- patch
- update
- apiGroups:
- instance.laf.dev
resources:
@ -265,58 +109,6 @@ rules:
- get
- patch
- update
- apiGroups:
- oss.laf.dev
resources:
- buckets
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- oss.laf.dev
resources:
- buckets/finalizers
verbs:
- update
- apiGroups:
- oss.laf.dev
resources:
- buckets/status
verbs:
- get
- patch
- update
- apiGroups:
- oss.laf.dev
resources:
- stores
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- oss.laf.dev
resources:
- stores/finalizers
verbs:
- update
- apiGroups:
- oss.laf.dev
resources:
- stores/status
verbs:
- get
- patch
- update
- apiGroups:
- oss.laf.dev
resources:
@ -343,21 +135,3 @@ rules:
- get
- patch
- update
- apiGroups:
- runtime.laf.dev
resources:
- runtimes
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- runtime.laf.dev
resources:
- runtimes/status
verbs:
- get

View File

@ -46,38 +46,8 @@ spec:
maxLength: 24
minLength: 3
type: string
bundleName:
description: Bundle Name for the application
type: string
region:
description: Region
maxLength: 24
minLength: 3
type: string
runtimeName:
description: Runtime Name of the application
type: string
state:
default: Running
description: State of the application
enum:
- Running
- Stopped
type: string
required:
- appid
- bundleName
- region
- runtimeName
type: object
status:
description: ApplicationStatus defines the observed state of Application
properties:
bundleName:
description: Bundle Name for the application
type: string
bundleSpec:
description: BundleSpec of the application
bundle:
description: Bundle of the application
properties:
databaseCapacity:
anyOf:
@ -124,14 +94,6 @@ spec:
description: Network Traffic Outbound for the bundle
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
priority:
description: Priority for the bundle. The default value is 0,
which means that the bundle is not currently available for creating
new applications.
format: int32
maximum: 1000
minimum: 0
type: integer
requestCPU:
anyOf:
- type: integer
@ -159,11 +121,30 @@ spec:
- limitCPU
- limitMemory
- networkTrafficOutbound
- priority
- requestCPU
- requestMemory
- storageCapacity
type: object
region:
description: Region
maxLength: 24
minLength: 3
type: string
state:
default: Running
description: State of the application
enum:
- Running
- Stopped
type: string
required:
- appid
- bundle
- region
type: object
status:
description: ApplicationStatus defines the observed state of Application
properties:
conditions:
description: 'Conditions:'
items:
@ -233,347 +214,9 @@ spec:
- type
type: object
type: array
runtimeName:
description: Runtime Name for the application
type: string
runtimeSpec:
description: RuntimeSpec of the application
properties:
deprecated:
description: Deprecated
type: boolean
image:
description: Images of the runtime
properties:
init:
description: Init image (e.g. docker.io/lafyun/app-service-init:latest)
- install the dependencies (e.g. npm install) - prepare
the functions (deploy & compile)
type: string
main:
description: Main image (e.g. docker.io/lafyun/app-service:latest)
type: string
sidecar:
description: Sidecar image
type: string
required:
- main
type: object
type:
description: Type of the runtime. eg. node:laf, node:tcb, go:laf,
python:laf, php:laf, etc.
type: string
version:
description: Version of the runtime
properties:
autoUpgradeFrom:
description: Versions that should auto upgrade from
items:
type: string
type: array
breakBefore:
description: Version that is breaking from
type: string
mustUpgradeFrom:
description: Versions that must upgrade from
items:
type: string
type: array
upgradeFrom:
description: Versions that suggested to upgrade from
items:
type: string
type: array
version:
description: Version is the version of the runtime
type: string
type: object
required:
- image
- type
- version
type: object
state:
description: State of the application
type: string
required:
- bundleName
- bundleSpec
- runtimeName
type: object
type: object
served: true
storage: true
subresources:
status: {}
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.9.0
creationTimestamp: null
name: bundles.application.laf.dev
spec:
group: application.laf.dev
names:
kind: Bundle
listKind: BundleList
plural: bundles
singular: bundle
scope: Namespaced
versions:
- name: v1
schema:
openAPIV3Schema:
description: Bundle is the Schema for the bundles API
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:
description: BundleSpec defines the desired state of Bundle
properties:
databaseCapacity:
anyOf:
- type: integer
- type: string
description: Database capacity for the bundle
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
displayName:
description: DisplayName for the bundle
type: string
limitCPU:
anyOf:
- type: integer
- type: string
description: Limit CPU for the bundle
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
limitMemory:
anyOf:
- type: integer
- type: string
description: Limit Memory for the bundle
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
networkBandwidthInbound:
anyOf:
- type: integer
- type: string
description: Network Bandwidth Inbound for the bundle
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
networkBandwidthOutbound:
anyOf:
- type: integer
- type: string
description: Network Bandwidth Outbound for the bundle
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
networkTrafficOutbound:
anyOf:
- type: integer
- type: string
description: Network Traffic Outbound for the bundle
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
priority:
description: Priority for the bundle. The default value is 0, which
means that the bundle is not currently available for creating new
applications.
format: int32
maximum: 1000
minimum: 0
type: integer
requestCPU:
anyOf:
- type: integer
- type: string
description: Request CPU for the bundle
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
requestMemory:
anyOf:
- type: integer
- type: string
description: Request Memory for the bundle
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
storageCapacity:
anyOf:
- type: integer
- type: string
description: Storage capacity for the bundle
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
required:
- databaseCapacity
- displayName
- limitCPU
- limitMemory
- networkTrafficOutbound
- priority
- requestCPU
- requestMemory
- storageCapacity
type: object
status:
description: BundleStatus defines the observed state of Bundle
type: object
type: object
served: true
storage: true
subresources:
status: {}
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.9.0
creationTimestamp: null
name: creationforms.application.laf.dev
spec:
group: application.laf.dev
names:
kind: CreationForm
listKind: CreationFormList
plural: creationforms
singular: creationform
scope: Namespaced
versions:
- name: v1
schema:
openAPIV3Schema:
description: CreationForm is the Schema for the creationforms API
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:
description: CreationFormSpec defines the desired state of CreationForm
properties:
bundleName:
description: Bundle Name for the application
type: string
displayName:
description: DisplayName for the application
maxLength: 63
minLength: 3
type: string
region:
description: Region
maxLength: 24
minLength: 3
type: string
runtimeName:
description: RuntimeSpec Name of the application
type: string
required:
- bundleName
- displayName
- region
- runtimeName
type: object
status:
description: CreationFormStatus defines the observed state of CreationForm
properties:
appid:
type: string
conditions:
description: 'Conditions - Type: Validated - Type: ValidRuntime -
Type: ValidBundle - Type: Created'
items:
description: "Condition contains details for one aspect of the current
state of this API Resource. --- This struct is intended for direct
use as an array at the field path .status.conditions. For example,
\n type FooStatus struct{ // Represents the observations of a
foo's current state. // Known .status.conditions.type are: \"Available\",
\"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge
// +listType=map // +listMapKey=type Conditions []metav1.Condition
`json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\"
protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields }"
properties:
lastTransitionTime:
description: lastTransitionTime is the last time the condition
transitioned from one status to another. This should be when
the underlying condition changed. If that is not known, then
using the time when the API field changed is acceptable.
format: date-time
type: string
message:
description: message is a human readable message indicating
details about the transition. This may be an empty string.
maxLength: 32768
type: string
observedGeneration:
description: observedGeneration represents the .metadata.generation
that the condition was set based upon. For instance, if .metadata.generation
is currently 12, but the .status.conditions[x].observedGeneration
is 9, the condition is out of date with respect to the current
state of the instance.
format: int64
minimum: 0
type: integer
reason:
description: reason contains a programmatic identifier indicating
the reason for the condition's last transition. Producers
of specific condition types may define expected values and
meanings for this field, and whether the values are considered
a guaranteed API. The value should be a CamelCase string.
This field may not be empty.
maxLength: 1024
minLength: 1
pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$
type: string
status:
description: status of the condition, one of True, False, Unknown.
enum:
- "True"
- "False"
- Unknown
type: string
type:
description: type of condition in CamelCase or in foo.example.com/CamelCase.
--- Many .condition.type values are consistent across resources
like Available, but because arbitrary conditions can be useful
(see .node.status.conditions), the ability to deconflict is
important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt)
maxLength: 316
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
type: string
required:
- lastTransitionTime
- message
- reason
- status
- type
type: object
type: array
created:
type: boolean
namespace:
type: string
type: object
type: object
served: true
@ -657,58 +300,6 @@ rules:
- get
- patch
- update
- apiGroups:
- application.laf.dev
resources:
- bundles
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- application.laf.dev
resources:
- bundles/finalizers
verbs:
- update
- apiGroups:
- application.laf.dev
resources:
- bundles/status
verbs:
- get
- patch
- update
- apiGroups:
- application.laf.dev
resources:
- creationforms
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- application.laf.dev
resources:
- creationforms/finalizers
verbs:
- update
- apiGroups:
- application.laf.dev
resources:
- creationforms/status
verbs:
- get
- patch
- update
- apiGroups:
- database.laf.dev
resources:
@ -735,58 +326,6 @@ rules:
- get
- patch
- update
- apiGroups:
- database.laf.dev
resources:
- stores
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- database.laf.dev
resources:
- stores/finalizers
verbs:
- update
- apiGroups:
- database.laf.dev
resources:
- stores/status
verbs:
- get
- patch
- update
- apiGroups:
- gateway.laf.dev
resources:
- domains
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- gateway.laf.dev
resources:
- domains/finalizers
verbs:
- update
- apiGroups:
- gateway.laf.dev
resources:
- domains/status
verbs:
- get
- patch
- update
- apiGroups:
- gateway.laf.dev
resources:
@ -813,58 +352,6 @@ rules:
- get
- patch
- update
- apiGroups:
- gateway.laf.dev
resources:
- routes
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- gateway.laf.dev
resources:
- routes/finalizers
verbs:
- update
- apiGroups:
- gateway.laf.dev
resources:
- routes/status
verbs:
- get
- patch
- update
- apiGroups:
- instance.laf.dev
resources:
- clusters
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- instance.laf.dev
resources:
- clusters/finalizers
verbs:
- update
- apiGroups:
- instance.laf.dev
resources:
- clusters/status
verbs:
- get
- patch
- update
- apiGroups:
- instance.laf.dev
resources:
@ -891,58 +378,6 @@ rules:
- get
- patch
- update
- apiGroups:
- oss.laf.dev
resources:
- buckets
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- oss.laf.dev
resources:
- buckets/finalizers
verbs:
- update
- apiGroups:
- oss.laf.dev
resources:
- buckets/status
verbs:
- get
- patch
- update
- apiGroups:
- oss.laf.dev
resources:
- stores
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- oss.laf.dev
resources:
- stores/finalizers
verbs:
- update
- apiGroups:
- oss.laf.dev
resources:
- stores/status
verbs:
- get
- patch
- update
- apiGroups:
- oss.laf.dev
resources:
@ -969,24 +404,6 @@ rules:
- get
- patch
- update
- apiGroups:
- runtime.laf.dev
resources:
- runtimes
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- runtime.laf.dev
resources:
- runtimes/status
verbs:
- get
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole

View File

@ -73,6 +73,7 @@ require (
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/api v0.25.1 // indirect
k8s.io/apiextensions-apiserver v0.24.2 // indirect
k8s.io/component-base v0.24.2 // indirect
k8s.io/klog/v2 v2.70.1 // indirect
@ -88,7 +89,6 @@ require (
github.com/labring/laf/core/controllers/database v0.0.0-00010101000000-000000000000
github.com/labring/laf/core/controllers/gateway v0.0.0-00010101000000-000000000000
github.com/labring/laf/core/controllers/oss v0.0.0-00010101000000-000000000000
k8s.io/api v0.25.1
)
replace github.com/labring/laf/core => ./../..

View File

@ -512,6 +512,84 @@ rules:
- get
- patch
- update
- apiGroups:
- oss.laf.dev
resources:
- buckets
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- oss.laf.dev
resources:
- buckets/finalizers
verbs:
- update
- apiGroups:
- oss.laf.dev
resources:
- buckets/status
verbs:
- get
- patch
- update
- apiGroups:
- oss.laf.dev
resources:
- stores
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- oss.laf.dev
resources:
- stores/finalizers
verbs:
- update
- apiGroups:
- oss.laf.dev
resources:
- stores/status
verbs:
- get
- patch
- update
- apiGroups:
- oss.laf.dev
resources:
- users
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- oss.laf.dev
resources:
- users/finalizers
verbs:
- update
- apiGroups:
- oss.laf.dev
resources:
- users/status
verbs:
- get
- patch
- update
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole

View File

@ -13,13 +13,4 @@ resources:
kind: Instance
path: github/labring/laf/core/controllers/instance/api/v1
version: v1
- api:
crdVersion: v1
namespaced: true
controller: true
domain: laf.dev
group: instance
kind: Cluster
path: github/labring/laf/core/controllers/instance/api/v1
version: v1
version: "3"

View File

@ -1,96 +0,0 @@
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.9.2
creationTimestamp: null
name: clusters.instance.laf.dev
spec:
group: instance.laf.dev
names:
kind: Cluster
listKind: ClusterList
plural: clusters
singular: cluster
scope: Namespaced
versions:
- name: v1
schema:
openAPIV3Schema:
description: Cluster is the Schema for the clusters API
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:
description: ClusterSpec defines the desired state of Cluster
properties:
capacity:
description: The capacity of the cluster.
properties:
cpu:
anyOf:
- type: integer
- type: string
description: The storage space.
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
memory:
anyOf:
- type: integer
- type: string
description: The number of databases. The default value is 0 which
means unlimited.
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
type: object
clientConfig:
description: ClientConfig of the cluster (e.g. kubeconfig)
type: string
region:
description: Region of the cluster
maxLength: 64
minLength: 2
pattern: ^[a-z0-9-]+$
type: string
type: object
status:
description: ClusterStatus defines the observed state of Cluster
properties:
instanceCount:
type: integer
used:
description: The capacity of the cluster.
properties:
cpu:
anyOf:
- type: integer
- type: string
description: The storage space.
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
memory:
anyOf:
- type: integer
- type: string
description: The number of databases. The default value is 0 which
means unlimited.
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
type: object
type: object
type: object
served: true
storage: true
subresources:
status: {}

View File

@ -3,20 +3,17 @@
# It should be run by config/default
resources:
- bases/instance.laf.dev_instances.yaml
- bases/instance.laf.dev_clusters.yaml
#+kubebuilder:scaffold:crdkustomizeresource
patchesStrategicMerge:
# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix.
# patches here are for enabling the conversion webhook for each CRD
#- patches/webhook_in_instances.yaml
#- patches/webhook_in_clusters.yaml
#+kubebuilder:scaffold:crdkustomizewebhookpatch
# [CERTMANAGER] To enable cert-manager, uncomment all the sections with [CERTMANAGER] prefix.
# patches here are for enabling the CA injection for each CRD
#- patches/cainjection_in_instances.yaml
#- patches/cainjection_in_clusters.yaml
#+kubebuilder:scaffold:crdkustomizecainjectionpatch
# the following config is for teaching kustomize how to do kustomization for CRDs.

View File

@ -1,7 +0,0 @@
# The following patch adds a directive for certmanager to inject CA into the CRD
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME)
name: clusters.instance.laf.dev

View File

@ -1,16 +0,0 @@
# The following patch enables a conversion webhook for the CRD
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: clusters.instance.laf.dev
spec:
conversion:
strategy: Webhook
webhook:
clientConfig:
service:
namespace: system
name: webhook-service
path: /convert
conversionReviewVersions:
- v1

View File

@ -1,6 +0,0 @@
apiVersion: instance.laf.dev/v1
kind: Cluster
metadata:
name: cluster-sample
spec:
# TODO(user): Add fields here

View File

@ -7,102 +7,6 @@ metadata:
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.9.2
creationTimestamp: null
name: clusters.instance.laf.dev
spec:
group: instance.laf.dev
names:
kind: Cluster
listKind: ClusterList
plural: clusters
singular: cluster
scope: Namespaced
versions:
- name: v1
schema:
openAPIV3Schema:
description: Cluster is the Schema for the clusters API
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:
description: ClusterSpec defines the desired state of Cluster
properties:
capacity:
description: The capacity of the cluster.
properties:
cpu:
anyOf:
- type: integer
- type: string
description: The storage space.
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
memory:
anyOf:
- type: integer
- type: string
description: The number of databases. The default value is 0 which
means unlimited.
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
type: object
clientConfig:
description: ClientConfig of the cluster (e.g. kubeconfig)
type: string
region:
description: Region of the cluster
maxLength: 64
minLength: 2
pattern: ^[a-z0-9-]+$
type: string
type: object
status:
description: ClusterStatus defines the observed state of Cluster
properties:
instanceCount:
type: integer
used:
description: The capacity of the cluster.
properties:
cpu:
anyOf:
- type: integer
- type: string
description: The storage space.
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
memory:
anyOf:
- type: integer
- type: string
description: The number of databases. The default value is 0 which
means unlimited.
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
type: object
type: object
type: object
served: true
storage: true
subresources:
status: {}
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.9.2
@ -209,14 +113,6 @@ spec:
description: Network Traffic Outbound for the bundle
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
priority:
description: Priority for the bundle. The default value is 0,
which means that the bundle is not currently available for creating
new applications.
format: int32
maximum: 1000
minimum: 0
type: integer
requestCPU:
anyOf:
- type: integer
@ -244,14 +140,35 @@ spec:
- limitCPU
- limitMemory
- networkTrafficOutbound
- priority
- requestCPU
- requestMemory
- storageCapacity
type: object
region:
description: Region of the instance
databaseConnectionUri:
description: Database of the instance
type: string
ossUser:
description: OssAccess of the instance
properties:
accessKey:
description: AccessKey is the access key of the user
type: string
endpoint:
description: Endpoint is the oss server endpoint.
type: string
internalEndpoint:
description: InternalEndpoint is the internal endpoint of the
oss server
type: string
region:
description: Region of oss store.
type: string
secretKey:
description: SecretKey is the secret key of the user
type: string
required:
- region
type: object
replica:
default: 1
description: Replica of instance
@ -260,16 +177,11 @@ spec:
runtime:
description: Runtime of the instance
properties:
deprecated:
description: Deprecated
type: boolean
image:
description: Images of the runtime
properties:
init:
description: Init image (e.g. docker.io/lafyun/app-service-init:latest)
- install the dependencies (e.g. npm install) - prepare
the functions (deploy & compile)
type: string
main:
description: Main image (e.g. docker.io/lafyun/app-service:latest)
@ -280,37 +192,21 @@ spec:
required:
- main
type: object
latest:
description: Latest version or not
type: boolean
name:
type: string
type:
description: Type of the runtime. eg. node:laf, node:tcb, go:laf,
python:laf, php:laf, etc.
type: string
version:
description: Version of the runtime
properties:
autoUpgradeFrom:
description: Versions that should auto upgrade from
items:
type: string
type: array
breakBefore:
description: Version that is breaking from
type: string
mustUpgradeFrom:
description: Versions that must upgrade from
items:
type: string
type: array
upgradeFrom:
description: Versions that suggested to upgrade from
items:
type: string
type: array
version:
description: Version is the version of the runtime
type: string
type: object
type: string
required:
- image
- name
- type
- version
type: object
@ -331,11 +227,6 @@ spec:
targeted by this deployment.
format: int32
type: integer
clusterConfig:
type: string
clusterName:
description: ClusterName of instance
type: string
conditions:
description: Conditions of the instance @see string for the list of
conditions
@ -488,32 +379,6 @@ metadata:
creationTimestamp: null
name: instance-manager-role
rules:
- apiGroups:
- instance.laf.dev
resources:
- clusters
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- instance.laf.dev
resources:
- clusters/finalizers
verbs:
- update
- apiGroups:
- instance.laf.dev
resources:
- clusters/status
verbs:
- get
- patch
- update
- apiGroups:
- instance.laf.dev
resources:

View File

@ -15,20 +15,3 @@ This directory contains sealos cluster image building scripts for laf.
```bash
# Install laf controllers
sealos run lafyun/laf-controllers:dev
# Install casdoor & service auth in sealos namespace (because service-auth has hard-coding `sealos` namespace in code)
export NODE_IP=$(kubectl get nodes -o jsonpath="{.items[0].status.addresses[0].address}")
export CASDOOR_NODE_PORT=30080
export CASDOOR_ENDPOINT=http://$NODE_IP:$CASDOOR_NODE_PORT
export CASDOOR_CALLBACK_URL=http://localhost:8080/login/callback
kubectl create namespace laf
sealos run --env NAMESPACE=laf --env DATABASE=casdoor lafyun/laf-postgresql:dev
sealos run --env NAMESPACE=laf --env NODE_PORT=${CASDOOR_NODE_PORT} lafyun/laf-casdoor:dev
# Install mongodb
kubectl create namespace laf
sealos run --env NAMESPACE=laf lafyun/laf-mongodb:dev
```

View File

@ -1,15 +0,0 @@
FROM scratch
USER 65532:65532
COPY charts ./charts
COPY registry ./registry
ENV NAME=casdoor
ENV NAMESPACE=sealos
ENV PG_HOST=postgresql
ENV PG_PORT=5432
ENV PG_USERNAME=adm1n
ENV PG_PASSWORD=passw0rd
ENV PG_DATABASE=casdoor
ENV NODE_PORT=30070
CMD [ "helm install $(NAME) ./charts/casdoor --namespace $(NAMESPACE) --set service.nodePort=$(NODE_PORT),postgresql.host=$(PG_HOST),postgresql.port=$(PG_PORT),postgresql.username=$(PG_USERNAME),postgresql.password=$(PG_PASSWORD),postgresql.database=$(PG_DATABASE)" ]

View File

@ -1,12 +0,0 @@
#!/usr/bin/env sh
# Intro: Run this script before building the image.
name=casdoor
abs_dir=$(pwd)/$(dirname "$0")
chart_dir=$abs_dir/../../charts/$name
# copy charts here
mkdir -p $abs_dir/charts
set -x
cp -r $chart_dir $abs_dir/charts

View File

@ -1,14 +0,0 @@
FROM scratch
USER 65532:65532
COPY charts ./charts
COPY registry ./registry
ENV NAME=mongodb
ENV NAMESPACE=default
ENV INIT_USERNAME=adm1n
ENV INIT_PASSWORD=passw0rd
ENV INIT_DATABASE=sys_db
ENV REPLICA_SET_NAME=rs0
ENV STORAGE_CLASS=database-mongodb
ENV STORAGE_SIZE=5G
CMD [ "helm install $(NAME) --set db.username=$(INIT_USERNAME),db.password=$(INIT_PASSWORD),db.database=$(INIT_DATABASE),db.replicaSetName=$(REPLICA_SET_NAME),db.storage.class=$(STORAGE_CLASS),db.storage.size=$(STORAGE_SIZE) --namespace $(NAMESPACE) ./charts/mongodb"]

View File

@ -1,12 +0,0 @@
#!/usr/bin/env sh
# Intro: Run this script before building the image.
name=mongodb
abs_dir=$(pwd)/$(dirname "$0")
chart_dir=$abs_dir/../../charts/$name
# copy charts here
mkdir -p $abs_dir/charts
set -x
cp -r $chart_dir $abs_dir/charts

View File

@ -1,15 +0,0 @@
FROM scratch
USER 65532:65532
COPY charts ./charts
COPY registry ./registry
ENV NAME=postgresql
ENV NAMESPACE=sealos
ENV HOST=postgresql
ENV USERNAME=adm1n
ENV PASSWORD=passw0rd
ENV DATABASE=casdoor
ENV STORAGE_CLASS=local-hostpath
ENV STORAGE_SIZE=3G
ENV STORAGE_CLASS_CREATE=false
CMD [ "helm install $(NAME) ./charts/postgresql --namespace $(NAMESPACE) --set username=$(USERNAME),password=$(PASSWORD),database=$(DATABASE),storage.createClass=$(STORAGE_CLASS_CREATE),storage.class=$(STORAGE_CLASS),storage.size=$(STORAGE_SIZE),service.name=$(HOST)" ]

View File

@ -1,12 +0,0 @@
#!/usr/bin/env sh
# Intro: Run this script before building the image.
name=postgresql
abs_dir=$(pwd)/$(dirname "$0")
chart_dir=$abs_dir/../../charts/$name
# copy charts here
mkdir -p $abs_dir/charts
set -x
cp -r $chart_dir $abs_dir/charts