-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Support Kubernetes Provider #29
Support Kubernetes Provider #29
Conversation
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.
Good Job!!!
2 comments:
- Can you separate code to 2 commits(your code and vendor code)
- Add to Readme about kubernetes support
for i := 0; i < items.Len(); i++ { | ||
item := items.Index(i) | ||
// Filter to resources that aren't owned by any other resource | ||
if item.FieldByName("OwnerReferences").Len() > 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.
👍
go.mod
Outdated
k8s.io/apimachinery v0.0.0-20190116203031-d49e237a2683 | ||
k8s.io/client-go v7.0.0+incompatible | ||
k8s.io/kubectl v0.0.0-20190502165022-ce8d9f55c93c | ||
labix.org/v2/mgo v0.0.0-20140701140051-000000000287 // indirect |
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.
Why we need mongo driver?
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.
Apperntally both launchpad.net/gocheck
and labix.org/v2/mgo
are added by mistake. I removed them.
Testing:
All checking with 1.2.0 and lastest provider version + GKE |
e3539fc
to
10ad60e
Compare
The testing issues:
|
Issues:
I checking in clean env(Docker container)
kubernetes_deployment => kubernetes_deployments?? |
Can you add to Readme support kubernetes Here: |
Thanks for the review. I updated the readme files. For the second issue, the resource types are correct but it seems that you're using a kubernetes provider which are not supporting all of the specefied resources. However it'll filter out the resource that are not supported by terraform in I checked both
It seems taht as the problem is because of using some provider which is oldet than v.1.4.0. The module will filter out the modules which are not supported by the v1.4.0, but when genrating the tf files the compiled provider will be failed to do it. So I updated minimum version to v.1.4.0 to be same as the |
For ignoring the optional fields: Each k8s module has tons of optional fields, I was thinking to add a boolean flag to |
|
Yeah, It's being failed to delete some optional values! e.g. I'm trying to debug it, but seems that it's only assuming "" as empty value, while it varies across different types. for instance it's "0" for active_deadline_seconds! |
Does cluster make sense here? I was thinking about considering kubeconfig context for separate paths but I don't think if it make sense here, because it's more likely to be sth like aws profile rahter than zone. If we need to just use it for deviding paths, I'd say the flag should be |
Also I have to say the problem of converting "." to maps is related to calling |
I think let's finish 1 and 2 and to merge this, write about know issue in readme + open issue for this. |
Yeah, you right. Let's fix them in other issues. cluster name: While there is a cluster name specified for k8s in the major cloud providers (as the resource name), the k8s itself doesn't have anything like cluster name. |
kubernetes_terraforming/kind.go
Outdated
map[string]string{}, | ||
)) | ||
|
||
k.Resources[len(k.Resources)-1].IgnoreKeys = []string{ |
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.
Why you need this?
Terraformer have method for get ignoreKeys from provider automatically
https://github.com/GoogleCloudPlatform/terraformer/blob/master/terraform_utils/service.go#L69
You only need add
g.PopulateIgnoreKeys()
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.
I didn't see that method :)) fixed!
Ok, only 1 comment about IgnoreKeys. |
caa7777
to
0e715b1
Compare
* doc: fix typo in documentation * doc: add template for PRs * fix: fix PR template * fead: add support for Certificate Manager * feat: implement Private CrossConnect * fix: use proper depth for API calls * feat: implement S3 keys * fix: rename a variable and fix a typo in a warning message (#12) * feat: add support for Container Registry (#11) * feat: add support for Data Platform (#13) * feat: add support for IONOSCLOUD shares (#14) * feat: add support for IONOSCLOUD users (#15) * feat: add support for CUBE and VCPU servers (#17) * feat: add support for Container Registry Tokens (#18) * feat: add support for ALB forwarding rules (#19) * feat: Add support for DBaaS Mongo Clusters (#22) * feat: add support for DNS Zones (#20) * feat: add support for DNS Zones * fix: Modify user agent and update documentation with info about mongo clusters * feat: add support for DNS Records (#23) * feat: add support for DBaaS Mongo Users (#24) * feat: add support for DBaaS PgSQL users (#25) * feat: add support for DBaaS PgSQL databases (#26) * feat: add support for Logging Pipelines (#28) * feat: add support for IP failover groups (#27) * refactor: fix linter errors (#29)
Implmentation of #3
Note: I add kubernetes provider. resource types are dynamically being generated by matching list of available resources in terraform provider and existing resource types in kubernetes api server.
TODO: Add support of CRDS.
ISSUE:
Some certain kubernetes resources are being failed to applied by terraform, e.g. A configmap label is changed to
eks "amazonaws" {"com/component" = "coredns"}
fromeks.amazonaws.com/component" = "coredns"
. (terraform k8s provider is converting "." to some wiered map!).I didn't check to see if those issues are fixed in the newer versions or not, but we can get benefits of addressed issues by making terraformer compatible to newer versions of terraform and updating the k8s provider to
v1.6.2
.