Skip to content
This repository has been archived by the owner on May 24, 2023. It is now read-only.

Commit

Permalink
Merge pull request #1 from nginxinc/plus-example
Browse files Browse the repository at this point in the history
Add a min example for NGINX Plus
  • Loading branch information
Rulox committed Mar 26, 2020
2 parents ec48205 + a5c88ba commit 5a4aff8
Show file tree
Hide file tree
Showing 4 changed files with 81 additions and 2 deletions.
6 changes: 4 additions & 2 deletions examples/deployment-oss-min/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Example

In this example we deploy the NGINX Ingress Controller (edge) as a [Deployment](https://kubernetes.io/docs/concepts/workloads/controllers/deployment/) using the nginx-ingress-operator for NGINX Open Source.
In this example we deploy the NGINX Ingress Controller (edge) as a [Deployment](https://kubernetes.io/docs/concepts/workloads/controllers/deployment/) using the NGINX Ingress Operator for NGINX Open Source.

## Prerequisites

Expand All @@ -13,11 +13,13 @@ Have the NGINX Ingress Operator deployed in your cluster. Follow [installation](
kubectl create -f ns.yaml
```

2. Create a new NginxIngressController resource that defines our NGINX Ingress Controller instance:
2. Create a new NginxIngressController resource that defines our NGINX Ingress Controller instance (**Note**: If using Openshift, change the `image.tag` to `edge-ubi`):
```
kubectl create -f nginx-ingress-controller.yaml
```



This will deploy an NGINX Ingress Controller instance using a [Deployment](https://kubernetes.io/docs/concepts/workloads/controllers/deployment/) in the `my-nginx-controller` namespace.

3. Check if all resources were deployed:
Expand Down
56 changes: 56 additions & 0 deletions examples/deployment-plus-min/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Example

In this example we deploy the NGINX Ingress Controller (edge) as a [Deployment](https://kubernetes.io/docs/concepts/workloads/controllers/deployment/) using the NGINX Ingress Operator for NGINX Plus.

## Prerequisites

1. Have the NGINX Ingress Operator deployed in your cluster. Follow [installation](../../README.md#installation) steps.
2. Build the NGINX Ingress Controller for Plus image and push it to a private repository following
[these instructions](https://docs.nginx.com/nginx-ingress-controller/installation/building-ingress-controller-image/#building-the-image-and-pushing-it-to-the-private-registry)
(**Note**: For the build process, if using Openshift, use the `DOCKERFILE=openshift/DockerfileForPlus` variable).

## Running the example

1. Create a new namespace for our Ingress Controller instance:
```
kubectl create -f ns.yaml
```

2. Create a new NginxIngressController resource that defines our NGINX Ingress Controller instance (**Note:** Update the `image.repository` field in the `nginx-ingress-controller.yaml` with your previously built image for NGINX Plus):
```
kubectl create -f nginx-ingress-controller.yaml
```

This will deploy an NGINX Ingress Controller instance using a [Deployment](https://kubernetes.io/docs/concepts/workloads/controllers/deployment/) in the `my-nginx-controller` namespace.

3. Check if all resources were deployed:

```
kubectl -n my-nginx-ingress get all
NAME READY STATUS RESTARTS AGE
pod/my-nginx-ingress-controller-666854fb5f-f67fs 1/1 Running 0 3s
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
service/my-nginx-ingress-controller NodePort 10.103.105.52 <none> 80:30298/TCP,443:32576/TCP 3s
NAME READY UP-TO-DATE AVAILABLE AGE
deployment.apps/my-nginx-ingress-controller 1/1 1 1 4s
NAME DESIRED CURRENT READY AGE
replicaset.apps/my-nginx-ingress-controller-666854fb5f 1 1 1 4s
```

For more information about how to configure the NGINX Ingress Controller, check the official [documentation](https://docs.nginx.com/nginx-ingress-controller/overview/).

## Remove

1. Delete the NginxIngressController:
```
kubectl delete -f nginx-ingress-controller.yaml
```

1. Delete the namespace:
```
kubectl delete namespace my-nginx-ingress
```
17 changes: 17 additions & 0 deletions examples/deployment-plus-min/nginx-ingress-controller.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
apiVersion: k8s.nginx.org/v1alpha1
kind: NginxIngressController
metadata:
name: my-nginx-ingress-controller
namespace: my-nginx-ingress
spec:
type: deployment
nginxPlus: true
image:
repository: nginx-plus-ingress
tag: edge
pullPolicy: Always
replicas: 1
serviceType: NodePort
enableCRDs: true
nginxStatus:
enable: true
4 changes: 4 additions & 0 deletions examples/deployment-plus-min/ns.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
apiVersion: v1
kind: Namespace
metadata:
name: my-nginx-ingress

0 comments on commit 5a4aff8

Please sign in to comment.