Skip to content

Commit

Permalink
merge & fix conflict
Browse files Browse the repository at this point in the history
Signed-off-by: Gang Liu <[email protected]>
  • Loading branch information
izturn committed Dec 1, 2022
2 parents 2d8ebbb + c412225 commit e7e8ea6
Show file tree
Hide file tree
Showing 45 changed files with 2,347 additions and 1,696 deletions.
15 changes: 15 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "gomod"
directory: "/"
schedule:
interval: "weekly"
labels:
- area/dependency
- release-note/none-required
reviewers:
- projectcontour/maintainers

2 changes: 1 addition & 1 deletion .github/workflows/build_daily.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
env:
GOPROXY: https://proxy.golang.org/
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
GO_VERSION: 1.19.2
GO_VERSION: 1.19.3
jobs:
e2e-envoy-xds:
runs-on: ubuntu-latest
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,13 @@ jobs:
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
# Override language selection by uncommenting this and choosing your languages
uses: github/codeql-action/init@v2
with:
languages: go

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
- name: Autobuild
uses: github/codeql-action/autobuild@v1
uses: github/codeql-action/autobuild@v2

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
uses: github/codeql-action/analyze@v2
16 changes: 9 additions & 7 deletions .github/workflows/prbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@ name: Build and Test Pull Request
# Trigger the workflow on push or pull request
on:
push:
branches-ignore:
- "dependabot/**"
pull_request:
types: [opened, synchronize]

env:
GOPROXY: https://proxy.golang.org/
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
GO_VERSION: 1.19.2
GO_VERSION: 1.19.3
jobs:
lint:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -123,11 +125,11 @@ jobs:
# image to use) for each kubernetes_version value.
include:
- kubernetes_version: "kubernetes:latest"
node_image: "docker.io/kindest/node:v1.25.2@sha256:9be91e9e9cdf116809841fc77ebdb8845443c4c72fe5218f3ae9eb57fdb4bace"
node_image: "docker.io/kindest/node:v1.25.3@sha256:f52781bc0d7a19fb6c405c2af83abfeb311f130707a0e219175677e366cc45d1"
- kubernetes_version: "kubernetes:n-1"
node_image: "docker.io/kindest/node:v1.24.6@sha256:97e8d00bc37a7598a0b32d1fabd155a96355c49fa0d4d4790aab0f161bf31be1"
node_image: "docker.io/kindest/node:v1.24.7@sha256:577c630ce8e509131eab1aea12c022190978dd2f745aac5eb1fe65c0807eb315"
- kubernetes_version: "kubernetes:n-2"
node_image: "docker.io/kindest/node:v1.23.12@sha256:9402cf1330bbd3a0d097d2033fa489b2abe40d479cc5ef47d0b6a6960613148a"
node_image: "docker.io/kindest/node:v1.23.13@sha256:ef453bb7c79f0e3caba88d2067d4196f427794086a7d0df8df4f019d5e336b61"
- config_type: "ConfigmapConfiguration"
use_config_crd: "false"
- config_type: "ContourConfiguration"
Expand Down Expand Up @@ -185,11 +187,11 @@ jobs:
# image to use) for each kubernetes_version value.
include:
- kubernetes_version: "kubernetes:latest"
node_image: "docker.io/kindest/node:v1.25.2@sha256:9be91e9e9cdf116809841fc77ebdb8845443c4c72fe5218f3ae9eb57fdb4bace"
node_image: "docker.io/kindest/node:v1.25.3@sha256:f52781bc0d7a19fb6c405c2af83abfeb311f130707a0e219175677e366cc45d1"
- kubernetes_version: "kubernetes:n-1"
node_image: "docker.io/kindest/node:v1.24.6@sha256:97e8d00bc37a7598a0b32d1fabd155a96355c49fa0d4d4790aab0f161bf31be1"
node_image: "docker.io/kindest/node:v1.24.7@sha256:577c630ce8e509131eab1aea12c022190978dd2f745aac5eb1fe65c0807eb315"
- kubernetes_version: "kubernetes:n-2"
node_image: "docker.io/kindest/node:v1.23.12@sha256:9402cf1330bbd3a0d097d2033fa489b2abe40d479cc5ef47d0b6a6960613148a"
node_image: "docker.io/kindest/node:v1.23.13@sha256:ef453bb7c79f0e3caba88d2067d4196f427794086a7d0df8df4f019d5e336b61"
steps:
- uses: actions/checkout@v3
with:
Expand Down
34 changes: 34 additions & 0 deletions .github/workflows/trivy-scan.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Trivy Scan

on:
# Run weekly
schedule:
- cron: '0 12 * * 1'
# Allow manual runs
workflow_dispatch:

jobs:
trivy-scan:
strategy:
matrix:
branch:
- main
- release-1.23
- release-1.22
- release-1.21
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: ${{ matrix.branch }}
- uses: aquasecurity/[email protected]
with:
security-checks: vuln
scan-type: 'fs'
format: 'sarif'
output: 'trivy-results.sarif'
ignore-unfixed: true
severity: 'HIGH,CRITICAL'
- uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: 'trivy-results.sarif'
26 changes: 26 additions & 0 deletions .github/workflows/welcome-new-contributors.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: 'Welcome New Contributors'

on:
issues:
types: [opened]
pull_request:
types: [opened]

jobs:
welcome-new-contributor:
runs-on: ubuntu-latest
steps:
- name: 'Greet the contributor'
uses: garg3133/welcome-new-contributors@a38583ed8282e23d63d7bf919ca2d9fb95300ca6 # v1.2
with:
token: ${{ secrets.GITHUB_TOKEN }}
issue-message: >
Hey @contributor_name! Thanks for opening your first issue. We appreciate your contribution and welcome you to our community!
We are glad to have you here and to have your input on Contour.
You can also join us on [our mailing list](https://groups.google.com/g/project-contour) and [in our channel](https://kubernetes.slack.com/archives/C8XRH2R4J)
in the [Kubernetes Slack Workspace](https://communityinviter.com/apps/kubernetes/community)
pr-message: >
Hi @contributor_name! Welcome to our community and thank you for opening your first Pull Request.
Someone will review it soon. Thank you for committing to making Contour better.
You can also join us on [our mailing list](https://groups.google.com/g/project-contour) and [in our channel](https://kubernetes.slack.com/archives/C8XRH2R4J)
in the [Kubernetes Slack Workspace](https://communityinviter.com/apps/kubernetes/community)
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ endif
IMAGE_PLATFORMS ?= linux/amd64,linux/arm64

# Base build image to use.
BUILD_BASE_IMAGE ?= golang:1.19.2
BUILD_BASE_IMAGE ?= golang:1.19.3

# Enable build with CGO.
BUILD_CGO_ENABLED ?= 0
Expand Down Expand Up @@ -302,7 +302,7 @@ e2e: | setup-kind-cluster load-contour-image-kind run-e2e cleanup-kind ## Run E2
run-e2e:
CONTOUR_E2E_LOCAL_HOST=$(CONTOUR_E2E_LOCAL_HOST) \
CONTOUR_E2E_IMAGE=$(CONTOUR_E2E_IMAGE) \
ginkgo -tags=e2e -mod=readonly -skip-package=upgrade,bench -keep-going -randomize-suites -randomize-all -slow-spec-threshold=120s -r $(CONTOUR_E2E_PACKAGE_FOCUS)
ginkgo -tags=e2e -mod=readonly -skip-package=upgrade,bench -keep-going -randomize-suites -randomize-all -poll-progress-after=120s -r $(CONTOUR_E2E_PACKAGE_FOCUS)

.PHONY: cleanup-kind
cleanup-kind:
Expand All @@ -326,7 +326,7 @@ upgrade: | install-contour-release load-contour-image-kind run-upgrade cleanup-k
run-upgrade:
CONTOUR_UPGRADE_FROM_VERSION=$(CONTOUR_UPGRADE_FROM_VERSION) \
CONTOUR_E2E_IMAGE=$(CONTOUR_E2E_IMAGE) \
ginkgo -tags=e2e -mod=readonly -randomize-all -slow-spec-threshold=300s -v ./test/e2e/upgrade
ginkgo -tags=e2e -mod=readonly -randomize-all -poll-progress-after=300s -v ./test/e2e/upgrade

.PHONY: check-ingress-conformance
check-ingress-conformance: | install-contour-working run-ingress-conformance cleanup-kind ## Run Ingress controller conformance
Expand All @@ -352,7 +352,7 @@ teardown-gcp-bench-cluster:

.PHONY: run-bench
run-bench:
ginkgo -tags=e2e -mod=readonly -keep-going -randomize-suites -randomize-all -slow-spec-threshold=4h -timeout=5h -r -v ./test/e2e/bench
ginkgo -tags=e2e -mod=readonly -keep-going -randomize-suites -randomize-all -poll-progress-after=4h -timeout=5h -r -v ./test/e2e/bench

.PHONY: bench
bench: deploy-gcp-bench-cluster run-bench teardown-gcp-bench-cluster
Expand Down
46 changes: 45 additions & 1 deletion apis/projectcontour/v1alpha1/contourdeployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
package v1alpha1

import (
appsv1 "k8s.io/api/apps/v1"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
Expand Down Expand Up @@ -74,10 +75,15 @@ type ContourDeploymentSpec struct {
// ContourSettings contains settings for the Contour part of the installation,
// i.e. the xDS server/control plane and associated resources.
type ContourSettings struct {
// Replicas is the desired number of Contour replicas. If unset,
// Deprecated: Use `DeploymentSettings.Replicas` instead.
//
// Replicas is the desired number of Contour replicas. If if unset,
// defaults to 2.
//
// if both `DeploymentSettings.Replicas` and this one is set, use `DeploymentSettings.Replicas`.
//
// +kubebuilder:validation:Minimum=0
// +optional
Replicas int32 `json:"replicas,omitempty"`

// NodePlacement describes node scheduling configuration of Contour pods.
Expand All @@ -104,6 +110,29 @@ type ContourSettings struct {
// More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
// +optional
Resources corev1.ResourceRequirements `json:"resources,omitempty"`

// Deployment describes the settings for running contour as a `Deployment`.
// +optional
Deployment *DeploymentSettings `json:"deployment,omitempty"`
}

// DeploymentSettings contains settings for Deployment resources.
type DeploymentSettings struct {
// Replicas is the desired number of replicas.
//
// +kubebuilder:validation:Minimum=0
Replicas int32 `json:"replicas,omitempty"`

// Strategy describes the deployment strategy to use to replace existing pods with new pods.
// +optional
Strategy *appsv1.DeploymentStrategy `json:"strategy,omitempty"`
}

// DaemonSetSettings contains settings for DaemonSet resources.
type DaemonSetSettings struct {
// Strategy describes the deployment strategy to use to replace existing DaemonSet pods with new pods.
// +optional
UpdateStrategy *appsv1.DaemonSetUpdateStrategy `json:"updateStrategy,omitempty"`
}

// EnvoySettings contains settings for the Envoy part of the installation,
Expand All @@ -116,11 +145,16 @@ type EnvoySettings struct {
// +optional
WorkloadType WorkloadType `json:"workloadType,omitempty"`

// Deprecated: Use `DeploymentSettings.Replicas` instead.
//
// Replicas is the desired number of Envoy replicas. If WorkloadType
// is not "Deployment", this field is ignored. Otherwise, if unset,
// defaults to 2.
//
// if both `DeploymentSettings.Replicas` and this one is set, use `DeploymentSettings.Replicas`.
//
// +kubebuilder:validation:Minimum=0
// +optional
Replicas int32 `json:"replicas,omitempty"`

// NetworkPublishing defines how to expose Envoy to a network.
Expand Down Expand Up @@ -156,6 +190,16 @@ type EnvoySettings struct {
//
// +optional
LogLevel LogLevel `json:"logLevel,omitempty"`

// DaemonSet describes the settings for running envoy as a `DaemonSet`.
// if `WorkloadType` is `Deployment`,it's must be nil
// +optional
DaemonSet *DaemonSetSettings `json:"daemonSet,omitempty"`

// Deployment describes the settings for running envoy as a `Deployment`.
// if `WorkloadType` is `DaemonSet`,it's must be nil
// +optional
Deployment *DeploymentSettings `json:"deployment,omitempty"`
}

// WorkloadType is the type of Kubernetes workload to use for a component.
Expand Down
56 changes: 56 additions & 0 deletions apis/projectcontour/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions changelogs/unreleased/4713-izturn-deprecation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# ContourDeployment.Spec.Contour.Replicas and ContourDeployment.Spec.Envoy.Replicas are deprecated

- `ContourDeployment.Spec.Contour.Replicas` is deprecated and has been replaced by `ContourDeployment.Spec.Contour.Deployment.Replicas`. Users should switch to using the new field. The deprecated field will be removed in a future release. See #4713 for additional details.

- `ContourDeployment.Spec.Envoy.Replicas` is deprecated and has been replaced by `ContourDeployment.Spec.Envoy.Deployment.Replicas`. Users should switch to using the new field. The deprecated field will be removed in a future release. See #4713 for additional details.
1 change: 1 addition & 0 deletions changelogs/unreleased/4713-izturn-small.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add (update)Strategy configurability to ContourDeployment resource for components.
1 change: 1 addition & 0 deletions changelogs/unreleased/4856-sunjayBhatia-small.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Updates Go to 1.19.3, see [release notes here](https://go.dev/doc/devel/release#go1.19.minor).
Loading

0 comments on commit e7e8ea6

Please sign in to comment.