2020-08-05 18:15:36 +02:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
2020-08-05 20:42:38 +02:00
|
|
|
corev1 "github.com/pulumi/pulumi-kubernetes/sdk/v2/go/kubernetes/core/v1"
|
2020-08-06 00:23:36 +02:00
|
|
|
metav1 "github.com/pulumi/pulumi-kubernetes/sdk/v2/go/kubernetes/meta/v1"
|
2021-03-17 14:20:05 +01:00
|
|
|
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
|
2020-08-05 18:15:36 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
|
|
|
pulumi.Run(func(ctx *pulumi.Context) error {
|
2020-08-05 21:44:46 +02:00
|
|
|
_, err := corev1.NewPod(ctx, "bar", &corev1.PodArgs{
|
2020-08-05 18:15:36 +02:00
|
|
|
ApiVersion: pulumi.String("v1"),
|
|
|
|
Kind: pulumi.String("Pod"),
|
2020-08-05 21:44:46 +02:00
|
|
|
Metadata: &metav1.ObjectMetaArgs{
|
2020-08-05 18:15:36 +02:00
|
|
|
Namespace: pulumi.String("foo"),
|
|
|
|
Name: pulumi.String("bar"),
|
|
|
|
},
|
2020-08-05 21:44:46 +02:00
|
|
|
Spec: &corev1.PodSpecArgs{
|
2021-06-24 18:17:55 +02:00
|
|
|
Containers: []corev1.ContainerArgs{
|
2020-08-05 21:44:46 +02:00
|
|
|
&corev1.ContainerArgs{
|
2020-08-05 18:15:36 +02:00
|
|
|
Name: pulumi.String("nginx"),
|
|
|
|
Image: pulumi.String("nginx:1.14-alpine"),
|
2020-08-05 21:44:46 +02:00
|
|
|
Resources: &corev1.ResourceRequirementsArgs{
|
2020-08-05 18:15:36 +02:00
|
|
|
Limits: pulumi.StringMap{
|
|
|
|
"memory": pulumi.String("20Mi"),
|
|
|
|
"cpu": pulumi.String("0.2"),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
})
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
})
|
|
|
|
}
|