-
Notifications
You must be signed in to change notification settings - Fork 20
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 gcp provider support #141
Conversation
pkg/provider/gcp/create-instance.go
Outdated
compute.FirewallAllowArgs{ | ||
Protocol: pulumi.String("tcp"), | ||
Ports: pulumi.ToStringArray([]string{ | ||
"22", "443", "6443", "80", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we create some common pkg with this information, so each provider will get values from there and will create the resources it need based on those values... (aws sgs, gcp firewall...).
Otherwise if for whatever reason we want to add some other port in the future we need to go provider by provider
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can make port as part of constants and use it for each provider.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated
pkg/provider/gcp/create-instance.go
Outdated
return nil | ||
} | ||
|
||
func createKey(ctx *pulumi.Context) (*tls.PrivateKey, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here move to common pkg and reuse from all providers
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for aws it is different signature func createKey(ctx *pulumi.Context) (*tls.PrivateKey, *ec2.KeyPair, error)
but yes some of it can be consumed for each provider.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated.
func (a *Provider) GetPlugin() *providerAPI.PluginInfo { | ||
return &providerAPI.PluginInfo{ | ||
Name: "gcp", | ||
Version: "v6.65.0"} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ack, will update that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
c98de2d
to
55e98ce
Compare
Can we add some README content on how to use the gcp, some code snippet on how to invoke the container or the binary? Envs required.... Also did you give a try to build a container and run from it AFAIK we will need to add the gcp cli to the container as well...may at https://github.com/crc-org/crc-cloud/blob/main/requirements.txt |
407c366
to
a4c1e12
Compare
Yes I updated the README which have all the steps and usecase.
gcp cli added as part of container image, I am not sure why |
need to add both the pulumi plugin for gpc and the gcp cli I only see the the pulumi plugin, also that requirements is a way to manage tooling through |
Why I need to add
But where are we using this requirements only for renovate? |
a4c1e12
to
48b1062
Compare
In go lang `init` is a special function and we shouldn't use it in this context even `Init` so better to use `Create` which is what we are doing.
48b1062
to
5a27957
Compare
Not only for renovate we are using it as an unified way for pkg management (+ it is supported by renovate). So pros is we have a unified way to handle pkgs... cons is aws cli v2 is not supported there...on qenvs I use a different approach for each cli. |
As a side note I realize you are using gcp classic provisioner https://github.com/pulumi/pulumi-gcp recently pulumi shift the way they create the provisioners to a native way using the cloud providers API https://github.com/pulumi/pulumi-google-native It seems pulumi recommendation is to move to native provisioners...but they are not mature enough as an example I was able to use the azure native but not the aws as it misses still lot of resources... so add this as a comment we may can create a following issue as spike to migrate the gcp to the native provisioner WDYT? |
This patch will remove the use of getSupportedProviders() and able to use getProvider functionality for provider specific parameter.
``` $ crc-cloud create gcp --gcp-image-id crc --backed-url file:///tmp/gcp/ --project-name prkumar-test --output /tmp/gcp --key-filepath /home/prkumar/.crc/cache/crc_libvirt_4.13.6_amd64/id_ecdsa_crc --pullsecret-filepath /home/prkumar/pull-secret --gcp-disk-size 100 --gcp-instance-type n1-standard-8 ```
Right now it only contain the ports which is used across provider but we should add more common constants to this package in future.
It is going to used for all the provider so better to extract it and have different subpackage.
5a27957
to
55e0dd5
Compare
As per https://github.com/pulumi/pulumi-google-native looks like it is not stable and development is in active state so better to have follow up issue in case we want to switch over in near future. |
No description provided.