-
Notifications
You must be signed in to change notification settings - Fork 7
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
Kubernetes integration #49
Comments
The first thing should be possible as far as I can see with a quick review: The second point I would like to separate from this Feature Request. @iangregsondev can you do this, please? |
@MitkoTschimev Separate the feature request with regards to the github ? Would you like me to submit a separate issue ? |
@MitkoTschimev I have separated the issue we were speaking about - I think. Let me know if that is what you was referring to ? I have also gone ahead an updated the title of the issue to exclude the github reference. |
I presume the above library can just read in a dockerfile ? https://www.pulumi.com/docs/reference/pkg/nodejs/pulumi/docker/#DockerBuild-dockerfile I mean it looks like the library actually takes care of building a dockerfile via code as well. I think it would be also to just read in a dockerfile and publish it ? |
Yes, we have to define what is the scope of the issue now and how can an integration look like? What do we expect at the end? So nx-deploy-it will generate infrastructure to:
as example:
The next thing is to deploy it somehow somewhere otherwise it doesn't fit within this plugin. So what I could imaging is to provide the possibility additionally to run it as ESC on Fargate as an example or the other server instances on Azure or GCP. |
I like the idea of the folder structure. Maybe this could be configurable as to the location of the Dockerfile. It would also be beneficial to pass in environment variables for use while building the Dockerfile. So these could be standard environment variables and also the ability to load via a .env file - docker has some information here https://docs.docker.com/compose/env-file/ With regards to deployment, I certainly think its beneficial to be able to deploy it to a cloud service - of course. Although I do really see that deploying this to docker hub is a deployment. Certainly in my case anyway, I am currently hosting inside a docker in Digital Ocean - but I have a service running to redeploy my docker services when the image changes in a registry. There are 2 services that already support this, one that works on a pure docker container and another that works with docker swarm. I will paste them here for clarity https://github.com/containrrr/watchtower https://github.com/djmaze/shepherd I think it would beneficial not allow a further deploy to a cloud service as you explained BUT i also think then the deployment could stop there - with the deployment to a registry. I really do think that uploading the image to either docker hub or a private registry - is a real deployment. I think some docker installations are locked down and probably not accessible from outside of the installation to perform the deployment. For example, my production build is in Digital Ocean which of course has a public IP but I also run 2 development environments where the docker environment is NOT exposed externally - docker machine is used on a local IP. I think it would be nice to offer a 2 stage deploy - It would be nice if both were opt in |
So this sounds really interesting and we will try to implement this as soon as possible ;) This Issue should solve to provide the application as docker image to a registry. |
Someone has already created a plugin for docker creation: https://github.com/gperdomor/nx-tools/tree/master/libs/nx-docker maybe this could be reused here? |
Hi @MitkoTschimev and @iangregsondev, I really like the idea to integrate Docker as well. Last year I already did something pretty similar. I am currently about to migrate it to a nx plugin (still within a private repo), but then I saw, that you are interested in it as well. What do you think about a collaboration & integration in your repo? You can get in touch with me on twitter: https://twitter.com/kauppfbi |
Sure we can collaborate together here but I would use directly pulumi to create the docker images. They have already a package for this and than it’s in harmony with the whole other infrastructure as code and Easy to use with the cloud providers in combination for deployment. |
@MitkoTschimev Very nice - didn't realise that nx-docker existed. Looks great. @kauppfbi I like what I see but an NX plugin would be great but as you say collaborating together which probably would be a really good way of obtaining the best possible implementation and plugins! Nice. |
Hi, Glad you're thinking the same. I agree, using pulumi is better in this case. I just didn't know about it. Can we have a short alignment to discuss about design, features and scope? |
Sure just my first thoughts when I dig into deeper: Imagine this flow:
nx run my-app:deploy |
Hey, thanks for creating a really awesome tool! Is there still interest/work being done for Container deploy integration? I would love to be able to add the ability to configure deploying a container, from a tag or a local Dockerfile image, since my common stack is usually:
If so, maybe could integrate the Cloud-agnostic package from Pulumi so that vendor-specific implementations don't all have to be written. This way, can just write a generic "container" resource and then say which Cloud provider it should be deployed to: https://www.pulumi.com/docs/tutorials/cloudfx/ const cloud = require("@pulumi/cloud");
let service = new cloud.Service("pulumi-nginx", {
containers: {
nginx: {
build: "./app",
memory: 128,
ports: [{ port: 80 }],
},
},
replicas: 2,
});
// export just the hostname property of the container frontend
exports.url = service.defaultEndpoint.apply(e => `http://${e.hostname}`); $ pulumi config set cloud:provider aws
$ pulumi config set aws:region us-east-1
$ pulumi config set cloud-aws:useFargate true |
I would be really happy if someone can take over for this feature because it's a big requirement which is still missing. Currently I don't have any time because I'm working on 2 projects and the third one just released (fresh daddy) 🤣😀 So appreciate any help and I will definitely take my time to support / review everyone ;) So this package sounds really nice and I never used it. So if you have experience then let's do it with the package. I already worked on kubernetes support and it was half done. I have to take a look if I committed it. But the pulumi cloud package is more for simple containerization right? So we can provide it outside the kubernetes support. Not everyone needs kubernetes. |
Congratulations on the baby! I'm fairly hard up for time as well, but will take a look and see how much work this would be to integrate (I'm not very familiar with Angular schematics or
The Cloud package provides generic resources that work across cloud providers. It's for everything from Serverless Lambda, Container, S3 Bucket, etc. Instead of using a specific cloud library, like https://github.com/pulumi/pulumi-cloud
So for example, the let api = new API("myapi")
api.get("/", (req, res) => res.json({ hello: "world" }));
api.publish().url.then(url =>
console.log(`Serving myapi at ${url}`)
); If you set your config to AWS, this would create an AWS API Gateway/Lambda. So this way you can define cloud resources in a provider-independent manner, and it will translate it to the right resource on each platform. This is a list of the generic Cloud resources: |
Nice we should try it for the container and if it works really good than we could even refactor the serverless templates too. |
Would be really nice if we could deploy our applications to Docker Hub - for example :-)
Deployments to cloud providers are great but ability to deploy to docker hub (or even a private docker registry) - would open up a lot.
The text was updated successfully, but these errors were encountered: