Skip to content

Commit 88b88d9

Browse files
committed
Initial helm operator
1 parent ac67060 commit 88b88d9

File tree

115 files changed

+9268
-2
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

115 files changed

+9268
-2
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
5+
---
6+
7+
**Describe the bug**
8+
A clear and concise description of what the bug is.
9+
10+
**To Reproduce**
11+
Steps to reproduce the behavior:
12+
1. Deploy x to '...' using some.yaml
13+
2. View logs on '....'
14+
3. See error
15+
16+
**Expected behavior**
17+
A clear and concise description of what you expected to happen.
18+
19+
**Your environment**
20+
* Version of the NGINX Ingress Operator - release version or a specific commit
21+
* Version of the Ingress Controller - release version or a specific commit
22+
* Version of Kubernetes
23+
* Kubernetes platform (e.g. Mini-kube or GCP)
24+
* Using NGINX or NGINX Plus
25+
26+
**Additional context**
27+
Add any other context about the problem here. Any log files you want to share.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
5+
---
6+
7+
**Is your feature request related to a problem? Please describe.**
8+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
9+
10+
**Describe the solution you'd like**
11+
A clear and concise description of what you want to happen.
12+
13+
**Describe alternatives you've considered**
14+
A clear and concise description of any alternative solutions or features you've considered.
15+
16+
**Additional context**
17+
Add any other context or screenshots about the feature request here.

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
### Proposed changes
2+
Describe the use case and detail of the change. If this PR addresses an issue on GitHub, make sure to include a link to that issue here in this description (not in the title of the PR).
3+
4+
### Checklist
5+
Before creating a PR, run through this checklist and mark each as complete.
6+
7+
- [ ] I have read the [CONTRIBUTING](https://github.com/nginxinc/nginx-ingress-operator/blob/master/CONTRIBUTING.md) doc
8+
- [ ] I have added tests that prove my fix is effective or that my feature works
9+
- [ ] I have checked that all unit tests pass after adding my changes
10+
- [ ] I have updated necessary documentation
11+
- [ ] I have rebased my branch onto master
12+
- [ ] I will ensure my PR is targeting the master branch and pulling from my branch from my own fork

.github/dependabot.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
schedule:
6+
interval: weekly
7+
reviewers:
8+
- "nginxinc/kic"
9+
- "ciarams87"
10+
- package-ecosystem: "docker"
11+
directory: "/"
12+
schedule:
13+
interval: weekly
14+
reviewers:
15+
- "nginxinc/kic"

.github/workflows/ci.yml

Lines changed: 173 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,173 @@
1+
name: Continuous Integration
2+
3+
on:
4+
push:
5+
branches:
6+
- 'main'
7+
paths-ignore:
8+
- 'docs/**'
9+
- 'examples/**'
10+
- '**.md'
11+
tags:
12+
- 'v[0-9]+.[0-9]+.[0-9]+'
13+
pull_request:
14+
branches:
15+
- main
16+
types:
17+
- opened
18+
- reopened
19+
- synchronize
20+
paths-ignore:
21+
- 'docs/**'
22+
- 'examples/**'
23+
- '**.md'
24+
25+
concurrency:
26+
group: ${{ github.ref_name }}-ci
27+
cancel-in-progress: true
28+
29+
jobs:
30+
31+
vars:
32+
name: Get variables
33+
runs-on: ubuntu-20.04
34+
outputs:
35+
sha_short: ${{ steps.vars.outputs.sha }}
36+
repo_name: ${{ steps.vars.outputs.repo }}
37+
steps:
38+
- name: Checkout Repository
39+
uses: actions/checkout@v2
40+
- name: Output Variables
41+
id: vars
42+
run: |
43+
echo "::set-output name=sha::$(echo ${GITHUB_SHA} | cut -c1-7)"
44+
echo "::set-output name=repo::$(echo ${GITHUB_REPOSITORY} | cut -d '/' -f 2)"
45+
46+
build:
47+
name: Build Image
48+
runs-on: ubuntu-20.04
49+
needs: vars
50+
steps:
51+
- name: Checkout Repository
52+
uses: actions/checkout@v2
53+
with:
54+
fetch-depth: 0
55+
- name: RedHat Registry Login
56+
uses: docker/login-action@v1
57+
with:
58+
registry: registry.redhat.io
59+
username: ${{ secrets.RH_DOCKER_USERNAME }}
60+
password: ${{ secrets.RH_DOCKER_PASSWORD }}
61+
- name: Docker Buildx
62+
uses: docker/setup-buildx-action@v1
63+
- name: Docker meta
64+
id: meta
65+
uses: docker/metadata-action@v3
66+
with:
67+
images: |
68+
nginx/nginx-ingress-operator
69+
tags: |
70+
type=edge
71+
type=ref,event=pr
72+
type=semver,pattern={{version}}
73+
labels: |
74+
org.opencontainers.image.documentation=https://docs.nginx.com/nginx-ingress-controller
75+
org.opencontainers.image.vendor=NGINX Inc <[email protected]>
76+
- name: Output Variables
77+
id: var
78+
run: |
79+
80+
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
89+
echo "::set-output name=version::$operator_version"
90+
- name: Build Image
91+
uses: docker/build-push-action@v2
92+
with:
93+
context: '.'
94+
cache-from: type=gha
95+
cache-to: type=gha,mode=max
96+
tags: ${{ steps.meta.outputs.tags }}
97+
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"
101+
pull: true
102+
build-args: |
103+
VERSION=${{ steps.var.outputs.version }}
104+
- name: Run Trivy vulnerability scanner
105+
uses: aquasecurity/[email protected]
106+
continue-on-error: true
107+
with:
108+
image-ref: nginx/nginx-ingress-operator:${{ steps.meta.outputs.version }}
109+
format: 'template'
110+
template: '@/contrib/sarif.tpl'
111+
output: 'trivy-results.sarif'
112+
ignore-unfixed: 'true'
113+
- name: Upload Trivy scan results to GitHub Security tab
114+
uses: github/codeql-action/upload-sarif@v1
115+
continue-on-error: true
116+
with:
117+
sarif_file: 'trivy-results.sarif'
118+
- name: Upload Scan Results
119+
uses: actions/upload-artifact@v2
120+
continue-on-error: true
121+
with:
122+
name: 'trivy-results.sarif'
123+
path: 'trivy-results.sarif'
124+
if: always()
125+
126+
127+
notify:
128+
name: Notify
129+
runs-on: ubuntu-20.04
130+
needs: [vars, build]
131+
if: always() && github.ref == 'refs/heads/main'
132+
steps:
133+
- name: Workflow Status
134+
id: check
135+
uses: martialonline/workflow-status@v2
136+
- name: Send Notification
137+
uses: 8398a7/action-slack@v3
138+
if: steps.check.outputs.status == 'failure'
139+
with:
140+
status: custom
141+
custom_payload: |
142+
{
143+
username: 'Github',
144+
icon_emoji: ':octocat:',
145+
mention: 'channel',
146+
attachments: [{
147+
title: '${{ needs.vars.outputs.repo_name }} ${{ github.workflow }} pipeline has failed',
148+
color: '${{ steps.check.outputs.status }}' == 'failure' ? 'danger' : 'warning',
149+
fields: [{
150+
title: 'Commit Hash',
151+
value: '${{ needs.vars.outputs.sha_short }}',
152+
short: true
153+
},
154+
{
155+
title: 'Author',
156+
value: '${{ github.actor }}',
157+
short: true
158+
},
159+
{
160+
title: 'Commit Message',
161+
value: `${{ github.event.head_commit.message }}`,
162+
short: false
163+
},
164+
{
165+
title: 'Pipeline URL',
166+
value: 'https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}',
167+
short: false
168+
}]
169+
}]
170+
}
171+
env:
172+
GITHUB_TOKEN: ${{ github.token }}
173+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Update Docker Hub Description
2+
on:
3+
push:
4+
branches:
5+
- main
6+
paths:
7+
- README.md
8+
- .github/workflows/dockerhub-description.yml
9+
10+
concurrency:
11+
group: ${{ github.ref_name }}-dockerhub-description
12+
cancel-in-progress: true
13+
14+
jobs:
15+
dockerHubDescription:
16+
runs-on: ubuntu-20.04
17+
steps:
18+
- uses: actions/checkout@v2
19+
20+
- name: Modify readme for DockerHub
21+
run: |
22+
sed -i '1,2d' README.md
23+
24+
- name: Docker Hub Description
25+
uses: peter-evans/dockerhub-description@v2
26+
with:
27+
username: ${{ secrets.DOCKER_USERNAME }}
28+
password: ${{ secrets.DOCKER_PASSWORD }}
29+
repository: nginx/nginx-ingress-helm-operator
30+
short-description: ${{ github.event.repository.description }}

.github/workflows/fossa.yml

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
name: Fossa
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths-ignore:
8+
- '**.md'
9+
- 'LICENSE'
10+
11+
concurrency:
12+
group: ${{ github.ref_name }}-fossa
13+
cancel-in-progress: true
14+
15+
jobs:
16+
17+
scan:
18+
name: Fossa
19+
runs-on: ubuntu-20.04
20+
steps:
21+
- name: Checkout Repository
22+
uses: actions/checkout@v2
23+
- name: Scan
24+
uses: fossas/fossa-action@v1
25+
with:
26+
api-key: ${{ secrets.FOSSA_TOKEN }}
27+
28+
notify:
29+
name: Notify
30+
runs-on: ubuntu-20.04
31+
needs: scan
32+
if: always()
33+
steps:
34+
- name: Workflow Status
35+
id: check
36+
uses: martialonline/workflow-status@v2
37+
- name: Output Variables
38+
id: commit
39+
run: |
40+
echo "::set-output name=sha::$(echo ${GITHUB_SHA} | cut -c1-7)"
41+
echo "::set-output name=repo::${GITHUB_REPOSITORY#*/}"
42+
- name: Send Notification
43+
uses: 8398a7/action-slack@v3
44+
if: steps.check.outputs.status == 'failure'
45+
with:
46+
status: custom
47+
custom_payload: |
48+
{
49+
username: 'Fossa Scan',
50+
icon_emoji: ':fossa:',
51+
mention: 'channel',
52+
attachments: [{
53+
title: '[${{ steps.commit.outputs.repo }}] ${{ github.workflow }} license scan has failed',
54+
color: 'danger',
55+
fields: [{
56+
title: 'Commit Hash',
57+
value: '${{ steps.commit.outputs.sha }}',
58+
short: true
59+
},
60+
{
61+
title: 'Author',
62+
value: '${{ github.actor }}',
63+
short: true
64+
},
65+
{
66+
title: 'Job URL',
67+
value: 'https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}',
68+
short: false
69+
}]
70+
}]
71+
}
72+
env:
73+
GITHUB_TOKEN: ${{ github.token }}
74+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: Release Drafter
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
types: [opened, reopened, synchronize]
9+
10+
jobs:
11+
update_release_draft:
12+
runs-on: ubuntu-20.04
13+
steps:
14+
- uses: release-drafter/release-drafter@v5
15+
env:
16+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/stale.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: 'Close stale issues and PRs'
2+
on:
3+
schedule:
4+
- cron: '30 1 * * *'
5+
6+
jobs:
7+
stale:
8+
runs-on: ubuntu-20.04
9+
steps:
10+
- uses: actions/stale@v4
11+
with:
12+
repo-token: ${{ secrets.GITHUB_TOKEN }}
13+
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.'
14+
stale-pr-message: 'This PR 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.'
15+
close-issue-message: 'This issue was closed because it has been stalled for 10 days with no activity.'
16+
close-pr-message: 'This PR was closed because it has been stalled for 10 days with no activity.'
17+
stale-issue-label: 'stale'
18+
stale-pr-label: 'stale'
19+
exempt-all-assignees: true
20+
exempt-issue-labels: 'proposal'
21+
operations-per-run: 100
22+
days-before-stale: 90
23+
days-before-close: 10

0 commit comments

Comments
 (0)