Skip to content

Commit

Permalink
upgrade to latest dependencies
Browse files Browse the repository at this point in the history
bumping knative.dev/caching bb31986...68ad45e:
  > 68ad45e Update community files (# 872)
bumping knative.dev/hack 3b6d644...0914314:
  > 0914314 Update community files (# 384)
bumping knative.dev/pkg fce44ea...8119179:
  > 8119179 Update community files (# 3050)
  > 58135c2 Extra logging for leases (# 3049)
bumping knative.dev/networking 41aa208...85e269d:
  > 85e269d Update community files (# 988)
bumping knative.dev/serving 2fd8465...facee04:
  > facee04 Update net-istio nightly (# 15313)
  > 09b4cd3 use cgr.dev/chainguard/static:latest which is nonroot (# 15310)
  > 30a77d1 Add affinity-rules feature to configmap config-deployment (# 15250)
  > 10b9152 Update net-gateway-api nightly (# 15307)
  > 19055d5 upgrade to latest dependencies (# 15306)
  > 3e53acc Run system-internal-tls tests only for kourier (# 15299)
  > 5a3aa98 Update net-kourier nightly (# 15303)
  > 4c71c49 Update net-istio nightly (# 15301)
  > d3f9a04 Update net-contour nightly (# 15302)
  > 57d2a26 Update net-gateway-api nightly (# 15300)
  > bb51203 upgrade to latest dependencies (# 15297)

Signed-off-by: Knative Automation <[email protected]>
  • Loading branch information
knative-automation committed Jun 7, 2024
1 parent 93bec4d commit 47e148b
Show file tree
Hide file tree
Showing 5 changed files with 68 additions and 21 deletions.
10 changes: 5 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ require (
k8s.io/client-go v0.29.2
k8s.io/code-generator v0.29.2
k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00
knative.dev/caching v0.0.0-20240603132637-bb31986d9396
knative.dev/hack v0.0.0-20240529131459-3b6d6441e7ea
knative.dev/networking v0.0.0-20240603133819-41aa2087242d
knative.dev/pkg v0.0.0-20240603145758-fce44ead15bd
knative.dev/serving v0.41.1-0.20240603213049-2fd8465334ec
knative.dev/caching v0.0.0-20240607132037-68ad45e9f32d
knative.dev/hack v0.0.0-20240607132042-09143140a254
knative.dev/networking v0.0.0-20240607132834-85e269dff522
knative.dev/pkg v0.0.0-20240607130909-8119179a6091
knative.dev/serving v0.41.1-0.20240607120918-facee04dbae0
)

require (
Expand Down
20 changes: 10 additions & 10 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -799,16 +799,16 @@ k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 h1:aVUu9fTY98ivBPKR9Y5w/A
k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00/go.mod h1:AsvuZPBlUDVuCdzJ87iajxtXuR9oktsTctW/R9wwouA=
k8s.io/utils v0.0.0-20240102154912-e7106e64919e h1:eQ/4ljkx21sObifjzXwlPKpdGLrCfRziVtos3ofG/sQ=
k8s.io/utils v0.0.0-20240102154912-e7106e64919e/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
knative.dev/caching v0.0.0-20240603132637-bb31986d9396 h1:X61lwvuMQO6/4M9/PIq1PMu+ewnH5DtWW+m1h4lamm0=
knative.dev/caching v0.0.0-20240603132637-bb31986d9396/go.mod h1:QWHfHmBIjx7qoM67avt+J1o+i7AB+k6BklTifNFQpRY=
knative.dev/hack v0.0.0-20240529131459-3b6d6441e7ea h1:iWW6SNMrVd2hI5Y+ltKIEzXVedoQLL86b23dS5fkvXs=
knative.dev/hack v0.0.0-20240529131459-3b6d6441e7ea/go.mod h1:yk2OjGDsbEnQjfxdm0/HJKS2WqTLEFg/N6nUs6Rqx3Q=
knative.dev/networking v0.0.0-20240603133819-41aa2087242d h1:B0psbCJrgnQLE8fibEga8NHE04Ay6L8CctdG4a+1CaY=
knative.dev/networking v0.0.0-20240603133819-41aa2087242d/go.mod h1:WS5A291Vy2unZ1L54ZSKBkz/gVzVmIy15cCcdA6PRN4=
knative.dev/pkg v0.0.0-20240603145758-fce44ead15bd h1:SxwfJkmXwxl2PT5xZjtKKHO7URgHuigOoyzelaIGb2g=
knative.dev/pkg v0.0.0-20240603145758-fce44ead15bd/go.mod h1:E5OxJHFsQiW7pL0lVJ02XEVm2QUc0ZVdSUHiarUJHrU=
knative.dev/serving v0.41.1-0.20240603213049-2fd8465334ec h1:aL75B5j+6B7o6tm4fVgWyrystaxzhuGh+2UQZ68RKb8=
knative.dev/serving v0.41.1-0.20240603213049-2fd8465334ec/go.mod h1:DuULKFxW70yqYzYf0+LVla73AXXyB2kgCnMZ61hFFYw=
knative.dev/caching v0.0.0-20240607132037-68ad45e9f32d h1:zFIeqvoGkHFGpXcvlUd/C5zpd3BMGjWEYCBp0rIlj5E=
knative.dev/caching v0.0.0-20240607132037-68ad45e9f32d/go.mod h1:QWHfHmBIjx7qoM67avt+J1o+i7AB+k6BklTifNFQpRY=
knative.dev/hack v0.0.0-20240607132042-09143140a254 h1:1YFnu3U6dWZg0oxm6GU8kEdA9A+BvSWKJO7sg3N0kq8=
knative.dev/hack v0.0.0-20240607132042-09143140a254/go.mod h1:yk2OjGDsbEnQjfxdm0/HJKS2WqTLEFg/N6nUs6Rqx3Q=
knative.dev/networking v0.0.0-20240607132834-85e269dff522 h1:zDtZStHJI3La7jSHUAjN4Jgv0/Yynl51kuchlVLHqzA=
knative.dev/networking v0.0.0-20240607132834-85e269dff522/go.mod h1:WS5A291Vy2unZ1L54ZSKBkz/gVzVmIy15cCcdA6PRN4=
knative.dev/pkg v0.0.0-20240607130909-8119179a6091 h1:islD2GxpRd5ftkkAEgJQBz3aMMGaRdxTnnC/mtAj5Yc=
knative.dev/pkg v0.0.0-20240607130909-8119179a6091/go.mod h1:E5OxJHFsQiW7pL0lVJ02XEVm2QUc0ZVdSUHiarUJHrU=
knative.dev/serving v0.41.1-0.20240607120918-facee04dbae0 h1:8YQtPE79hHspiQFsAErRA2IE2H9VyApnqFAEu/SOcGk=
knative.dev/serving v0.41.1-0.20240607120918-facee04dbae0/go.mod h1:2HcdNS0hQKfa5Y1hPdqoxLNaOQAP6OXSrRFUuceUOJ8=
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0=
rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=
Expand Down
28 changes: 27 additions & 1 deletion vendor/knative.dev/serving/pkg/deployment/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import (
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/resource"
"k8s.io/apimachinery/pkg/util/sets"

cm "knative.dev/pkg/configmap"
)

Expand Down Expand Up @@ -68,6 +67,9 @@ const (
// qpoptions
queueSidecarTokenAudiencesKey = "queue-sidecar-token-audiences"
queueSidecarRooCAKey = "queue-sidecar-rootca"

defaultAffinityTypeKey = "default-affinity-type"
defaultAffinityTypeValue = PreferSpreadRevisionOverNodes
)

var (
Expand Down Expand Up @@ -103,6 +105,7 @@ func defaultConfig() *Config {
DigestResolutionTimeout: digestResolutionTimeoutDefault,
RegistriesSkippingTagResolving: sets.New("kind.local", "ko.local", "dev.local"),
QueueSidecarCPURequest: &QueueSidecarCPURequestDefault,
DefaultAffinityType: defaultAffinityTypeValue,
}
// The following code is needed for ConfigMap testing.
// defaultConfig must match the example in deployment.yaml which includes: `queue-sidecar-token-audiences: ""`
Expand Down Expand Up @@ -164,6 +167,14 @@ func NewConfigFromMap(configMap map[string]string) (*Config, error) {
return nil, fmt.Errorf("digest-resolution-timeout cannot be a non-positive duration, was %v", nc.DigestResolutionTimeout)
}

if affinity, ok := configMap[defaultAffinityTypeKey]; ok {
switch opt := AffinityType(affinity); opt {
case None, PreferSpreadRevisionOverNodes:
nc.DefaultAffinityType = opt
default:
return nil, fmt.Errorf("unsupported %s value: %q", defaultAffinityTypeKey, affinity)
}
}
return nc, nil
}

Expand All @@ -172,6 +183,17 @@ func NewConfigFromConfigMap(config *corev1.ConfigMap) (*Config, error) {
return NewConfigFromMap(config.Data)
}

// AffinityType specifies which affinity requirements will be automatically applied to the PodSpec of all Knative services.
type AffinityType string

const (
// None is used for deactivating affinity configuration for user workloads.
None AffinityType = "none"

// PreferSpreadRevisionOverNodes is used to set pod anti-affinity requirements for user workloads.
PreferSpreadRevisionOverNodes AffinityType = "prefer-spread-revision-over-nodes"
)

// Config includes the configurations for the controller.
type Config struct {
// QueueSidecarImage is the name of the image used for the queue sidecar
Expand Down Expand Up @@ -214,4 +236,8 @@ type Config struct {

// QueueSidecarRootCA is a root certificate to be trusted by the queue proxy sidecar qpoptions.
QueueSidecarRootCA string

// DefaultAffinityType is a string that controls what affinity rules will be automatically
// applied to the PodSpec of all Knative services.
DefaultAffinityType AffinityType
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ import (
"k8s.io/apimachinery/pkg/util/intstr"

apiconfig "knative.dev/serving/pkg/apis/config"
deploymentconfig "knative.dev/serving/pkg/deployment"
)

const certVolumeName = "server-certs"
Expand Down Expand Up @@ -150,6 +151,22 @@ func rewriteUserLivenessProbe(p *corev1.Probe, userPort int) {
}
}

func makePreferSpreadRevisionOverNodes(revisionLabelValue string) *corev1.PodAntiAffinity {
return &corev1.PodAntiAffinity{
PreferredDuringSchedulingIgnoredDuringExecution: []corev1.WeightedPodAffinityTerm{{
Weight: 100,
PodAffinityTerm: corev1.PodAffinityTerm{
TopologyKey: corev1.LabelHostname,
LabelSelector: &metav1.LabelSelector{
MatchLabels: map[string]string{
serving.RevisionLabelKey: revisionLabelValue,
},
},
},
}},
}
}

func makePodSpec(rev *v1.Revision, cfg *config.Config) (*corev1.PodSpec, error) {
queueContainer, err := makeQueueContainer(rev, cfg)
tokenVolume := varTokenVolume.DeepCopy()
Expand Down Expand Up @@ -210,6 +227,10 @@ func makePodSpec(rev *v1.Revision, cfg *config.Config) (*corev1.PodSpec, error)
}
}

if cfg.Deployment.DefaultAffinityType == deploymentconfig.PreferSpreadRevisionOverNodes && rev.Spec.Affinity == nil {
podSpec.Affinity = &corev1.Affinity{PodAntiAffinity: makePreferSpreadRevisionOverNodes(rev.Name)}
}

return podSpec, nil
}

Expand Down
10 changes: 5 additions & 5 deletions vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1102,7 +1102,7 @@ k8s.io/utils/pointer
k8s.io/utils/ptr
k8s.io/utils/strings/slices
k8s.io/utils/trace
# knative.dev/caching v0.0.0-20240603132637-bb31986d9396
# knative.dev/caching v0.0.0-20240607132037-68ad45e9f32d
## explicit; go 1.21
knative.dev/caching/pkg/apis/caching
knative.dev/caching/pkg/apis/caching/v1alpha1
Expand All @@ -1120,10 +1120,10 @@ knative.dev/caching/pkg/client/injection/client/fake
knative.dev/caching/pkg/client/injection/informers/caching/v1alpha1/image
knative.dev/caching/pkg/client/injection/informers/factory
knative.dev/caching/pkg/client/listers/caching/v1alpha1
# knative.dev/hack v0.0.0-20240529131459-3b6d6441e7ea
# knative.dev/hack v0.0.0-20240607132042-09143140a254
## explicit; go 1.18
knative.dev/hack
# knative.dev/networking v0.0.0-20240603133819-41aa2087242d
# knative.dev/networking v0.0.0-20240607132834-85e269dff522
## explicit; go 1.21
knative.dev/networking/pkg
knative.dev/networking/pkg/apis/networking
Expand Down Expand Up @@ -1158,7 +1158,7 @@ knative.dev/networking/pkg/http/stats
knative.dev/networking/pkg/ingress
knative.dev/networking/pkg/k8s
knative.dev/networking/pkg/prober
# knative.dev/pkg v0.0.0-20240603145758-fce44ead15bd
# knative.dev/pkg v0.0.0-20240607130909-8119179a6091
## explicit; go 1.21
knative.dev/pkg/apis
knative.dev/pkg/apis/duck
Expand Down Expand Up @@ -1224,7 +1224,7 @@ knative.dev/pkg/version
knative.dev/pkg/webhook
knative.dev/pkg/webhook/certificates/resources
knative.dev/pkg/websocket
# knative.dev/serving v0.41.1-0.20240603213049-2fd8465334ec
# knative.dev/serving v0.41.1-0.20240607120918-facee04dbae0
## explicit; go 1.21
knative.dev/serving/pkg/activator
knative.dev/serving/pkg/apis/autoscaling
Expand Down

0 comments on commit 47e148b

Please sign in to comment.