Skip to content

Latest commit

 

History

History
162 lines (148 loc) · 10.5 KB

Service.md

File metadata and controls

162 lines (148 loc) · 10.5 KB
id title
Service
Service

Provides a Cloud Run Service:

provider.run.makeService({
  properties: ({ config }) => ({
    apiVersion: "serving.knative.dev/v1",
    kind: "Service",
    metadata: {
      name: "starhackit-server",
    },
    spec: {
      template: {
        metadata: {
          name: "starhackit-server-00005-rud",
          annotations: {
            "autoscaling.knative.dev/maxScale": "100",
          },
        },
        spec: {
          containerConcurrency: 80,
          timeoutSeconds: 300,
          serviceAccountName: `${config.projectNumber()}[email protected]`,
          containers: [
            {
              image: "gcr.io/google-samples/hello-app:1.0",
              resources: {
                limits: {
                  cpu: "2000m",
                  memory: "512Mi",
                },
              },
              ports: [
                {
                  name: "http1",
                  containerPort: 8080,
                },
              ],
            },
          ],
        },
      },
      traffic: [
        {
          percent: 100,
          latestRevision: true,
        },
      ],
    },
  }),
});

Examples

Properties

Used By

List

List all cloud run services with the run::Service type

gc l -t run::Service
Listing resources on 1 provider: google
✓ google
  ✓ Initialising
  ✓ Listing 1/1
┌───────────────────────────────────────────────────────────────────────────────────────────────────┐
│ 1 run::Service from google                                                                        │
├───────────────────────────────────────────────────────────────────────────────────────────────────┤
│ name: starhackit-server                                                                           │
│ managedByUs: Yes                                                                                  │
│ live:                                                                                             │
│   apiVersion: serving.knative.dev/v1                                                              │
│   kind: Service                                                                                   │
│   metadata:                                                                                       │
│     name: starhackit-server                                                                       │
│     namespace: 91170824493                                                                        │
│     selfLink: /apis/serving.knative.dev/v1/namespaces/91170824493/services/starhackit-server      │
│     uid: b5eddd26-9ba7-4e9b-a9ef-7d31d60e89b6                                                     │
│     resourceVersion: AAXSct2QUIs                                                                  │
│     generation: 1                                                                                 │
│     labels:                                                                                       │
│       cloud.googleapis.com/location: us-central1                                                  │
│     annotations:                                                                                  │
│       serving.knative.dev/creator: [email protected]                 │
│       serving.knative.dev/lastModifier: [email protected]            │
│       run.googleapis.com/ingress: all                                                             │
│       run.googleapis.com/ingress-status: all                                                      │
│     creationTimestamp: 2021-12-06T04:41:00.634657Z                                                │
│   spec:                                                                                           │
│     template:                                                                                     │
│       metadata:                                                                                   │
│         name: starhackit-server-00005-rud                                                         │
│         annotations:                                                                              │
│           autoscaling.knative.dev/maxScale: 100                                                   │
│       spec:                                                                                       │
│         containerConcurrency: 80                                                                  │
│         timeoutSeconds: 300                                                                       │
│         serviceAccountName: [email protected]                     │
│         containers:                                                                               │
│           - image: gcr.io/google-samples/hello-app:1.0                                            │
│             resources:                                                                            │
│               limits:                                                                             │
│                 cpu: 2000m                                                                        │
│                 memory: 512Mi                                                                     │
│             ports:                                                                                │
│               - name: http1                                                                       │
│                 containerPort: 8080                                                               │
│     traffic:                                                                                      │
│       - percent: 100                                                                              │
│         latestRevision: true                                                                      │
│   status:                                                                                         │
│     observedGeneration: 1                                                                         │
│     conditions:                                                                                   │
│       - type: Ready                                                                               │
│         status: True                                                                              │
│         lastTransitionTime: 2021-12-06T04:41:08.880523Z                                           │
│       - type: ConfigurationsReady                                                                 │
│         status: True                                                                              │
│         lastTransitionTime: 2021-12-06T04:41:08.049687Z                                           │
│       - type: RoutesReady                                                                         │
│         status: True                                                                              │
│         lastTransitionTime: 2021-12-06T04:41:08.880523Z                                           │
│     latestReadyRevisionName: starhackit-server-00005-rud                                          │
│     latestCreatedRevisionName: starhackit-server-00005-rud                                        │
│     traffic:                                                                                      │
│       - revisionName: starhackit-server-00005-rud                                                 │
│         percent: 100                                                                              │
│         latestRevision: true                                                                      │
│     url: https://starhackit-server-dbxubuk5wa-uc.a.run.app                                        │
│     address:                                                                                      │
│       url: https://starhackit-server-dbxubuk5wa-uc.a.run.app                                      │
│                                                                                                   │
└───────────────────────────────────────────────────────────────────────────────────────────────────┘


List Summary:
Provider: google
┌──────────────────────────────────────────────────────────────────────────────────────────────────┐
│ google                                                                                           │
├──────────────┬───────────────────────────────────────────────────────────────────────────────────┤
│ run::Service │ starhackit-server                                                                 │
└──────────────┴───────────────────────────────────────────────────────────────────────────────────┘
1 resource, 1 type, 1 provider
Command "gc l -t run::Service" executed in 2s