Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
b5414496
Commit
b5414496
authored
Nov 27, 2019
by
GitLab Development
Committed by
Chris Baumbauer
Dec 17, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Upgrade to knative 0.8.1
parent
060e48a7
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
93 additions
and
7 deletions
+93
-7
app/models/clusters/applications/knative.rb
app/models/clusters/applications/knative.rb
+1
-1
changelogs/unreleased/knative-0-9-update.yml
changelogs/unreleased/knative-0-9-update.yml
+5
-0
config/prometheus/common_metrics.yml
config/prometheus/common_metrics.yml
+1
-1
db/post_migrate/20191209215316_knative_0_9_prometheus_update.rb
...t_migrate/20191209215316_knative_0_9_prometheus_update.rb
+13
-0
db/schema.rb
db/schema.rb
+1
-1
spec/controllers/projects/serverless/functions_controller_spec.rb
...trollers/projects/serverless/functions_controller_spec.rb
+16
-0
spec/lib/gitlab/prometheus/queries/knative_invocation_query_spec.rb
...itlab/prometheus/queries/knative_invocation_query_spec.rb
+2
-2
spec/models/clusters/applications/knative_spec.rb
spec/models/clusters/applications/knative_spec.rb
+1
-1
spec/support/helpers/kubernetes_helpers.rb
spec/support/helpers/kubernetes_helpers.rb
+53
-1
No files found.
app/models/clusters/applications/knative.rb
View file @
b5414496
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
module
Clusters
module
Clusters
module
Applications
module
Applications
class
Knative
<
ApplicationRecord
class
Knative
<
ApplicationRecord
VERSION
=
'0.
7
.0'
VERSION
=
'0.
9
.0'
REPOSITORY
=
'https://storage.googleapis.com/triggermesh-charts'
REPOSITORY
=
'https://storage.googleapis.com/triggermesh-charts'
METRICS_CONFIG
=
'https://storage.googleapis.com/triggermesh-charts/istio-metrics.yaml'
METRICS_CONFIG
=
'https://storage.googleapis.com/triggermesh-charts/istio-metrics.yaml'
FETCH_IP_ADDRESS_DELAY
=
30
.
seconds
FETCH_IP_ADDRESS_DELAY
=
30
.
seconds
...
...
changelogs/unreleased/knative-0-9-update.yml
0 → 100644
View file @
b5414496
---
title
:
Update Knative to 0.9.0
merge_request
:
21361
author
:
cab105
type
:
added
config/prometheus/common_metrics.yml
View file @
b5414496
...
@@ -209,6 +209,6 @@ panel_groups:
...
@@ -209,6 +209,6 @@ panel_groups:
weight
:
1
weight
:
1
metrics
:
metrics
:
-
id
:
system_metrics_knative_function_invocation_count
-
id
:
system_metrics_knative_function_invocation_count
query_range
:
'
sum(ceil(rate(istio_requests_total{destination_service_namespace="%{kube_namespace}",
destination_
app
=~"%{function_name}.*"}[1m])*60))'
query_range
:
'
sum(ceil(rate(istio_requests_total{destination_service_namespace="%{kube_namespace}",
destination_
service
=~"%{function_name}.*"}[1m])*60))'
label
:
invocations / minute
label
:
invocations / minute
unit
:
requests
unit
:
requests
db/post_migrate/20191209215316_knative_0_9_prometheus_update.rb
0 → 100644
View file @
b5414496
# frozen_string_literal: true
class
Knative09PrometheusUpdate
<
ActiveRecord
::
Migration
[
5.2
]
DOWNTIME
=
false
def
up
::
Gitlab
::
DatabaseImporters
::
CommonMetrics
::
Importer
.
new
.
execute
end
def
down
# no-op
end
end
db/schema.rb
View file @
b5414496
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,7 @@
#
#
# It's strongly recommended that you check this file into your version control system.
# It's strongly recommended that you check this file into your version control system.
ActiveRecord
::
Schema
.
define
(
version:
2019_12_1
6_1835
32
)
do
ActiveRecord
::
Schema
.
define
(
version:
2019_12_1
7_1606
32
)
do
# These are extensions that must be enabled in order to support this database
# These are extensions that must be enabled in order to support this database
enable_extension
"pg_trgm"
enable_extension
"pg_trgm"
...
...
spec/controllers/projects/serverless/functions_controller_spec.rb
View file @
b5414496
...
@@ -149,6 +149,14 @@ describe Projects::Serverless::FunctionsController do
...
@@ -149,6 +149,14 @@ describe Projects::Serverless::FunctionsController do
include_examples
'GET #show with valid data'
include_examples
'GET #show with valid data'
end
end
context
'on Knative 0.9.0'
do
before
do
prepare_knative_stubs
(
knative_09_service
(
knative_stub_options
))
end
include_examples
'GET #show with valid data'
end
end
end
end
end
...
@@ -210,6 +218,14 @@ describe Projects::Serverless::FunctionsController do
...
@@ -210,6 +218,14 @@ describe Projects::Serverless::FunctionsController do
include_examples
'GET #index with data'
include_examples
'GET #index with data'
end
end
context
'on Knative 0.9.0'
do
before
do
prepare_knative_stubs
(
knative_09_service
(
knative_stub_options
))
end
include_examples
'GET #index with data'
end
end
end
def
prepare_knative_stubs
(
knative_service
)
def
prepare_knative_stubs
(
knative_service
)
...
...
spec/lib/gitlab/prometheus/queries/knative_invocation_query_spec.rb
View file @
b5414496
...
@@ -16,12 +16,12 @@ describe Gitlab::Prometheus::Queries::KnativeInvocationQuery do
...
@@ -16,12 +16,12 @@ describe Gitlab::Prometheus::Queries::KnativeInvocationQuery do
create
(
:prometheus_metric
,
create
(
:prometheus_metric
,
:common
,
:common
,
identifier: :system_metrics_knative_function_invocation_count
,
identifier: :system_metrics_knative_function_invocation_count
,
query:
'sum(ceil(rate(istio_requests_total{destination_service_namespace="%{kube_namespace}", destination_
app
=~"%{function_name}.*"}[1m])*60))'
)
query:
'sum(ceil(rate(istio_requests_total{destination_service_namespace="%{kube_namespace}", destination_
service
=~"%{function_name}.*"}[1m])*60))'
)
end
end
it
'has the query, but no data'
do
it
'has the query, but no data'
do
expect
(
client
).
to
receive
(
:query_range
).
with
(
expect
(
client
).
to
receive
(
:query_range
).
with
(
'sum(ceil(rate(istio_requests_total{destination_service_namespace="test-ns", destination_
app
=~"test-name.*"}[1m])*60))'
,
'sum(ceil(rate(istio_requests_total{destination_service_namespace="test-ns", destination_
service
=~"test-name.*"}[1m])*60))'
,
hash_including
(
:start
,
:stop
)
hash_including
(
:start
,
:stop
)
)
)
...
...
spec/models/clusters/applications/knative_spec.rb
View file @
b5414496
...
@@ -123,7 +123,7 @@ describe Clusters::Applications::Knative do
...
@@ -123,7 +123,7 @@ describe Clusters::Applications::Knative do
subject
{
knative
.
install_command
}
subject
{
knative
.
install_command
}
it
'is initialized with latest version'
do
it
'is initialized with latest version'
do
expect
(
subject
.
version
).
to
eq
(
'0.
7
.0'
)
expect
(
subject
.
version
).
to
eq
(
'0.
9
.0'
)
end
end
it_behaves_like
'a command'
it_behaves_like
'a command'
...
...
spec/support/helpers/kubernetes_helpers.rb
View file @
b5414496
...
@@ -351,7 +351,7 @@ module KubernetesHelpers
...
@@ -351,7 +351,7 @@ module KubernetesHelpers
def
kube_knative_services_body
(
**
options
)
def
kube_knative_services_body
(
**
options
)
{
{
"kind"
=>
"List"
,
"kind"
=>
"List"
,
"items"
=>
[
knative_0
7
_service
(
options
)]
"items"
=>
[
knative_0
9
_service
(
options
)]
}
}
end
end
...
@@ -539,6 +539,58 @@ module KubernetesHelpers
...
@@ -539,6 +539,58 @@ module KubernetesHelpers
"podcount"
=>
0
}
"podcount"
=>
0
}
end
end
# noinspection RubyStringKeysInHashInspection
def
knative_09_service
(
name:
'kubetest'
,
namespace:
'default'
,
domain:
'example.com'
,
description:
'a knative service'
,
environment:
'production'
)
{
"apiVersion"
=>
"serving.knative.dev/v1alpha1"
,
"kind"
=>
"Service"
,
"metadata"
=>
{
"annotations"
=>
{
"serving.knative.dev/creator"
=>
"system:serviceaccount:
#{
namespace
}
:
#{
namespace
}
-service-account"
,
"serving.knative.dev/lastModifier"
=>
"system:serviceaccount:
#{
namespace
}
:
#{
namespace
}
-service-account"
},
"creationTimestamp"
=>
"2019-10-22T21:19:13Z"
,
"generation"
=>
1
,
"labels"
=>
{
"service"
=>
name
},
"name"
=>
name
,
"namespace"
=>
namespace
,
"resourceVersion"
=>
"289726"
,
"selfLink"
=>
"/apis/serving.knative.dev/v1alpha1/namespaces/
#{
namespace
}
/services/
#{
name
}
"
,
"uid"
=>
"988349fa-f511-11e9-9ea1-42010a80005e"
},
"spec"
=>
{
"template"
=>
{
"metadata"
=>
{
"annotations"
=>
{
"Description"
=>
description
},
"creationTimestamp"
=>
"2019-10-22T21:19:12Z"
,
"labels"
=>
{
"service"
=>
name
}
},
"spec"
=>
{
"containers"
=>
[{
"env"
=>
[{
"name"
=>
"timestamp"
,
"value"
=>
"2019-10-22 21:19:12"
}],
"image"
=>
"image_name"
,
"name"
=>
"user-container"
,
"resources"
=>
{}
}],
"timeoutSeconds"
=>
300
}
},
"traffic"
=>
[{
"latestRevision"
=>
true
,
"percent"
=>
100
}]
},
"status"
=>
{
"address"
=>
{
"url"
=>
"http://
#{
name
}
.
#{
namespace
}
.svc.cluster.local"
},
"conditions"
=>
[{
"lastTransitionTime"
=>
"2019-10-22T21:20:15Z"
,
"status"
=>
"True"
,
"type"
=>
"ConfigurationsReady"
},
{
"lastTransitionTime"
=>
"2019-10-22T21:20:15Z"
,
"status"
=>
"True"
,
"type"
=>
"Ready"
},
{
"lastTransitionTime"
=>
"2019-10-22T21:20:15Z"
,
"status"
=>
"True"
,
"type"
=>
"RoutesReady"
}],
"latestCreatedRevisionName"
=>
"
#{
name
}
-92tsj"
,
"latestReadyRevisionName"
=>
"
#{
name
}
-92tsj"
,
"observedGeneration"
=>
1
,
"traffic"
=>
[{
"latestRevision"
=>
true
,
"percent"
=>
100
,
"revisionName"
=>
"
#{
name
}
-92tsj"
}],
"url"
=>
"http://
#{
name
}
.
#{
namespace
}
.
#{
domain
}
"
},
"environment_scope"
=>
environment
,
"cluster_id"
=>
5
,
"podcount"
=>
0
}
end
# noinspection RubyStringKeysInHashInspection
# noinspection RubyStringKeysInHashInspection
def
knative_05_service
(
name:
'kubetest'
,
namespace:
'default'
,
domain:
'example.com'
,
description:
'a knative service'
,
environment:
'production'
)
def
knative_05_service
(
name:
'kubetest'
,
namespace:
'default'
,
domain:
'example.com'
,
description:
'a knative service'
,
environment:
'production'
)
{
"apiVersion"
=>
"serving.knative.dev/v1alpha1"
,
{
"apiVersion"
=>
"serving.knative.dev/v1alpha1"
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment