Open eladb opened 4 years ago
This would be awesome feature!
Yes definitely this one. 👍
I was exploring to find a feature like this. Our use case is to automate the management (add, remove) of Identity Mappings in the aws-auth ConfigMap in EKS. Is this feature also going to be available in code (not just command) to enable automation?
@moises-perez-tfs We still don't have a concrete plan for this feature. Noted that it would be good to have it available via an API as well :)
This issue is now marked as stale because it hasn't seen activity for a while. Add a comment or it will be closed soon.
Keep
I wrote a little something to help make this a bit easier. The following project can convert your YAML to an APIObject.
It uses kube2pulumi as a base.
@Hunter-Thompson very cool! Curious - why did you need to use kube2pulumi
as a base?
@Hunter-Thompson very cool! Curious - why did you need to use
kube2pulumi
as a base?
I first convert it to a Pulumi object, then replace the Pulumi specific things with cdk8s specific declarations. Its a hack, but since both the API's are the same, it works :)
1st result :
import * as pulumi from "@pulumi/pulumi";
import * as kubernetes from "@pulumi/kubernetes";
const frontendNginxPod = new kubernetes.core.v1.Pod("frontendNginxPod", {
apiVersion: "v1",
kind: "Pod",
metadata: {
namespace: "frontend",
name: "nginx",
},
spec: {
containers: [{
name: "nginx",
image: "nginx:1.14-alpine",
resources: {
limits: {
memory: "20Mi",
cpu: 0.2,
},
},
}],
},
});
After parsing :
new k8s.KubePod(this, "nginx", {
metadata: {
namespace: "frontend",
name: "nginx",
},
spec: {
containers: [{
name: "nginx",
image: "nginx:1.14-alpine",
resources: {
limits: {
memory: "20Mi",
cpu: 0.2,
},
},
}],
},
});
This issue is now marked as stale because it hasn't seen activity for a while. Add a comment or it will be closed soon.
Closing this issue as it hasn't seen activity for a while. Please add a comment @mentioning a maintainer to reopen.
I am working on some use cases that need to append resources regularly. I am using cdk8s on go language. Looking for this kind of feature on the code. Say, read an existing YAML manifest and append that with additional data and put it back. So that the GitOps Engine will look at the change and applies that on to the cluster.
Definitely a needed feature...
Waiting for this feature :)
Take it this is never going to happen now with the creator working on a different project?
@jmreicha
We don't currently have this on our immediate roadmap. There is third-party project that might help you out though: https://github.com/smallcase/kube2cdk8s
We propose a new command called
cdk8s dasm
that will take a k8s yaml as input and will generate code (in one of the supported programming languages) which will synthesize the same manifest output (as much as possible).It's nice way to migrate from manifests to cdk8s.
See the cdk-dasm as an example.