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

Guide "Deploy a Linode Kubernetes Engine Cluster Using Pulumi" #6555

Merged
merged 8 commits into from
Oct 26, 2023
Merged

Guide "Deploy a Linode Kubernetes Engine Cluster Using Pulumi" #6555

merged 8 commits into from
Oct 26, 2023

Conversation

ringods
Copy link
Contributor

@ringods ringods commented Aug 22, 2023

Here is a guide on how to set up an LKE cluster using Pulumi and Typescript. I kept the structure similar to the TF guide. I also updated some of the links in other articles pointing to resources on the Pulumi website.

@netlify
Copy link

netlify bot commented Aug 22, 2023

Deploy Preview for nostalgic-ptolemy-b01ab8 ready!

Name Link
🔨 Latest commit 8f7859b
🔍 Latest deploy log https://app.netlify.com/sites/nostalgic-ptolemy-b01ab8/deploys/6539e0eb04cc0a00089179c6
😎 Deploy Preview https://deploy-preview-6555--nostalgic-ptolemy-b01ab8.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Remove incorrect inclusion of docs domain name in link

Signed-off-by: Scott Lowe <[email protected]>
@scottslowe
Copy link
Contributor

I fixed a Markdown linting error with 699fa12, let me know if any other changes are needed before merging. Thank you!

@Rajakavitha1 Rajakavitha1 self-requested a review October 10, 2023 14:50
@Rajakavitha1
Copy link
Collaborator

Hi @ringods ! I tried the instructions in the guide and I get an error.

rkodhandapani@blr-mpqob lke-cluster % pulumi new
Please choose a template (19/221 shown):
 linode-typescript                  A minimal Linode TypeScript Pulumi program
This command will walk you through creating a new Pulumi project.

Enter a value or leave blank to accept the (default), and press <ENTER>.
Press ^C at any time to quit.

project name: (lke-cluster) 
Sorry, '(lke-cluster)' is not a valid project name. project names may only contain alphanumerics, hyphens, underscores, and periods
project name: lke-cluster 
Sorry, 'lke-cluster' is not a valid project name. a project with this name already exists: lke-cluster
error: EOF
rkodhandapani@blr-mpqob lke-cluster % ls
rkodhandapani@blr-mpqob lke-cluster % pulumi new
Please choose a template (19/221 shown):
 linode-typescript                  A minimal Linode TypeScript Pulumi program
This command will walk you through creating a new Pulumi project.

Enter a value or leave blank to accept the (default), and press <ENTER>.
Press ^C at any time to quit.

project name: lkecluster 
project description (A minimal Linode TypeScript Pulumi program):  
Created project 'lkecluster'

Please enter your desired stack name.
To create a stack in an organization, use the format <org-name>/<stack-name> (e.g. `acmecorp/dev`).
stack name (dev):  
Created stack 'dev'

linode:token: The token that allows you access to your Linode account:  
Saved config

Installing dependencies...


> @pulumi/[email protected] install /Users/rkodhandapani/lke-cluster/node_modules/@pulumi/linode
> node scripts/install-pulumi-plugin.js resource linode v3.12.0


> [email protected] postinstall /Users/rkodhandapani/lke-cluster/node_modules/protobufjs
> node scripts/postinstall

added 197 packages from 163 contributors and audited 197 packages in 9.656s
found 0 vulnerabilities

Finished installing dependencies

Your new project is ready to go! ✨

To perform an initial deployment, run `pulumi up`

rkodhandapani@blr-mpqob lke-cluster % pulumi up
Previewing update (dev)

View in Browser (Ctrl+O): https://app.pulumi.com/Rajie/lkecluster/dev/previews/5616b4b7-067e-46ea-9be0-b474248fdcec

     Type                 Name            Plan     Info
     pulumi:pulumi:Stack  lkecluster-dev           1 error; 14 messages

Diagnostics:
  pulumi:pulumi:Stack (lkecluster-dev):
    /Users/rkodhandapani/lke-cluster/node_modules/@pulumi/pulumi/runtime/state.js:42
    exports.asyncLocalStorage = new async_hooks_1.AsyncLocalStorage();
                                ^
    TypeError: async_hooks_1.AsyncLocalStorage is not a constructor
        at Object.<anonymous> (/Users/rkodhandapani/lke-cluster/node_modules/@pulumi/pulumi/runtime/state.js:42:29)
        at Module._compile (internal/modules/cjs/loader.js:958:30)
        at Object.Module._extensions..js (internal/modules/cjs/loader.js:994:10)
        at Module.load (internal/modules/cjs/loader.js:813:32)
        at Function.Module._load (internal/modules/cjs/loader.js:725:14)
        at Module.require (internal/modules/cjs/loader.js:850:19)
        at require (internal/modules/cjs/helpers.js:74:18)
        at Object.<anonymous> (/Users/rkodhandapani/lke-cluster/node_modules/@pulumi/pulumi/runtime/debuggable.js:24:28)
        at Module._compile (internal/modules/cjs/loader.js:958:30)
        at Object.Module._extensions..js (internal/modules/cjs/loader.js:994:10)

    error: an unhandled error occurred: Program exited with non-zero exit code: 1
    ```

@ringods
Copy link
Contributor Author

ringods commented Oct 11, 2023

@Rajakavitha1 I will have to update the Pulumi Linode templates. The templates still point to major v3 of our Linode package:

https://github.com/pulumi/templates/blob/6244ddd43b7edf7d358291d92a8e8393a82d466f/linode-typescript/package.json#L9

While we are already far into the major v4 setup:

https://github.com/pulumi/pulumi-linode/releases

This is unrelated to the correctness of the guide.

@ringods
Copy link
Contributor Author

ringods commented Oct 11, 2023

I created this PR to fix this: pulumi/templates#661

Local testing of my fix gives a better outcome:

Previewing update (team-ce/ringo)

View in Browser (Ctrl+O): https://app.pulumi.com/team-ce/linode/ringo/previews/cac5003c-c1e1-4e82-8174-7ec3a7b84306

Downloading plugin: 33.23 MiB / 33.23 MiB [=========================] 100.00% 1s
                                                                                [resource plugin linode-4.8.0] installing
     Type                      Name          Plan       
 +   pulumi:pulumi:Stack       linode-ringo  create     
 +   └─ linode:index:Instance  my-instance   create     


Outputs:
    instanceLabel: output<string>

Resources:
    + 2 to create

Do you want to perform this update? yes
Updating (team-ce/ringo)

View in Browser (Ctrl+O): https://app.pulumi.com/team-ce/linode/ringo/updates/1

     Type                      Name          Status            
 +   pulumi:pulumi:Stack       linode-ringo  created (53s)     
 +   └─ linode:index:Instance  my-instance   created (50s)     


Outputs:
    instanceLabel: "linode50770919"

Resources:
    + 2 created

Duration: 56s

@ringods
Copy link
Contributor Author

ringods commented Oct 12, 2023

@Rajakavitha1 the fix for our Pulumi Linode templates has been merged & verified on our side. Can you retry?

@Rajakavitha1
Copy link
Collaborator

@Rajakavitha1 the fix for our Pulumi Linode templates has been merged & verified on our side. Can you retry?

Thank you @ringods . I will try the instructions again. I truly appreciate your prompt response. Looking forward to taking this PR to merge.

@Rajakavitha1
Copy link
Collaborator

Rajakavitha1 commented Oct 18, 2023

@Rajakavitha1 the fix for our Pulumi Linode templates has been merged & verified on our side. Can you retry?

Hi @ringods !! I tried the instructions and I get an error in the preview that reads: error: an unhandled error occurred: Program exited with non-zero exit code: 1. Here's the output from the terminal. Please let me know what am I missing.
PulumiTest.txt

@ringods
Copy link
Contributor Author

ringods commented Oct 18, 2023

@Rajakavitha1 can you provide me the output of pulumi about?

My first guess is that your NodeJS version is too old. The requirements are listed on our website: https://www.pulumi.com/docs/languages-sdks/javascript/

@Rajakavitha1
Copy link
Collaborator

@Rajakavitha1 the fix for our Pulumi Linode templates has been merged & verified on our side. Can you retry?

Hi @ringods !! I tried the instructions and I get an error in the preview that reads: error: an unhandled error occurred: Program exited with non-zero exit code: 1. Here's the output from the terminal. Please let me know what am I missing. PulumiTest.txt

Hi @ringods here's the output of plume. about:

Version      3.88.0
Go Version   go1.21.1
Go Compiler  gc

Plugins
NAME    VERSION
linode  4.8.1
nodejs  unknown

Host     
OS       darwin
Version  13.6
Arch     x86_64

This project is written in nodejs: executable='/Users/rkodhandapani/.nvm/versions/node/v13.0.0/bin/node' version='v13.0.0'

Current Stack: Rajie/lke-clsuter/dev

Found no resources associated with dev

Found no pending operations associated with dev

Backend        
Name           pulumi.com
URL            https://app.pulumi.com/Rajie
User           Rajie
Organizations  Rajie
Token type     personal

Dependencies:
NAME            VERSION
@pulumi/linode  4.8.1
@pulumi/pulumi  3.89.0
@types/node     18.18.5

Pulumi locates its logs in /var/folders/pv/564r3jvs2ll18n_kzf6hn7fw0000gp/T/ by default

@ringods
Copy link
Contributor Author

ringods commented Oct 18, 2023

@Rajakavitha1 you are on Node v13: /Users/rkodhandapani/.nvm/versions/node/v13.0.0/bin/node, which is too old.

The requirements for NodeJS are listed in the opening paragraph here: https://www.pulumi.com/docs/languages-sdks/javascript/

NodeJS v18 is what I would advice.

@Rajakavitha1
Copy link
Collaborator

@Rajakavitha1 you are on Node v13: /Users/rkodhandapani/.nvm/versions/node/v13.0.0/bin/node, which is too old.

The requirements for NodeJS are listed in the opening paragraph here: https://www.pulumi.com/docs/languages-sdks/javascript/

NodeJS v18 is what I would advice.

Hi @ringods ! I installed the latest Node and it works. Thank you.

@Rajakavitha1
Copy link
Collaborator

LGTM!

@Rajakavitha1
Copy link
Collaborator

Hi @andystevensname. I tested validated and this PR is ready for merge.

Fix relative path to pass Markdown linting tests

Signed-off-by: Scott Lowe <[email protected]>
@Rajakavitha1 Rajakavitha1 merged commit 3dc31ae into linode:develop Oct 26, 2023
6 checks passed
@ringods ringods deleted the guide-pulumi-kubernetes branch October 26, 2023 14:49
@scottslowe
Copy link
Contributor

@Rajakavitha1 When should we expect this content to go live on the Linode site? (It doesn't appear to be visible currently.)

@Rajakavitha1
Copy link
Collaborator

Rajakavitha1 commented Oct 31, 2023

@Rajakavitha1 When should we expect this content to go live on the Linode site? (It doesn't appear to be visible currently.)

Hi @scottslowe . It is live here: https://www.linode.com/docs/products/compute/kubernetes/guides/deploy-cluster-using-pulumi/ published on October 25, 2023.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants