Skip to content

Commit

Permalink
Fixed snippet
Browse files Browse the repository at this point in the history
Signed-off-by: jasonviviano <[email protected]>
  • Loading branch information
jasonviviano committed Nov 6, 2023
1 parent f4f919c commit cc49dae
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 73 deletions.
2 changes: 2 additions & 0 deletions .github/config/en-custom.txt
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,7 @@ radapp
radiuspublic
rbac
rediscaches
RedisCache
readinessProbe
redis
redisCaches
Expand Down Expand Up @@ -616,6 +617,7 @@ ECS
EFS
EIP
EMR
EMPTYCONTAINER
EMRContainers
EMRServerless
ElastiCache
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Add a RedisCache resource with the `resourceProvisioning` mode as `manual`. This

{{< rad file="snippets/app-redis-manual.bicep" embed=true marker="//MANUAL" >}}

Refer to the [Redis resource schema] ({{< ref "/resource-schem/cache/redis >}}) for more details.
Refer to the [Redis resource schema] ({{< ref "reference/resource-schema/cache/redis" >}}) for more details.

{{% /codetab %}}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,74 +42,6 @@ resource container 'Applications.Core/containers@2023-10-01-preview' = {
}
//CONTAINER

resource redis 'apps/Deployment@v1' = {
metadata: {
name: 'redis-${uniqueString(application)}'
}
spec: {
selector: {
matchLabels: {
app: 'redis'
resource: portableRedis.name
}
}
template: {
metadata: {
labels: {
app: 'redis'
resource: portableRedis.name

// Label pods with the application name so `rad run` can find the logs.
'radapp.io/application': application == null ? '' : application
}
}
spec: {
containers: [
{
// This container is the running redis instance.
name: 'redis'
image: 'redis'
ports: [
{
containerPort: 6379
}
]
}
{
// This container will connect to redis and stream logs to stdout for aid in development.
name: 'redis-monitor'
image: 'redis'
args: [
'redis-cli'
'-h'
'localhost'
'MONITOR'
]
}
]
}
}
}
}

resource svc 'core/Service@v1' = {
metadata: {
name: 'redis-${uniqueString(application)}'
}
spec: {
type: 'ClusterIP'
selector: {
app: 'redis'
resource: portableRedis.name
}
ports: [
{
port: 6379
}
]
}
}

//MANUAL
resource portableRedis 'Applications.Datastores/redisCaches@2023-10-01-preview' = {
name: 'redisCache'
Expand All @@ -118,15 +50,18 @@ resource portableRedis 'Applications.Datastores/redisCaches@2023-10-01-preview'
application: application
resourceProvisioning: 'manual'
resources: [{
id: '/planes/kubernetes/local/namespaces/${svc.metadata.namespace}/providers/core/Service/${svc.metadata.name}'
id: '/planes/kubernetes/local/namespaces/service-namespace/providers/core/Service/service-name'
}
{
id: '/planes/kubernetes/local/namespaces/${redis.metadata.namespace}/providers/apps/Deployment/${redis.metadata.name}'
id: '/planes/kubernetes/local/namespaces/redis-namespace/providers/apps/Deployment/redis-name'
}
]
username: 'myusername'
host: `mycache.contoso.com`
port: svc.ports[0].port
host: 'mycache.contoso.com'
port: 8080
secrets: {
password: '******'
}
}
}
//MANUAL

0 comments on commit cc49dae

Please sign in to comment.