mirror of
https://github.com/kemko/nomad.git
synced 2026-01-07 10:55:42 +03:00
cli: update default redis and use nomad service discovery
Closes #12927 Closes #12958 This PR updates the version of redis used in our examples from 3.2 to 7. The old version is very not supported anymore, and we should be setting a good example by using a supported version. The long-form example job is now fixed so that the service stanza uses nomad as the service discovery provider, and so now the job runs without a requirement of having Consul running and configured.
This commit is contained in:
@@ -12,7 +12,7 @@ job "example" {
|
||||
driver = "docker"
|
||||
|
||||
config {
|
||||
image = "redis:3.2"
|
||||
image = "redis:7"
|
||||
ports = ["db"]
|
||||
auth_soft_fail = true
|
||||
}
|
||||
|
||||
@@ -157,8 +157,8 @@ job "example" {
|
||||
}
|
||||
|
||||
# The "service" stanza instructs Nomad to register this task as a service
|
||||
# in the service discovery engine, which is currently Consul. This will
|
||||
# make the service addressable after Nomad has placed it on a host and
|
||||
# in the service discovery engine, which is currently Nomad or Consul. This
|
||||
# will make the service discoverable after Nomad has placed it on a host and
|
||||
# port.
|
||||
#
|
||||
# For more information and examples on the "service" stanza, please see
|
||||
@@ -167,9 +167,10 @@ job "example" {
|
||||
# https://www.nomadproject.io/docs/job-specification/service
|
||||
#
|
||||
service {
|
||||
name = "redis-cache"
|
||||
tags = ["global", "cache"]
|
||||
port = "db"
|
||||
name = "redis-cache"
|
||||
tags = ["global", "cache"]
|
||||
port = "db"
|
||||
provider = "nomad"
|
||||
|
||||
# The "check" stanza instructs Nomad to create a Consul health check for
|
||||
# this service. A sample check is provided here for your convenience;
|
||||
@@ -302,7 +303,7 @@ job "example" {
|
||||
# are specific to each driver, so please see specific driver
|
||||
# documentation for more information.
|
||||
config {
|
||||
image = "redis:3.2"
|
||||
image = "redis:7"
|
||||
ports = ["db"]
|
||||
|
||||
# The "auth_soft_fail" configuration instructs Nomad to try public
|
||||
|
||||
2
command/testdata/example-short-bad.json
vendored
2
command/testdata/example-short-bad.json
vendored
@@ -23,7 +23,7 @@
|
||||
"Lifecycle": null,
|
||||
"Config": {
|
||||
"auth_soft_fail": true,
|
||||
"image": "redis:3.2",
|
||||
"image": "redis:7",
|
||||
"ports": [
|
||||
"db"
|
||||
]
|
||||
|
||||
2
command/testdata/example-short.json
vendored
2
command/testdata/example-short.json
vendored
@@ -26,7 +26,7 @@
|
||||
"Lifecycle": null,
|
||||
"Config": {
|
||||
"auth_soft_fail": true,
|
||||
"image": "redis:3.2",
|
||||
"image": "redis:7",
|
||||
"ports": [
|
||||
"db"
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user