Skip to content

Commit

Permalink
add include snippet for checking conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
czeslavo authored and pmalek committed Oct 29, 2024
1 parent 83175e8 commit 0058b19
Show file tree
Hide file tree
Showing 8 changed files with 44 additions and 291 deletions.
24 changes: 24 additions & 0 deletions app/_includes/md/kgo/check-condition.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{% assign name = include.name %}
{% assign kind = include.kind %}
{% assign conditionType = include.conditionType | default: "Programmed" %}
{% assign reason = include.reason | default: "Programmed" %}
{% assign generation = include.generation | default: 1 %}

{% unless include.disableDescription %}
You can verify the `{{ kind }}` was reconciled successfully by checking its `{{ conditionType }}` condition.
{% endunless %}

```shell
kubectl get {{ kind | downcase }} {{ name }} -o=jsonpath='{.status.conditions[?(@.type=="{{ conditionType }}")]}' | jq
```

The output should look similar to this:

```console
{
"observedGeneration": {{ generation }},
"reason": "{{ reason }}",
"status": "True",
"type": "{{ conditionType }}"
}
```
Original file line number Diff line number Diff line change
Expand Up @@ -62,22 +62,7 @@ spec:
' | kubectl apply -f -
```
You can verify the `KongCertificate` was reconciled successfully by checking its `Programmed` condition.
```shell
kubectl get kongcertificate cert -o=jsonpath='{.status.conditions}' | jq '.[] | select(.type == "Programmed")'
```

The output should look similar to this:

```console
{
"observedGeneration": 1,
"reason": "Programmed",
"status": "True",
"type": "Programmed"
}
```
{% include md/kgo/check-condition.md name='cert' kind='KongCertificate' %}

At this point, you should see the Certificate in the Gateway Manager UI.

Expand Down Expand Up @@ -107,37 +92,9 @@ spec:

You can ensure the `KongCertificate` reference is valid by checking the `KongSNI`'s `KongCertificateRefValid` condition.

```shell
kubectl get kongsni example-sni -o=jsonpath='{.status.conditions}' | jq '.[] | select(.type == "KongCertificateRefValid")'
```

The output should look similar to this:
{% include md/kgo/check-condition.md name='example-sni' kind='KongSNI' conditionType='KongCertificateRefValid' reason='Valid' disableDescription=true %}

```console
{
"observedGeneration": 1,
"reason": "Valid",
"status": "True",
"type": "KongCertificateRefValid"
}
```

You can verify the `KongSNI` was reconciled successfully by checking its `Programmed` condition.

```shell
kubectl get kongsni example-sni -o=jsonpath='{.status.conditions}' | jq '.[] | select(.type == "Programmed")'
```

The output should look similar to this:

```console
{
"observedGeneration": 1,
"reason": "Programmed",
"status": "True",
"type": "Programmed"
}
```
{% include md/kgo/check-condition.md name='example-sni' kind='KongSNI' %}

At this point, you should see the SNI in the Certificate's SNIs in the Gateway Manager UI.

Expand Down Expand Up @@ -181,21 +138,6 @@ spec:
' | kubectl apply -f -
```

You can verify the `KongCACertificate` was reconciled successfully by checking its `Programmed` condition.

```shell
kubectl get kongcacertificate ca-cert -o=jsonpath='{.status.conditions}' | jq '.[] | select(.type == "Programmed")'
```

The output should look similar to this:

```console
{
"observedGeneration": 1,
"reason": "Programmed",
"status": "True",
"type": "Programmed"
}
```
{% include md/kgo/check-condition.md name='ca-cert' kind='KongCACertificate' %}

At this point, you should see the CA Certificate in the Gateway Manager UI.
Original file line number Diff line number Diff line change
Expand Up @@ -38,22 +38,7 @@ spec:
' | kubectl apply -f -
```
You can verify the `KongConsumer` was reconciled successfully by checking its `Programmed` condition.
```shell
kubectl get kongconsumer consumer -o=jsonpath='{.status.conditions}' | jq '.[] | select(.type == "Programmed")'
```

The output should look similar to this:

```console
{
"observedGeneration": 1,
"reason": "Programmed",
"status": "True",
"type": "Programmed"
}
```
{% include md/kgo/check-condition.md name='consumer' kind='KongConsumer' %}

At this point, you should see the Consumer in the Gateway Manager UI.

Expand Down Expand Up @@ -86,22 +71,7 @@ spec:
' | kubectl apply -f -
```

You can verify the `KongCredentialBasicAuth` was reconciled successfully by checking its `Programmed` condition.
```shell
kubectl get kongcredentialbasicauth basic-auth-cred -o=jsonpath='{.status.conditions}' | jq '.[] | select(.type == "Programmed")'
```

The output should look similar to this:

```console
{
"observedGeneration": 1,
"reason": "Programmed",
"status": "True",
"type": "Programmed"
}
```
{% include md/kgo/check-condition.md name='basic-auth-cred' kind='KongCredentialBasicAuth' %}

At this point, you should see the Credential in the Consumer's Credentials in the Gateway Manager UI.

Expand Down Expand Up @@ -130,22 +100,7 @@ spec:
' | kubectl apply -f -
```

You can verify the `KongConsumerGroup` was reconciled successfully by checking its `Programmed` condition.
```shell
kubectl get kongconsumergroup consumer-group -o=jsonpath='{.status.conditions}' | jq '.[] | select(.type == "Programmed")'
```

The output should look similar to this:

```console
{
"observedGeneration": 1,
"reason": "Programmed",
"status": "True",
"type": "Programmed"
}
```
{% include md/kgo/check-condition.md name='consumer-group' kind='KongConsumerGroup' %}

At this point, you should see the Consumer Group in the Gateway Manager UI.

Expand Down Expand Up @@ -178,19 +133,6 @@ spec:

You can verify the `KongConsumer`'s `consumerGroups` field was reconciled successfully by checking its `KongConsumerGroupRefsValid` condition.

```shell
kubectl get kongconsumer consumer -o=jsonpath='{.status.conditions}' | jq '.[] | select(.type == "KongConsumerGroupRefsValid")'
```

The output should look similar to this:

```console
{
"observedGeneration": 2,
"reason": "Valid",
"status": "True",
"type": "KongConsumerGroupRefsValid"
}
```
{% include md/kgo/check-condition.md name='consumer' kind='KongConsumer' conditionType='KongConsumerGroupRefsValid' reason='Valid' disableDescription=true %}

At this point, you should see the `consumer` Consumer in the Consumer Group members in the Gateway Manager UI.
Original file line number Diff line number Diff line change
Expand Up @@ -48,21 +48,7 @@ spec:
' | kubectl apply -f -
```
You can verify the `KongDataPlaneClientCertificate` was reconciled successfully by checking its `Programmed` condition.
```shell
kubectl get kongdataplaneclientcertificate dp-cert -o=jsonpath='{.status.conditions}' | jq '.[] | select(.type == "Programmed")'
```

The output should look similar to this:

```console
{
"observedGeneration": 1,
"reason": "Programmed",
"status": "True",
"type": "Programmed"
}
```
{% include md/kgo/check-condition.md name='dp-cert' kind='KongDataPlaneClientCertificate' %}

At this point, you should see the Data Plane Client Certificate in the Gateway Manager UI.
Original file line number Diff line number Diff line change
Expand Up @@ -59,22 +59,7 @@ spec:
' | kubectl apply -f -
```
You can verify the `KongKey` was reconciled successfully by checking its `Programmed` condition.
```shell
kubectl get kongkey key -o=jsonpath='{.status.conditions}' | jq '.[] | select(.type == "Programmed")'
```

The output should look similar to this:

```console
{
"observedGeneration": 1,
"reason": "Programmed",
"status": "True",
"type": "Programmed"
}
```
{% include md/kgo/check-condition.md name='key' kind='KongKey' %}

At this point, you should see the Key in the Gateway Manager UI.

Expand Down Expand Up @@ -105,22 +90,7 @@ spec:
' | kubectl apply -f -
```

You can verify the `KongKeySet` was reconciled successfully by checking its `Programmed` condition.
```shell
kubectl get kongkeyset key-set -o=jsonpath='{.status.conditions}' | jq '.[] | select(.type == "Programmed")'
```

The output should look similar to this:

```console
{
"observedGeneration": 1,
"reason": "Programmed",
"status": "True",
"type": "Programmed"
}
```
{% include md/kgo/check-condition.md name='key-set' kind='KongKeySet' %}

At this point, you should see the Key Set in the Gateway Manager UI.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,22 +38,7 @@ spec:
' | kubectl apply -f -
```
You can verify the `KongService` was reconciled successfully by checking its `Programmed` condition.
```shell
kubectl get kongservice service -o=jsonpath='{.status.conditions}' | jq '.[] | select(.type == "Programmed")'
```

The output should look similar to this:

```console
{
"observedGeneration": 1,
"reason": "Programmed",
"status": "True",
"type": "Programmed"
}
```
{% include md/kgo/check-condition.md name='service' kind='KongService' %}

At this point, you should see the Service in the Gateway Manager UI.

Expand Down Expand Up @@ -90,22 +75,7 @@ spec:
' | kubectl apply -f -
```

You can verify the `KongRoute` was reconciled successfully by checking its `Programmed` condition.
```shell
kubectl get kongroute route-with-service -o=jsonpath='{.status.conditions}' | jq '.[] | select(.type == "Programmed")'
```

The output should look similar to this:

```console
{
"observedGeneration": 1,
"reason": "Programmed",
"status": "True",
"type": "Programmed"
}
```
{% include md/kgo/check-condition.md name='route-with-service' kind='KongRoute' %}

At this point, you should see the Route in the Gateway Manager UI.

Expand Down Expand Up @@ -135,21 +105,6 @@ spec:
' | kubectl apply -f -
```

You can verify the `KongRoute` was reconciled successfully by checking its `Programmed` condition.
```shell
kubectl get kongroute route-without-service -o=jsonpath='{.status.conditions}' | jq '.[] | select(.type == "Programmed")'
```

The output should look similar to this:

```console
{
"observedGeneration": 1,
"reason": "Programmed",
"status": "True",
"type": "Programmed"
}
```
{% include md/kgo/check-condition.md name='route-without-service' kind='KongRoute' %}

At this point, you should see the Route in the Gateway Manager UI.
Original file line number Diff line number Diff line change
Expand Up @@ -75,21 +75,6 @@ spec:
' | kubectl apply -f -
```
You can verify the `KongService` was reconciled successfully by checking its `Programmed` condition.
```shell
kubectl get kongservice service -o=jsonpath='{.status.conditions}' | jq '.[] | select(.type == "Programmed")'
```

The output should look similar to this:

```console
{
"observedGeneration": 1,
"reason": "Programmed",
"status": "True",
"type": "Programmed"
}
```
{% include md/kgo/check-condition.md name='service' kind='KongService' %}

At this point, tags should be visible in the Gateway Manager UI.
Loading

0 comments on commit 0058b19

Please sign in to comment.