Skip to content

Commit 4a22457

Browse files
authored
Merge pull request #91 from pulumi/MoergJ/changes
Adding in changes for additionalProperties on annotations.
2 parents 37f1a8a + f515303 commit 4a22457

26 files changed

+322
-300
lines changed

examples/examples_go_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ func TestGoExamples(t *testing.T) {
2424
t.Run(name, func(t *testing.T) {
2525
p := pulumitest.NewPulumiTest(t, test.directoryName,
2626
opttest.LocalProviderPath("pulumi-kubernetes-ingress-nginx", filepath.Join(getCwd(t), "..", "bin")),
27+
opttest.GoModReplacement("github.com/pulumi/pulumi-kubernetes-ingress-nginx/sdk", "..", "sdk"),
2728
)
2829
if test.additionalConfig != nil {
2930
for key, value := range test.additionalConfig {

examples/simple-nginx-go/README.md

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# Simple NGINX Example
2+
3+
This example demonstrates how to deploy a simple NGINX server using Pulumi and Kubernetes.
4+
5+
## Prerequisites
6+
7+
- [Pulumi](https://www.pulumi.com/docs/get-started/install/)
8+
- [Go](https://golang.org/doc/install)
9+
- [Kubernetes](https://kubernetes.io/docs/tasks/tools/install-kubectl/)
10+
11+
## Getting Started
12+
13+
1. Clone the repository:
14+
15+
```sh
16+
git clone https://github.com/pulumi/pulumi-kubernetes-ingress-nginx.git
17+
cd pulumi-kubernetes-ingress-nginx/examples/simple-nginx-go
18+
```
19+
20+
2. Install dependencies:
21+
22+
```sh
23+
go mod tidy
24+
```
25+
26+
3. Modify the `go.mod` file to add the following line:
27+
28+
```go
29+
replace github.com/pulumi/pulumi-kubernetes-ingress-nginx/sdk => ../../sdk/
30+
```
31+
32+
4. Deploy the NGINX server:
33+
34+
```sh
35+
pulumi up
36+
```
37+
38+
5. To destroy the resources when you're done:
39+
40+
```sh
41+
pulumi destroy
42+
```
43+
44+
## Testing
45+
46+
To test the deployment, follow these steps:
47+
48+
1. Verify that the NGINX server is running:
49+
50+
```sh
51+
kubectl get pods
52+
```
53+
54+
2. Get the external IP address of the NGINX service:
55+
56+
```sh
57+
kubectl get svc
58+
```
59+
60+
3. Open a web browser and navigate to the external IP address. You should see the default NGINX welcome page.
61+
62+
## Cleanup
63+
64+
To clean up the resources created by this example, run:
65+
66+
```sh
67+
pulumi destroy
68+
```

examples/simple-nginx-go/go.mod

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,5 +94,3 @@ require (
9494
gopkg.in/yaml.v3 v3.0.1 // indirect
9595
lukechampine.com/frand v1.5.1 // indirect
9696
)
97-
98-
replace github.com/pulumi/pulumi-kubernetes-ingress-nginx/sdk/go/kubernetes-ingress-nginx => ../../sdk/

examples/simple-nginx-go/main.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ func main() {
2929
Enabled: pulumi.BoolPtr(true),
3030
},
3131
Service: &ingressnginx.ControllerServiceArgs{
32+
Annotations: pulumi.StringMap{"pulumi.com/test-annotation1": pulumi.String("test-value1"), "pulumi.com/test-annotation2": pulumi.String("test-value2")},
3233
Type: pulumi.String("NodePort"),
3334
ExternalTrafficPolicy: pulumi.String("Local"),
3435
},

examples/simple-nginx-py/__main__.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,14 @@
2828
publish_service=ControllerPublishServiceArgs(
2929
enabled=True,
3030
),
31-
service=ControllerServiceArgs(type="NodePort", external_traffic_policy="Local"),
31+
service=ControllerServiceArgs(
32+
annotations={
33+
"pulumi.com/test-annotation1": "test-value1",
34+
"pulumi.com/test-annotation2": "test-value2",
35+
},
36+
type="NodePort",
37+
external_traffic_policy="Local"
38+
),
3239
),
3340
)
3441

examples/simple-nginx-ts/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ const ctrl = new nginx.IngressController("myctrl", {
2424
enabled: true,
2525
},
2626
service: {
27+
annotations: {
28+
"pulumi.com/test-annotation1": "test-value1",
29+
"pulumi.com/test-annotation2": "test-value2",
30+
},
2731
type: "NodePort",
2832
externalTrafficPolicy: "Local"
2933
}

provider/cmd/pulumi-resource-kubernetes-ingress-nginx/schema.json

Lines changed: 4 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -331,9 +331,6 @@
331331
"kubernetes-ingress-nginx:index:Autoscaling": {
332332
"properties": {
333333
"annotations": {
334-
"additionalProperties": {
335-
"type": "string"
336-
},
337334
"type": "object"
338335
},
339336
"controllerAutoscalingBehavior": {
@@ -440,9 +437,6 @@
440437
"kubernetes-ingress-nginx:index:ContollerAdmissionWebhooks": {
441438
"properties": {
442439
"annotations": {
443-
"additionalProperties": {
444-
"type": "object"
445-
},
446440
"type": "object"
447441
},
448442
"certificate": {
@@ -515,9 +509,6 @@
515509
"type": "boolean"
516510
},
517511
"annotations": {
518-
"additionalProperties": {
519-
"type": "string"
520-
},
521512
"description": "Annotations to be added to the controller Deployment or DaemonSet.",
522513
"type": "object"
523514
},
@@ -538,7 +529,10 @@
538529
},
539530
"configAnnotations": {
540531
"description": "Annotations to be added to the controller config configuration configmap.",
541-
"type": "object"
532+
"type": "object",
533+
"additionalProperties": {
534+
"type": "string"
535+
}
542536
},
543537
"configMapNamespace": {
544538
"description": "Allows customization of the configmap / nginx-configmap namespace.",
@@ -690,16 +684,10 @@
690684
"type": "object"
691685
},
692686
"podAnnotations": {
693-
"additionalProperties": {
694-
"type": "string"
695-
},
696687
"description": "Annotations to be added to controller pods.",
697688
"type": "object"
698689
},
699690
"podLabels": {
700-
"additionalProperties": {
701-
"type": "object"
702-
},
703691
"description": "labels to add to the pod container metadata.",
704692
"type": "object"
705693
},
@@ -810,9 +798,6 @@
810798
"type": "object"
811799
},
812800
"podAnnotations": {
813-
"additionalProperties": {
814-
"type": "object"
815-
},
816801
"type": "object"
817802
},
818803
"priorityClassName": {
@@ -842,9 +827,6 @@
842827
"kubernetes-ingress-nginx:index:ControllerAdmissionWebhooksService": {
843828
"properties": {
844829
"annotations": {
845-
"additionalProperties": {
846-
"type": "object"
847-
},
848830
"type": "object"
849831
},
850832
"clusterIP": {
@@ -947,16 +929,10 @@
947929
"type": "object"
948930
},
949931
"podAnnotations": {
950-
"additionalProperties": {
951-
"type": "string"
952-
},
953932
"description": "Annotations to be added to default backend pods.",
954933
"type": "object"
955934
},
956935
"podLabels": {
957-
"additionalProperties": {
958-
"type": "string"
959-
},
960936
"description": "labels to add to the pod container metadata",
961937
"type": "object"
962938
},
@@ -999,9 +975,6 @@
999975
"kubernetes-ingress-nginx:index:ControllerDefaultBackendService": {
1000976
"properties": {
1001977
"annotations": {
1002-
"additionalProperties": {
1003-
"type": "string"
1004-
},
1005978
"type": "object"
1006979
},
1007980
"clusterIP": {
@@ -1138,9 +1111,6 @@
11381111
"kubernetes-ingress-nginx:index:ControllerMetricsPrometheusRules": {
11391112
"properties": {
11401113
"additionalLabels": {
1141-
"additionalProperties": {
1142-
"type": "object"
1143-
},
11441114
"type": "object"
11451115
},
11461116
"enabled": {
@@ -1161,9 +1131,6 @@
11611131
"kubernetes-ingress-nginx:index:ControllerMetricsService": {
11621132
"properties": {
11631133
"annotations": {
1164-
"additionalProperties": {
1165-
"type": "string"
1166-
},
11671134
"type": "object"
11681135
},
11691136
"clusterIP": {
@@ -1202,9 +1169,6 @@
12021169
"kubernetes-ingress-nginx:index:ControllerMetricsServiceMonitor": {
12031170
"properties": {
12041171
"additionalLabels": {
1205-
"additionalProperties": {
1206-
"type": "object"
1207-
},
12081172
"type": "object"
12091173
},
12101174
"enabled": {
@@ -1308,9 +1272,6 @@
13081272
"kubernetes-ingress-nginx:index:ControllerService": {
13091273
"properties": {
13101274
"annotations": {
1311-
"additionalProperties": {
1312-
"type": "object"
1313-
},
13141275
"type": "object"
13151276
},
13161277
"clusterIP": {
@@ -1345,9 +1306,6 @@
13451306
"description": "Enables an additional internal load balancer (besides the external one). Annotations are mandatory for the load balancer to come up. Varies with the cloud service."
13461307
},
13471308
"labels": {
1348-
"additionalProperties": {
1349-
"type": "object"
1350-
},
13511309
"type": "object"
13521310
},
13531311
"loadBalancerIP": {
@@ -1398,9 +1356,6 @@
13981356
"kubernetes-ingress-nginx:index:ControllerServiceInternal": {
13991357
"properties": {
14001358
"annotations": {
1401-
"additionalProperties": {
1402-
"type": "object"
1403-
},
14041359
"type": "object"
14051360
},
14061361
"enabled": {
@@ -1411,9 +1366,6 @@
14111366
"type": "string"
14121367
},
14131368
"labels": {
1414-
"additionalProperties": {
1415-
"type": "object"
1416-
},
14171369
"type": "object"
14181370
},
14191371
"loadBalancerIPs": {
@@ -1455,9 +1407,6 @@
14551407
"kubernetes-ingress-nginx:index:ControllerTcp": {
14561408
"properties": {
14571409
"annotations": {
1458-
"additionalProperties": {
1459-
"type": "string"
1460-
},
14611410
"description": "Annotations to be added to the tcp config configmap.",
14621411
"type": "object"
14631412
},
@@ -1470,9 +1419,6 @@
14701419
"kubernetes-ingress-nginx:index:ControllerUdp": {
14711420
"properties": {
14721421
"annotations": {
1473-
"additionalProperties": {
1474-
"type": "string"
1475-
},
14761422
"description": "Annotations to be added to the udp config configmap.",
14771423
"type": "object"
14781424
},
@@ -1535,9 +1481,6 @@
15351481
"kubernetes-ingress-nginx:index:KedaScaledObject": {
15361482
"properties": {
15371483
"annotations": {
1538-
"additionalProperties": {
1539-
"type": "string"
1540-
},
15411484
"description": "Custom annotations for ScaledObject resource.",
15421485
"type": "object"
15431486
}

sdk/dotnet/Inputs/ContollerAdmissionWebhooksArgs.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ namespace Pulumi.KubernetesIngressNginx.Inputs
1313
public sealed class ContollerAdmissionWebhooksArgs : global::Pulumi.ResourceArgs
1414
{
1515
[Input("annotations")]
16-
private InputMap<ImmutableDictionary<string, string>>? _annotations;
17-
public InputMap<ImmutableDictionary<string, string>> Annotations
16+
private InputMap<string>? _annotations;
17+
public InputMap<string> Annotations
1818
{
19-
get => _annotations ?? (_annotations = new InputMap<ImmutableDictionary<string, string>>());
19+
get => _annotations ?? (_annotations = new InputMap<string>());
2020
set => _annotations = value;
2121
}
2222

sdk/dotnet/Inputs/ControllerAdmissionWebhooksPatchArgs.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ public InputMap<string> NodeSelector
2727
}
2828

2929
[Input("podAnnotations")]
30-
private InputMap<ImmutableDictionary<string, string>>? _podAnnotations;
31-
public InputMap<ImmutableDictionary<string, string>> PodAnnotations
30+
private InputMap<string>? _podAnnotations;
31+
public InputMap<string> PodAnnotations
3232
{
33-
get => _podAnnotations ?? (_podAnnotations = new InputMap<ImmutableDictionary<string, string>>());
33+
get => _podAnnotations ?? (_podAnnotations = new InputMap<string>());
3434
set => _podAnnotations = value;
3535
}
3636

sdk/dotnet/Inputs/ControllerAdmissionWebhooksServiceArgs.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ namespace Pulumi.KubernetesIngressNginx.Inputs
1313
public sealed class ControllerAdmissionWebhooksServiceArgs : global::Pulumi.ResourceArgs
1414
{
1515
[Input("annotations")]
16-
private InputMap<ImmutableDictionary<string, string>>? _annotations;
17-
public InputMap<ImmutableDictionary<string, string>> Annotations
16+
private InputMap<string>? _annotations;
17+
public InputMap<string> Annotations
1818
{
19-
get => _annotations ?? (_annotations = new InputMap<ImmutableDictionary<string, string>>());
19+
get => _annotations ?? (_annotations = new InputMap<string>());
2020
set => _annotations = value;
2121
}
2222

0 commit comments

Comments
 (0)