Skip to content

Commit

Permalink
typo fixes and instruction corrections
Browse files Browse the repository at this point in the history
  • Loading branch information
boruszak committed Oct 16, 2023
1 parent b9ab63c commit 535fa9d
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 19 deletions.
39 changes: 21 additions & 18 deletions website/content/docs/k8s/multiport/configure.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ $ helm install consul hashicorp/consul --create-namespace --namespace consul --v

Consul's v2 catalog supports two methods for defining multi-port services in Kubernetes:

- Method 1: Define a single Kubernetes Service that exposes multiple ports
- Method 2: Define multiple Kubernetes Services that expose individual ports
- **Method 1**: Define a single Kubernetes Service that exposes multiple ports
- **Method 2**: Define multiple Kubernetes Services that expose individual ports

These methods affect how the Services are addressed in Kubernetes.

Expand Down Expand Up @@ -338,10 +338,13 @@ spec:
To open a shell to the `web` container, you need the name of the Pod it currently runs on. Run the following command to return a list of Pods:

```shell-session
$ kubectl get pods
NAME READY STATUS RESTARTS AGE
api-7dc9d84f-kfnwz 2/2 Running 0 23s
web-7bc5786747-b5pzl 1/1 Running 0 23s
$ kubectl get pods --namespace consul
NAME READY STATUS RESTARTS AGE
api-5784b54bcc-tp98l 3/3 Running 0 6m55s
consul-connect-injector-54865fbcbf-sfjsl 1/1 Running 0 8m33s
consul-server-0 1/1 Running 0 8m33s
consul-webhook-cert-manager-666676bd5b-cdbxc 1/1 Running 0 8m33s
web-6dcbd684bc-gk8n5 2/2 Running 0 6m55s
```

### Validate both ports
Expand All @@ -353,14 +356,14 @@ Use the `web` Pod's name to open a shell session and test the `api` service on p
<Tab heading="Method 1" group="method1">

```shell-session
$ kubectl exec -it web-7bc5786747-b5pzl -- curl api:80
$ kubectl exec -it web-6dcbd684bc-gk8n5 -c web --namespace consul -- curl api:80
hello world
```

Then test the `api` service on port 90.

```shell-session
$ kubectl exec -it web-7bc5786747-b5pzl -- curl api:90
$ kubectl exec -it web-6dcbd684bc-gk8n5 -c web --namespace consul -- curl api:90
hello world from 9090 admin
```

Expand All @@ -369,14 +372,14 @@ hello world from 9090 admin
<Tab heading="Method 2" group="method2">

```shell-session
$ kubectl exec -it web-7bc5786747-b5pzl -- curl api:80
$ kubectl exec -it web-6dcbd684bc-gk8n5 -c web --namespace consul -- curl api:80
hello world
```

Then test the `api-admin` service on port 90.

```shell-session
$ kubectl exec -it web-7bc5786747-b5pzl -- curl api-admin:90
$ kubectl exec -it web-6dcbd684bc-gk8n5 -c web --namespace consul -- curl api-admin:90
hello world from 9090 admin
```

Expand All @@ -398,14 +401,14 @@ $ kubectl apply -f deny-90.yaml --namespace consul
Then, open a shell session in the `web` container and test the `api` service on port 80.

```shell-session
$ kubectl exec -it web-7bc5786747-b5pzl -- curl api:80
$ kubectl exec -it web-6dcbd684bc-gk8n5 -c web --namespace consul -- curl api:80
hello world
```

Test the `api` service on port 90. This command should fail, indicating that the traffic permission is in effect.

```shell-session
$ kubectl exec -it web-7bc5786747-b5pzl -- curl api:90
$ kubectl exec -it web-6dcbd684bc-gk8n5 -c web --namespace consul -- curl api:90
```

</Tab>
Expand All @@ -415,14 +418,14 @@ $ kubectl exec -it web-7bc5786747-b5pzl -- curl api:90
Then, open a shell session in the `web` container and test the `api` service on port 80.

```shell-session
$ kubectl exec -it web-7bc5786747-b5pzl -- curl api:80
$ kubectl exec -it web-6dcbd684bc-gk8n5 -c web --namespace consul -- curl api:80
hello world
```

Test the `admin` service on port 90. This command should fail, indicating that the traffic permission is in effect.

```shell-session
$ kubectl exec -it web-7bc5786747-b5pzl -- curl api-admin:90
$ kubectl exec -it web-6dcbd684bc-gk8n5 -c web --namespace consul -- curl api-admin:90
```

</Tab>
Expand All @@ -449,14 +452,14 @@ $ kubectl apply -f deny-80.yaml --namespace consul
Then, open a shell session in the `web` container and test the `api` service on port 90.

```shell-session
$ kubectl exec -it web-7bc5786747-b5pzl -- curl api:90
$ kubectl exec -it web-6dcbd684bc-gk8n5 -c web --namespace consul -- curl api:90
hello world from 9090 admin
```

Test the `api` service on port 80. This command should fail, indicating that the traffic permission is in effect.

```shell-session
$ kubectl exec -it web-7bc5786747-b5pzl -- curl api:80
$ kubectl exec -it web-6dcbd684bc-gk8n5 -c web --namespace consul -- curl api:80
```

</Tab>
Expand All @@ -466,14 +469,14 @@ $ kubectl exec -it web-7bc5786747-b5pzl -- curl api:80
Then, open a shell session in the `web` container and test the `api-admin` service on port 90.

```shell-session
$ kubectl exec -it web-7bc5786747-b5pzl -- curl api-admin:90
$ kubectl exec -it web-6dcbd684bc-gk8n5 -c web --namespace consul -- curl api-admin:90
hello world from 9090 admin
```

Test the `api` service on port 80. This command should fail, indicating that the traffic permission is in effect.

```shell-session
$ kubectl exec -it web-7bc5786747-b5pzl -- curl api:80
$ kubectl exec -it web-6dcbd684bc-gk8n5 -c web --namespace consul -- curl api:80
```

</Tab>
Expand Down
2 changes: 1 addition & 1 deletion website/content/docs/k8s/multiport/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Since then, the cloud networking needs for applications have evolved and the Con
Consul v1.17 introduces a new version of the catalog API designed to bridge differences between the Consul and Kubernetes data models. The v2 catalog API still tracks services and nodes for Consul, but replaces service instances with _workloads_ and _workload identites_.

- `Workload` is an application instance running in a set of one or more Pods scheduled according to a Kubernetes Workload resource such as a Deployment or StatefulSet. It is similar to [Kubernetes Workloads](https://kubernetes.io/docs/concepts/workloads/).
- `WorkloadIdentities` provide a distinct identity for a Workload to assume in a Kubernetes cluster. THey are similar to [Kubernetes Service Accounts](https://kubernetes.io/docs/concepts/security/service-accounts/).
- `WorkloadIdentities` provide a distinct identity for a Workload to assume in a Kubernetes cluster. They are similar to [Kubernetes Service Accounts](https://kubernetes.io/docs/concepts/security/service-accounts/).

This catalog structure enables Consul to associate a single Kubernetes Workload with multiple services in its catalog.

Expand Down

0 comments on commit 535fa9d

Please sign in to comment.