@reyemtech/pulumi-rackspace-spot 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/cmd/provider/auth.d.ts +15 -0
  2. package/cmd/provider/auth.js +77 -0
  3. package/cmd/provider/auth.js.map +1 -0
  4. package/cmd/provider/client.d.ts +17 -0
  5. package/cmd/provider/client.js +75 -0
  6. package/cmd/provider/client.js.map +1 -0
  7. package/cmd/provider/functions/getCloudspace.d.ts +14 -0
  8. package/cmd/provider/functions/getCloudspace.js +18 -0
  9. package/cmd/provider/functions/getCloudspace.js.map +1 -0
  10. package/cmd/provider/functions/getKubeconfig.d.ts +10 -0
  11. package/cmd/provider/functions/getKubeconfig.js +26 -0
  12. package/cmd/provider/functions/getKubeconfig.js.map +1 -0
  13. package/cmd/provider/functions/getRegions.d.ts +10 -0
  14. package/cmd/provider/functions/getRegions.js +16 -0
  15. package/cmd/provider/functions/getRegions.js.map +1 -0
  16. package/cmd/provider/functions/getServerClasses.d.ts +17 -0
  17. package/cmd/provider/functions/getServerClasses.js +24 -0
  18. package/cmd/provider/functions/getServerClasses.js.map +1 -0
  19. package/cmd/provider/index.d.ts +1 -0
  20. package/cmd/provider/index.js +53 -0
  21. package/cmd/provider/index.js.map +1 -0
  22. package/cmd/provider/provider.d.ts +20 -0
  23. package/cmd/provider/provider.js +257 -0
  24. package/cmd/provider/provider.js.map +1 -0
  25. package/cmd/provider/resources/cloudspace.d.ts +33 -0
  26. package/cmd/provider/resources/cloudspace.js +114 -0
  27. package/cmd/provider/resources/cloudspace.js.map +1 -0
  28. package/cmd/provider/resources/ondemandnodepool.d.ts +35 -0
  29. package/cmd/provider/resources/ondemandnodepool.js +100 -0
  30. package/cmd/provider/resources/ondemandnodepool.js.map +1 -0
  31. package/cmd/provider/resources/spotnodepool.d.ts +40 -0
  32. package/cmd/provider/resources/spotnodepool.js +141 -0
  33. package/cmd/provider/resources/spotnodepool.js.map +1 -0
  34. package/package.json +7 -2
  35. package/cloudspace.ts +0 -29
  36. package/getCloudspace.ts +0 -23
  37. package/getKubeconfig.ts +0 -19
  38. package/getRegions.ts +0 -19
  39. package/getServerClasses.ts +0 -28
  40. package/index.ts +0 -10
  41. package/ondemandnodepool.ts +0 -33
  42. package/provider.ts +0 -11
  43. package/spotnodepool.ts +0 -37
  44. package/tsconfig.json +0 -15
@@ -0,0 +1,141 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SpotNodePoolHandler = void 0;
4
+ const crypto_1 = require("crypto");
5
+ const RESOURCE = "spotnodepools";
6
+ function buildSpec(inputs) {
7
+ const spec = {
8
+ cloudSpace: inputs.cloudspaceName,
9
+ serverClass: inputs.serverClass,
10
+ bidPrice: inputs.bidPrice.toFixed(3),
11
+ customLabels: inputs.labels ?? {},
12
+ customAnnotations: inputs.annotations ?? {},
13
+ customTaints: inputs.taints ?? [],
14
+ };
15
+ // Rackspace API always requires spec.desired, even with autoscaling
16
+ if (inputs.autoscaling) {
17
+ spec.desired = inputs.desiredCount ?? inputs.autoscaling.minNodes;
18
+ spec.autoscaling = {
19
+ enabled: true,
20
+ minNodes: inputs.autoscaling.minNodes,
21
+ maxNodes: inputs.autoscaling.maxNodes,
22
+ };
23
+ }
24
+ else {
25
+ spec.desired = inputs.desiredCount ?? 1;
26
+ }
27
+ return spec;
28
+ }
29
+ function apiToOutputs(resource) {
30
+ const { metadata, spec, status } = resource;
31
+ const props = {
32
+ cloudspaceName: spec.cloudSpace,
33
+ serverClass: spec.serverClass,
34
+ bidPrice: parseFloat(spec.bidPrice),
35
+ labels: spec.customLabels ?? {},
36
+ annotations: spec.customAnnotations ?? {},
37
+ taints: spec.customTaints ?? [],
38
+ nodepoolId: metadata.name ?? "",
39
+ wonCount: status?.wonCount ?? 0,
40
+ bidStatus: status?.bidStatus ?? "",
41
+ };
42
+ if (spec.autoscaling?.enabled) {
43
+ props.autoscaling = {
44
+ minNodes: spec.autoscaling.minNodes,
45
+ maxNodes: spec.autoscaling.maxNodes,
46
+ };
47
+ }
48
+ else if (spec.desired !== undefined) {
49
+ props.desiredCount = spec.desired;
50
+ }
51
+ return props;
52
+ }
53
+ function deepEqual(a, b) {
54
+ return JSON.stringify(a) === JSON.stringify(b);
55
+ }
56
+ class SpotNodePoolHandler {
57
+ client;
58
+ namespace;
59
+ constructor(client, namespace) {
60
+ this.client = client;
61
+ this.namespace = namespace;
62
+ }
63
+ async create(inputs) {
64
+ const body = {
65
+ apiVersion: "ngpc.rxt.io/v1",
66
+ kind: "SpotNodePool",
67
+ metadata: {
68
+ name: (0, crypto_1.randomUUID)(),
69
+ namespace: this.namespace,
70
+ },
71
+ spec: buildSpec(inputs),
72
+ };
73
+ const resource = await this.client.create(RESOURCE, body);
74
+ const id = resource.metadata.name;
75
+ return { id, outs: JSON.parse(JSON.stringify(apiToOutputs(resource))) };
76
+ }
77
+ async read(id) {
78
+ const resource = await this.client.get(RESOURCE, id);
79
+ const props = apiToOutputs(resource);
80
+ return { id, props };
81
+ }
82
+ diff(olds, news) {
83
+ const replaces = [];
84
+ // Immutable fields
85
+ if (olds.cloudspaceName !== news.cloudspaceName)
86
+ replaces.push("cloudspaceName");
87
+ if (olds.serverClass !== news.serverClass)
88
+ replaces.push("serverClass");
89
+ // Mutable fields — detect any change
90
+ const mutableChanged = olds.bidPrice !== news.bidPrice ||
91
+ olds.desiredCount !== news.desiredCount ||
92
+ !deepEqual(olds.autoscaling, news.autoscaling) ||
93
+ !deepEqual(olds.labels, news.labels) ||
94
+ !deepEqual(olds.annotations, news.annotations) ||
95
+ !deepEqual(olds.taints, news.taints);
96
+ const changes = replaces.length > 0 || mutableChanged;
97
+ return {
98
+ changes,
99
+ replaces,
100
+ deleteBeforeReplace: replaces.length > 0,
101
+ };
102
+ }
103
+ async update(id, olds, news) {
104
+ // Fetch latest to get the current resourceVersion
105
+ const latest = await this.client.get(RESOURCE, id);
106
+ const updatedSpec = {
107
+ ...latest.spec,
108
+ bidPrice: news.bidPrice.toFixed(3),
109
+ customLabels: news.labels ?? {},
110
+ customAnnotations: news.annotations ?? {},
111
+ customTaints: news.taints ?? [],
112
+ };
113
+ // Rackspace API always requires spec.desired, even with autoscaling
114
+ if (news.autoscaling) {
115
+ updatedSpec.desired = news.desiredCount ?? news.autoscaling.minNodes;
116
+ updatedSpec.autoscaling = {
117
+ enabled: true,
118
+ minNodes: news.autoscaling.minNodes,
119
+ maxNodes: news.autoscaling.maxNodes,
120
+ };
121
+ }
122
+ else {
123
+ delete updatedSpec.autoscaling;
124
+ if (news.desiredCount !== undefined) {
125
+ updatedSpec.desired = news.desiredCount;
126
+ }
127
+ }
128
+ const body = {
129
+ ...latest,
130
+ spec: updatedSpec,
131
+ };
132
+ const updated = await this.client.update(RESOURCE, id, body);
133
+ const outs = apiToOutputs(updated);
134
+ return { outs };
135
+ }
136
+ async delete(id) {
137
+ await this.client.remove(RESOURCE, id);
138
+ }
139
+ }
140
+ exports.SpotNodePoolHandler = SpotNodePoolHandler;
141
+ //# sourceMappingURL=spotnodepool.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spotnodepool.js","sourceRoot":"","sources":["../../resources/spotnodepool.ts"],"names":[],"mappings":";;;AAAA,mCAAoC;AAGpC,MAAM,QAAQ,GAAG,eAAe,CAAC;AAajC,SAAS,SAAS,CAAC,MAA0B;IAC3C,MAAM,IAAI,GAAwB;QAChC,UAAU,EAAE,MAAM,CAAC,cAAc;QACjC,WAAW,EAAE,MAAM,CAAC,WAAW;QAC/B,QAAQ,EAAE,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC;QACpC,YAAY,EAAE,MAAM,CAAC,MAAM,IAAI,EAAE;QACjC,iBAAiB,EAAE,MAAM,CAAC,WAAW,IAAI,EAAE;QAC3C,YAAY,EAAE,MAAM,CAAC,MAAM,IAAI,EAAE;KAClC,CAAC;IAEF,oEAAoE;IACpE,IAAI,MAAM,CAAC,WAAW,EA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"version": "0.2.1",
4
4
  "description": "Pulumi provider for Rackspace Spot — cloudspaces, node pools, kubeconfig",
5
5
  "main": "bin/index.js",
6
6
  "types": "bin/index.d.ts",
7
+ "files": [
8
+ "bin/",
9
+ "cmd/",
10
+ "types/"
11
+ ],
7
12
  "bin": {
8
13
  "pulumi-resource-rackspace-spot": "cmd/pulumi-resource-rackspace-spot.js"
9
14
  },
10
15
  "scripts": {
11
- "build": "tsc && cp -r ../provider/bin cmd/provider",
16
+ "build": "tsc && rm -rf cmd/provider && cp -r ../provider/bin cmd/provider",
12
17
  "postinstall": "node cmd/install-plugin.js"
13
18
  },
14
19
  "pulumi": {
package/cloudspace.ts DELETED
@@ -1,29 +0,0 @@
1
- import * as pulumi from "@pulumi/pulumi";
2
-
3
- export interface CloudSpaceArgs {
4
- cloudspaceName: pulumi.Input<string>;
5
- region: pulumi.Input<string>;
6
- kubernetesVersion?: pulumi.Input<string>;
7
- cni?: pulumi.Input<string>;
8
- haControlPlane?: pulumi.Input<boolean>;
9
- preemptionWebhookUrl?: pulumi.Input<string>;
10
- }
11
-
12
- export class CloudSpace extends pulumi.CustomResource {
13
- public readonly cloudspaceName!: pulumi.Output<string>;
14
- public readonly region!: pulumi.Output<string>;
15
- public readonly kubernetesVersion!: pulumi.Output<string>;
16
- public readonly cni!: pulumi.Output<string>;
17
- public readonly haControlPlane!: pulumi.Output<boolean>;
18
- public readonly preemptionWebhookUrl!: pulumi.Output<string | undefined>;
19
- public readonly apiServerEndpoint!: pulumi.Output<string>;
20
- public readonly phase!: pulumi.Output<string>;
21
-
22
- constructor(name: string, args: CloudSpaceArgs, opts?: pulumi.CustomResourceOptions) {
23
- super("rackspace-spot:index:CloudSpace", name, {
24
- ...args,
25
- apiServerEndpoint: undefined,
26
- phase: undefined,
27
- }, opts);
28
- }
29
- }
package/getCloudspace.ts DELETED
@@ -1,23 +0,0 @@
1
- import * as pulumi from "@pulumi/pulumi";
2
-
3
- export interface GetCloudspaceArgs {
4
- name: string;
5
- }
6
-
7
- export interface GetCloudspaceResult {
8
- name: string;
9
- region: string;
10
- kubernetesVersion: string;
11
- cni: string;
12
- haControlPlane: boolean;
13
- apiServerEndpoint: string;
14
- phase: string;
15
- }
16
-
17
- export function getCloudspace(args: GetCloudspaceArgs, opts?: pulumi.InvokeOptions): Promise<GetCloudspaceResult> {
18
- return pulumi.runtime.invoke("rackspace-spot:index:getCloudspace", args, opts);
19
- }
20
-
21
- export function getCloudspaceOutput(args: GetCloudspaceArgs, opts?: pulumi.InvokeOutputOptions): pulumi.Output<GetCloudspaceResult> {
22
- return pulumi.runtime.invokeOutput("rackspace-spot:index:getCloudspace", args, opts);
23
- }
package/getKubeconfig.ts DELETED
@@ -1,19 +0,0 @@
1
- import * as pulumi from "@pulumi/pulumi";
2
-
3
- export interface GetKubeconfigArgs {
4
- cloudspaceName: string;
5
- }
6
-
7
- export interface GetKubeconfigResult {
8
- raw: string;
9
- host: string;
10
- clusterName: string;
11
- }
12
-
13
- export function getKubeconfig(args: GetKubeconfigArgs, opts?: pulumi.InvokeOptions): Promise<GetKubeconfigResult> {
14
- return pulumi.runtime.invoke("rackspace-spot:index:getKubeconfig", args, opts);
15
- }
16
-
17
- export function getKubeconfigOutput(args: GetKubeconfigArgs, opts?: pulumi.InvokeOutputOptions): pulumi.Output<GetKubeconfigResult> {
18
- return pulumi.runtime.invokeOutput("rackspace-spot:index:getKubeconfig", args, opts);
19
- }
package/getRegions.ts DELETED
@@ -1,19 +0,0 @@
1
- import * as pulumi from "@pulumi/pulumi";
2
-
3
- export interface RegionInfo {
4
- name: string;
5
- country: string;
6
- description: string;
7
- }
8
-
9
- export interface GetRegionsResult {
10
- regions: RegionInfo[];
11
- }
12
-
13
- export function getRegions(opts?: pulumi.InvokeOptions): Promise<GetRegionsResult> {
14
- return pulumi.runtime.invoke("rackspace-spot:index:getRegions", {}, opts);
15
- }
16
-
17
- export function getRegionsOutput(opts?: pulumi.InvokeOutputOptions): pulumi.Output<GetRegionsResult> {
18
- return pulumi.runtime.invokeOutput("rackspace-spot:index:getRegions", {}, opts);
19
- }
@@ -1,28 +0,0 @@
1
- import * as pulumi from "@pulumi/pulumi";
2
-
3
- export interface GetServerClassesArgs {
4
- region?: string;
5
- }
6
-
7
- export interface ServerClassInfo {
8
- name: string;
9
- region: string;
10
- category: string;
11
- cpu: string;
12
- memory: string;
13
- flavorType: string;
14
- available: number;
15
- capacity: number;
16
- }
17
-
18
- export interface GetServerClassesResult {
19
- serverClasses: ServerClassInfo[];
20
- }
21
-
22
- export function getServerClasses(args?: GetServerClassesArgs, opts?: pulumi.InvokeOptions): Promise<GetServerClassesResult> {
23
- return pulumi.runtime.invoke("rackspace-spot:index:getServerClasses", args ?? {}, opts);
24
- }
25
-
26
- export function getServerClassesOutput(args?: GetServerClassesArgs, opts?: pulumi.InvokeOutputOptions): pulumi.Output<GetServerClassesResult> {
27
- return pulumi.runtime.invokeOutput("rackspace-spot:index:getServerClasses", args ?? {}, opts);
28
- }
package/index.ts DELETED
@@ -1,10 +0,0 @@
1
- export { Provider, ProviderArgs } from "./provider";
2
- export { CloudSpace, CloudSpaceArgs } from "./cloudspace";
3
- export { SpotNodePool, SpotNodePoolArgs } from "./spotnodepool";
4
- export { OnDemandNodePool, OnDemandNodePoolArgs } from "./ondemandnodepool";
5
- export { getCloudspace, getCloudspaceOutput, GetCloudspaceArgs, GetCloudspaceResult } from "./getCloudspace";
6
- export { getKubeconfig, getKubeconfigOutput, GetKubeconfigArgs, GetKubeconfigResult } from "./getKubeconfig";
7
- export { getRegions, getRegionsOutput, GetRegionsResult, RegionInfo } from "./getRegions";
8
- export { getServerClasses, getServerClassesOutput, GetServerClassesArgs, GetServerClassesResult, ServerClassInfo } from "./getServerClasses";
9
- export * from "./types/input";
10
- export * from "./types/output";
@@ -1,33 +0,0 @@
1
- import * as pulumi from "@pulumi/pulumi";
2
- import { Taint } from "./types/input";
3
- import { TaintOutput } from "./types/output";
4
-
5
- export interface OnDemandNodePoolArgs {
6
- cloudspaceName: pulumi.Input<string>;
7
- serverClass: pulumi.Input<string>;
8
- desiredCount: pulumi.Input<number>;
9
- labels?: pulumi.Input<{ [key: string]: pulumi.Input<string> }>;
10
- annotations?: pulumi.Input<{ [key: string]: pulumi.Input<string> }>;
11
- taints?: pulumi.Input<pulumi.Input<Taint>[]>;
12
- }
13
-
14
- export class OnDemandNodePool extends pulumi.CustomResource {
15
- public readonly cloudspaceName!: pulumi.Output<string>;
16
- public readonly serverClass!: pulumi.Output<string>;
17
- public readonly desiredCount!: pulumi.Output<number>;
18
- public readonly labels!: pulumi.Output<{ [key: string]: string } | undefined>;
19
- public readonly annotations!: pulumi.Output<{ [key: string]: string } | undefined>;
20
- public readonly taints!: pulumi.Output<TaintOutput[] | undefined>;
21
- public readonly nodepoolId!: pulumi.Output<string>;
22
- public readonly reservedCount!: pulumi.Output<number>;
23
- public readonly reservedStatus!: pulumi.Output<string>;
24
-
25
- constructor(name: string, args: OnDemandNodePoolArgs, opts?: pulumi.CustomResourceOptions) {
26
- super("rackspace-spot:index:OnDemandNodePool", name, {
27
- ...args,
28
- nodepoolId: undefined,
29
- reservedCount: undefined,
30
- reservedStatus: undefined,
31
- }, opts);
32
- }
33
- }
package/provider.ts DELETED
@@ -1,11 +0,0 @@
1
- import * as pulumi from "@pulumi/pulumi";
2
-
3
- export interface ProviderArgs {
4
- token?: pulumi.Input<string>;
5
- }
6
-
7
- export class Provider extends pulumi.ProviderResource {
8
- constructor(name: string, args?: ProviderArgs, opts?: pulumi.ResourceOptions) {
9
- super("rackspace-spot", name, { token: args?.token }, opts);
10
- }
11
- }
package/spotnodepool.ts DELETED
@@ -1,37 +0,0 @@
1
- import * as pulumi from "@pulumi/pulumi";
2
- import { Autoscaling, Taint } from "./types/input";
3
- import { AutoscalingOutput, TaintOutput } from "./types/output";
4
-
5
- export interface SpotNodePoolArgs {
6
- cloudspaceName: pulumi.Input<string>;
7
- serverClass: pulumi.Input<string>;
8
- bidPrice: pulumi.Input<number>;
9
- desiredCount?: pulumi.Input<number>;
10
- autoscaling?: pulumi.Input<Autoscaling>;
11
- labels?: pulumi.Input<{ [key: string]: pulumi.Input<string> }>;
12
- annotations?: pulumi.Input<{ [key: string]: pulumi.Input<string> }>;
13
- taints?: pulumi.Input<pulumi.Input<Taint>[]>;
14
- }
15
-
16
- export class SpotNodePool extends pulumi.CustomResource {
17
- public readonly cloudspaceName!: pulumi.Output<string>;
18
- public readonly serverClass!: pulumi.Output<string>;
19
- public readonly bidPrice!: pulumi.Output<number>;
20
- public readonly desiredCount!: pulumi.Output<number | undefined>;
21
- public readonly autoscaling!: pulumi.Output<AutoscalingOutput | undefined>;
22
- public readonly labels!: pulumi.Output<{ [key: string]: string } | undefined>;
23
- public readonly annotations!: pulumi.Output<{ [key: string]: string } | undefined>;
24
- public readonly taints!: pulumi.Output<TaintOutput[] | undefined>;
25
- public readonly nodepoolId!: pulumi.Output<string>;
26
- public readonly wonCount!: pulumi.Output<number>;
27
- public readonly bidStatus!: pulumi.Output<string>;
28
-
29
- constructor(name: string, args: SpotNodePoolArgs, opts?: pulumi.CustomResourceOptions) {
30
- super("rackspace-spot:index:SpotNodePool", name, {
31
- ...args,
32
- nodepoolId: undefined,
33
- wonCount: undefined,
34
- bidStatus: undefined,
35
- }, opts);
36
- }
37
- }
package/tsconfig.json DELETED
@@ -1,15 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "strict": true,
4
- "outDir": "bin",
5
- "target": "es2022",
6
- "module": "commonjs",
7
- "moduleResolution": "node",
8
- "declaration": true,
9
- "sourceMap": true,
10
- "esModuleInterop": true,
11
- "skipLibCheck": true,
12
- "forceConsistentCasingInFileNames": true
13
- },
14
- "include": ["*.ts", "types/*.ts"]
15
- }