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

Add server userdata to support server configuration and init scripts #16

Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,11 @@ spec:
description: Replicas is the initial pool size to deploy.
minimum: 0
type: integer
userData:
description: UserData contains configuration information
or scripts to use upon launch.
format: byte
type: string
required:
- flavorId
- imageId
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ require (
github.com/spf13/pflag v1.0.5
github.com/unikorn-cloud/core v0.1.85
github.com/unikorn-cloud/identity v0.2.45
github.com/unikorn-cloud/region v0.1.47-rc1
github.com/unikorn-cloud/region v0.1.47-rc2
go.opentelemetry.io/otel/sdk v1.31.0
k8s.io/api v0.31.1
k8s.io/apimachinery v0.31.1
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,8 @@ github.com/unikorn-cloud/core v0.1.85 h1:S4B0nr0jhxF8SCsKyCRVwcx8+kJsI8fQVONLJDf
github.com/unikorn-cloud/core v0.1.85/go.mod h1:wEKzCwAnIyTbo27l++Wl+gK95TAxMsFS3y3jbFB03aw=
github.com/unikorn-cloud/identity v0.2.45 h1:YFmw3uunwdZMuYiimv4lfU6s7iTtYoc22xJqLTrlOVg=
github.com/unikorn-cloud/identity v0.2.45/go.mod h1:WzNNv05ReDMLfWsOtq53uzhX2GU2nXDw76Bdsf3BPnM=
github.com/unikorn-cloud/region v0.1.47-rc1 h1:1cFLBF4npcAGiLYiG8o0AGS0h5xkBzvRLJn9Df9Xiao=
github.com/unikorn-cloud/region v0.1.47-rc1/go.mod h1:cofPuJjseRKE95xAqNa23nSL7/+LDXOBxNIHwwODpys=
github.com/unikorn-cloud/region v0.1.47-rc2 h1:eIwFHSoMojjg7MSFirDuNEnaNSWCygtKQRdNhqFIqzw=
github.com/unikorn-cloud/region v0.1.47-rc2/go.mod h1:cofPuJjseRKE95xAqNa23nSL7/+LDXOBxNIHwwODpys=
github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM=
github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg=
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
Expand Down
2 changes: 2 additions & 0 deletions pkg/apis/unikorn/v1alpha1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ type ComputeWorkloadPoolSpec struct {
PublicIPAllocation *PublicIPAllocationSpec `json:"publicIpAllocation,omitempty"`
// Firewall is the workload pool firewall configuration.
Firewall *FirewallSpec `json:"firewall,omitempty"`
// UserData contains configuration information or scripts to use upon launch.
UserData []byte `json:"userData,omitempty"`
}

type PublicIPAllocationSpec struct {
Expand Down
5 changes: 5 additions & 0 deletions pkg/apis/unikorn/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

181 changes: 90 additions & 91 deletions pkg/openapi/schema.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 4 additions & 21 deletions pkg/openapi/server.spec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -227,15 +227,10 @@ components:
$ref: '#/components/schemas/publicIPAllocation'
image:
$ref: '#/components/schemas/imageSelector'
ssh:
description: SSH settings.
type: object
properties:
publicKeys:
description: A list of public SSH keys to allow access to the machine.
type: array
items:
type: string
userData:
description: UserData contains base64-encoded configuration information or scripts to use upon launch.
type: string
format: byte
firewall:
description: A list of firewall rules applied to a workload pool.
type: object
Expand Down Expand Up @@ -466,10 +461,6 @@ components:
image:
os: ubuntu
version: 20.04
ssh:
publicKeys:
- ssh-rsa AAA3NzC1yc2AAADAQABAABgQDZ6...
- ssh-rsa AAA3NzaC1yc2AADAQAAAABgQDZ7...
responses:
computeClusterResponse:
description: A Compute cluster.
Expand Down Expand Up @@ -517,10 +508,6 @@ components:
family: debian
distro: ubuntu
version: '20.04'
ssh:
publicKeys:
- ssh-rsa AAA3NzC1yc2AAADAQABAABgQDZ6...
- ssh-rsa AAA3NzaC1yc2AADAQAAAABgQDZ7...
status:
workloadPools:
- name: default
Expand Down Expand Up @@ -575,10 +562,6 @@ components:
family: debian
dsitro: ubuntu
version: 20.04
ssh:
publicKeys:
- ssh-rsa AAA3NzC1yc2AAADAQABAABgQDZ6...
- ssh-rsa AAA3NzaC1yc2AADAQAAAABgQDZ7...
status:
workloadPools:
- name: default
Expand Down
Loading
Loading