Skip to content

Commit 2b6487e

Browse files
committed
Update CI workflow and update to use generic base images
1 parent 569ae5a commit 2b6487e

File tree

18 files changed

+193
-101
lines changed

18 files changed

+193
-101
lines changed

.github/workflows/ci.yml

Lines changed: 35 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Continuous Integration
33
on:
44
push:
55
branches:
6-
- 'main'
6+
- main
77
paths-ignore:
88
- 'docs/**'
99
- 'examples/**'
@@ -22,6 +22,9 @@ on:
2222
- 'examples/**'
2323
- '**.md'
2424

25+
env:
26+
platforms: "linux/amd64,linux/arm64,linux/ppc64le,linux/s390x"
27+
2528
concurrency:
2629
group: ${{ github.ref_name }}-ci
2730
cancel-in-progress: true
@@ -36,7 +39,7 @@ jobs:
3639
repo_name: ${{ steps.vars.outputs.repo }}
3740
steps:
3841
- name: Checkout Repository
39-
uses: actions/checkout@v2
42+
uses: actions/checkout@v3
4043
- name: Output Variables
4144
id: vars
4245
run: |
@@ -49,15 +52,27 @@ jobs:
4952
needs: vars
5053
steps:
5154
- name: Checkout Repository
52-
uses: actions/checkout@v2
55+
uses: actions/checkout@v3
5356
with:
5457
fetch-depth: 0
55-
- name: RedHat Registry Login
58+
- name: DockerHub Login
59+
uses: docker/login-action@v1
60+
with:
61+
username: ${{ secrets.DOCKER_USERNAME }}
62+
password: ${{ secrets.DOCKER_PASSWORD }}
63+
if: github.event_name != 'pull_request'
64+
- name: Login to GitHub Container Registry
5665
uses: docker/login-action@v1
5766
with:
58-
registry: registry.redhat.io
59-
username: ${{ secrets.RH_DOCKER_USERNAME }}
60-
password: ${{ secrets.RH_DOCKER_PASSWORD }}
67+
registry: ghcr.io
68+
username: ${{ github.repository_owner }}
69+
password: ${{ secrets.GITHUB_TOKEN }}
70+
if: github.event_name != 'pull_request'
71+
- name: Setup QEMU
72+
uses: docker/setup-qemu-action@v1
73+
with:
74+
platforms: arm64,ppc64le,s390x
75+
if: github.event_name != 'pull_request'
6176
- name: Docker Buildx
6277
uses: docker/setup-buildx-action@v1
6378
- name: Docker meta
@@ -66,6 +81,7 @@ jobs:
6681
with:
6782
images: |
6883
nginx/nginx-ingress-operator
84+
ghcr.io/nginxinc/nginx-ingress-operator
6985
tags: |
7086
type=edge
7187
type=ref,event=pr
@@ -76,16 +92,13 @@ jobs:
7692
- name: Output Variables
7793
id: var
7894
run: |
79-
8095
version=${{ steps.meta.outputs.version }}
81-
operator_version=v$version
82-
# TODO: Uncomment below once tags have been created
83-
# if ${{ startsWith(github.ref, 'refs/tags/') }}; then
84-
# operator_version=v$version
85-
# else
86-
# tag=$(git describe --tags --abbrev=0)
87-
# operator_version=$tag-$version-${{ needs.vars.outputs.sha_short }}
88-
# fi
96+
if ${{ startsWith(github.ref, 'refs/tags/') }}; then
97+
operator_version=v$version
98+
else
99+
tag=$(git describe --tags --abbrev=0)
100+
operator_version=$tag-$version-${{ needs.vars.outputs.sha_short }}
101+
fi
89102
echo "::set-output name=version::$operator_version"
90103
- name: Build Image
91104
uses: docker/build-push-action@v2
@@ -95,19 +108,18 @@ jobs:
95108
cache-to: type=gha,mode=max
96109
tags: ${{ steps.meta.outputs.tags }}
97110
labels: ${{ steps.meta.outputs.labels }}
98-
load: true
99-
# TODO: Uncomment the following line when we are ready to push (multi-arch doesn't work woth "load")
100-
# platforms: "linux/amd64,linux/arm64,linux/ppc64le, linux/s390x"
111+
platforms: ${{ github.event_name != 'pull_request' && env.platforms || '' }}
112+
load: ${{ github.event_name == 'pull_request' }}
113+
push: ${{ github.event_name != 'pull_request' }}
101114
pull: true
102115
build-args: |
103116
VERSION=${{ steps.var.outputs.version }}
104117
- name: Run Trivy vulnerability scanner
105-
uses: aquasecurity/[email protected].1
118+
uses: aquasecurity/[email protected].3
106119
continue-on-error: true
107120
with:
108121
image-ref: nginx/nginx-ingress-operator:${{ steps.meta.outputs.version }}
109-
format: 'template'
110-
template: '@/contrib/sarif.tpl'
122+
format: 'sarif'
111123
output: 'trivy-results.sarif'
112124
ignore-unfixed: 'true'
113125
- name: Upload Trivy scan results to GitHub Security tab
@@ -116,7 +128,7 @@ jobs:
116128
with:
117129
sarif_file: 'trivy-results.sarif'
118130
- name: Upload Scan Results
119-
uses: actions/upload-artifact@v2
131+
uses: actions/upload-artifact@v3
120132
continue-on-error: true
121133
with:
122134
name: 'trivy-results.sarif'

.github/workflows/dockerhub-description.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,13 @@ jobs:
1515
dockerHubDescription:
1616
runs-on: ubuntu-20.04
1717
steps:
18-
- uses: actions/checkout@v2
18+
- uses: actions/checkout@v3
1919

2020
- name: Modify readme for DockerHub
2121
run: |
2222
sed -i '1,2d' README.md
23-
2423
- name: Docker Hub Description
25-
uses: peter-evans/dockerhub-description@v2
24+
uses: peter-evans/dockerhub-description@v3
2625
with:
2726
username: ${{ secrets.DOCKER_USERNAME }}
2827
password: ${{ secrets.DOCKER_PASSWORD }}

.github/workflows/fossa.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
runs-on: ubuntu-20.04
2020
steps:
2121
- name: Checkout Repository
22-
uses: actions/checkout@v2
22+
uses: actions/checkout@v3
2323
- name: Scan
2424
uses: fossas/fossa-action@v1
2525
with:

.github/workflows/stale.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ jobs:
77
stale:
88
runs-on: ubuntu-20.04
99
steps:
10-
- uses: actions/stale@v4
10+
- uses: actions/stale@v5
1111
with:
1212
repo-token: ${{ secrets.GITHUB_TOKEN }}
1313
stale-issue-message: 'This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 10 days.'

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM registry.redhat.io/openshift4/ose-helm-operator:v4.10
1+
FROM quay.io/operator-framework/helm-operator:v1.16.0
22

33
ARG VERSION
44

Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,3 +192,8 @@ catalog-build: opm ## Build a catalog image.
192192
.PHONY: catalog-push
193193
catalog-push: ## Push a catalog image.
194194
$(MAKE) docker-push IMG=$(CATALOG_IMG)
195+
196+
# Get medatada to prepare the bundle to be submitted at https://github.com/redhat-openshift-ecosystem/certified-operators/
197+
.PHONY: get-metadata-certification
198+
get-metadata-certification:
199+
@./hack/get_image_info.sh ${IMAGE_TAG_BASE} ${VERSION}

README.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Note: The NGINX Ingress Operator works only for NGINX Ingress Controller version
3131

3232
1. Install the NGINX Ingress Operator. See [docs](./docs/installation.md).
3333
<br> NOTE: To use TransportServers as part of your NGINX Ingress Controller configuration, a GlobalConfiguration resource must be created *before* starting the Operator - [see the notes](./examples/deployment-oss-min/README.md#TransportServers)
34-
2. Create a default server secret on the cluster - an example yaml for this can be found in the [examples folder](https://github.com/nginxinc/nginx-ingress-operator-helm/blob/v1.0.0/examples/default-server-secret.yaml)
34+
2. Create a default server secret on the cluster - an example yaml for this can be found in the [examples folder](https://github.com/nginxinc/nginx-ingress-helm-operator/blob/v1.0.0/examples/default-server-secret.yaml)
3535
3. (If using OpenShift) Create the scc resource on the cluster by applying the scc.yaml file found in the `resources` folder of this repo:
3636
```shell
3737
kubectl apply -f https://raw.githubusercontent.com/nginxinc/nginx-ingress-operator-helm/v1.0.0/resources/scc.yaml
@@ -44,6 +44,15 @@ Note: The NGINX Ingress Operator works only for NGINX Ingress Controller version
4444
* Set the `controller.serviceAccount.imagePullSecretName` if applicable
4545
* For full configuration details see the Helm documentation [here](https://docs.nginx.com/nginx-ingress-controller/installation/installation-with-helm/#configuration).
4646

47+
48+
## Notes: Multiple NIC Deployments
49+
* Please see [the NGINX Ingress Controller doumentation](https://docs.nginx.com/nginx-ingress-controller/installation/running-multiple-ingress-controllers/) for general information on running multiple NGINX Ingress Controllers in your cluster.
50+
* To run multiple NIC instances deployed by the NGINX Ingress Operator in your cluster in the same namespace, `rbac.create` should be set to `false`, and the ServiceAccount and ClusterRoleBinding need to be created independently of the deployments. Please note that `controller.serviceAccount.imagePullSecretName` will also be ignored in this configuration, and will need to be configured as part of the independant ServiceAccount creation.
51+
* The ClusterRoleBinding needs to configured to bind to the `nginx-ingress-operator-nginx-ingress-admin` ClusterRole.
52+
* See [RBAC example spec](../resources/rbac-example.yaml) for an example ServiceAccount and ClusterRoleBinding manifest.
53+
* To run multiple NIC instances deployed by the NGINX Ingress Operator in your cluster in any namespace but sharing an IngressClass, `controller.ingressClass` should be set to an empty string and the IngressClass resource needs to be created independantly of the deployments.Please note that `controller.setAsDefaultIngress` will also be ignored in this configuration, and will need to be configured as part of the independant IngressClass creation.
54+
* See [IngressClass example spec](../resources/ingress-class.yaml) for an example IngressClass manifest.
55+
4756
## Upgrades
4857

4958
See [upgrade docs](./docs/upgrades)

bundle/manifests/nginx-ingress-operator.clusterserviceversion.yaml

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -139,17 +139,19 @@ metadata:
139139
containerImage: nginx/nginx-ingress-operator:1.0.0
140140
description: The NGINX Ingress Operator is a Kubernetes/OpenShift component which
141141
deploys and manages one or more NGINX/NGINX Plus Ingress Controllers
142-
operators.operatorframework.io/builder: operator-sdk-v1.10.1-ocp
142+
operators.operatorframework.io/builder: operator-sdk-v1.16.0-ocp
143143
operators.operatorframework.io/project_layout: helm.sdk.operatorframework.io/v1
144-
repository: https://github.com/nginxinc/nginx-ingress-operator
144+
repository: https://github.com/nginxinc/nginx-ingress-helm-operator
145145
support: NGINX Inc.
146146
name: nginx-ingress-operator.v1.0.0
147-
namespace: openshift-operators
147+
namespace: placeholder
148148
spec:
149149
apiservicedefinitions: {}
150150
customresourcedefinitions:
151151
owned:
152-
- displayName: Nginx Ingress Controller
152+
- description: The `NginxIngress` Custom Resource is the definition of a deployment
153+
of the Ingress Controller.
154+
displayName: Nginx Ingress Controller
153155
kind: NginxIngress
154156
name: nginxingresses.charts.nginx.org
155157
version: v1alpha1
@@ -287,6 +289,8 @@ spec:
287289
strategy: {}
288290
template:
289291
metadata:
292+
annotations:
293+
kubectl.kubernetes.io/default-container: manager
290294
labels:
291295
control-plane: controller-manager
292296
spec:
@@ -296,7 +300,7 @@ spec:
296300
- --metrics-bind-address=127.0.0.1:8080
297301
- --leader-elect
298302
- --leader-election-id=nginx-ingress-operator
299-
image: registry.connect.redhat.com/nginx/nginx-ingress-operator:1.0.0
303+
image: nginx/nginx-ingress-operator:1.0.0
300304
livenessProbe:
301305
httpGet:
302306
path: /healthz
@@ -310,15 +314,21 @@ spec:
310314
port: 8081
311315
initialDelaySeconds: 5
312316
periodSeconds: 10
313-
resources: {}
317+
resources:
318+
limits:
319+
cpu: 500m
320+
memory: 256Mi
321+
requests:
322+
cpu: 250m
323+
memory: 128Mi
314324
securityContext:
315325
allowPrivilegeEscalation: false
316326
- args:
317327
- --secure-listen-address=0.0.0.0:8443
318328
- --upstream=http://127.0.0.1:8080/
319329
- --logtostderr=true
320330
- --v=10
321-
image: registry.redhat.io/openshift4/ose-kube-rbac-proxy:v4.9
331+
image: gcr.io/kubebuilder/kube-rbac-proxy:v0.8.0
322332
name: kube-rbac-proxy
323333
ports:
324334
- containerPort: 8443
@@ -382,7 +392,7 @@ spec:
382392
- openshift
383393
links:
384394
- name: Nginx Ingress Operator
385-
url: https://github.com/nginxinc/nginx-ingress-operator
395+
url: https://github.com/nginxinc/nginx-ingress-helm-operator
386396
maintainers:
387397
388398
name: NGINX Inc

config/default/manager_auth_proxy_patch.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ spec:
1010
spec:
1111
containers:
1212
- name: kube-rbac-proxy
13-
image: registry.redhat.io/openshift4/ose-kube-rbac-proxy:v4.10
13+
image: gcr.io/kubebuilder/kube-rbac-proxy:v0.8.0
1414
args:
1515
- "--secure-listen-address=0.0.0.0:8443"
1616
- "--upstream=http://127.0.0.1:8080/"

config/manager/manager.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@ spec:
5151
resources:
5252
limits:
5353
cpu: 500m
54-
memory: 128Mi
54+
memory: 256Mi
5555
requests:
56-
cpu: 10m
57-
memory: 64Mi
56+
cpu: 250m
57+
memory: 128Mi
5858
serviceAccountName: controller-manager
5959
terminationGracePeriodSeconds: 10

0 commit comments

Comments
 (0)