-
+
- Launched +
- {{ctrl.instance.launchTime | timestamp}} +
- In +
{{}}
+ - Server Group +
- + {{ctrl.instance.serverGroup}} + +
- Region +
- {{ctrl.instance.region}} +
-
+
- Load Balancer +
- + + + {{ctrl.instance.loadBalancers[0]}} + + +
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e0bc31a0dc3..6c7e292caad 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -4,9 +4,9 @@ on: workflow_call: inputs: BRANCH: - description: "Git branch to fetch code from" + description: Git branch to fetch code from required: true - default: "master" + default: main type: string env: diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml index d978288dd2f..5664f38d1c8 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -1,18 +1,18 @@ -name: "Build Docker image for Deck and push it to GitHub Container Registry" +name: Build Docker image for Deck and push it to GitHub Container Registry on: - workflow_call: - inputs: - IMAGE_VERSION: - description: "Version to use for image tag" - required: true - default: "0.0.0" - type: string - BRANCH: - description: "Git branch to fetch code from" - required: true - default: "master" - type: string + workflow_call: + inputs: + IMAGE_VERSION: + description: Version to use for image tag + required: true + default: "0.0.0" + type: string + BRANCH: + description: Git branch to fetch code from + required: true + default: main + type: string env: CONTAINER_REGISTRY: ghcr.io diff --git a/.github/workflows/pr-build.yml b/.github/workflows/pr-build.yml index b3723a4bfb9..1276031caf6 100644 --- a/.github/workflows/pr-build.yml +++ b/.github/workflows/pr-build.yml @@ -1,28 +1,28 @@ name: Release on: - workflow_dispatch: - inputs: - BRANCH: - description: 'Git branch to fetch code from' - required: true - default: 'master' - type: string - THD_DECK_VERSION: - description: 'Version of THD Deck' - required: true - default: "0.0.0" - type: string + workflow_dispatch: + inputs: + BRANCH: + description: Git branch to fetch code from + required: true + default: main + type: string + THD_DECK_VERSION: + description: Version of THD Deck + required: true + default: "0.0.0" + type: string jobs: build: uses: ./.github/workflows/build.yml with: - BRANCH: ${{ inputs.BRANCH }} + BRANCH: ${{ inputs.BRANCH }} docker: needs: build uses: ./.github/workflows/docker-build.yml with: - BRANCH: ${{ inputs.BRANCH }} - IMAGE_VERSION: ${{ inputs.THD_DECK_VERSION }} \ No newline at end of file + BRANCH: ${{ inputs.BRANCH }} + IMAGE_VERSION: ${{ inputs.THD_DECK_VERSION }} \ No newline at end of file diff --git a/README.md b/README.md index 56e29bce7ea..bba3107014a 100644 --- a/README.md +++ b/README.md @@ -39,6 +39,10 @@ The following external resources can be specified with environment variables: For example, `API_HOST=http://spinnaker.prod.netflix.net yarn start` will run Deck with `http://spinnaker.prod.netflix.net` as the API host. +## Development + +Deck has a combination of Angular and React, but is moving to React only. New changes made to the Deck project should use React wherever possible. + ## Testing To run the tests within the application, run `yarn test`. @@ -77,3 +81,46 @@ those existing conventions if you need an integration point that doesn't already Interested in sharing feedback on Spinnaker's UI or contributing to Deck? Please join us at the [Spinnaker UI SIG](https://github.com/spinnaker/governance/tree/master/sig-ui-ux)! + +
+ Spinnaker cannot create a load balancer for Cloud Run. + A Spinnaker load balancer maps to an Cloud Run Service, which will be created automatically alongside a + Revision. Once created, the Service can be edited as a Load Balancer. +
++ apiVersion: serving.knative.dev/v1 + kind: Service + metadata: + name: spinappcloud1 + namespace: '135005621049' + labels: + cloud.googleapis.com/location: us-central1 + annotations: + run.googleapis.com/client-name: cloud-console + serving.knative.dev/creator: kiran@opsmx.io + serving.knative.dev/lastModifier: kiran@opsmx.io + client.knative.dev/user-image: us-docker.pkg.dev/cloudrun/container/hello + run.googleapis.com/ingress-status: all + spec: + template: + metagoogleapis.com/ingress: all + run.data: + name: spinappcloud1 + annotations: + run.googleapis.com/client-name: cloud-console + autoscaling.knative.dev/minScale: '1' + autoscaling.knative.dev/maxScale: '3' + spec: + containerConcurrency: 80 + timeoutSeconds: 200 + serviceAccountName:spinnaker-cloudrun-account@my-orbit-project-71824.iam.gserviceaccount.com + containers: + - image:us-docker.pkg.dev/cloudrun/container/hello + ports: + - name: http1 + containerPort: 8080 + resources: + limits: + cpu: 1000m + memory: 256Mi ++ `, + }, + + { + key: 'cloudrun.serverGroup.detail', + value: + ' (Optional) Detail is a string of free-form alphanumeric characters and hyphens to describe any other variables.', + }, + { + key: 'cloudrun.serverGroup.configFiles', + value: `
The contents of a Cloud Run Service yaml
`, + }, + { + key: 'cloudrun.loadBalancer.allocations', + value: 'An allocation is the percent of traffic directed to a server group.', + }, +]; + +helpContents.forEach((entry) => HelpContentsRegistry.register(entry.key, entry.value)); diff --git a/packages/cloudrun/src/index.ts b/packages/cloudrun/src/index.ts new file mode 100644 index 00000000000..e0595fbf9f4 --- /dev/null +++ b/packages/cloudrun/src/index.ts @@ -0,0 +1,3 @@ +export * from './cloudrun.module'; +export * from './serverGroup'; +export * from './loadBalancer'; diff --git a/packages/cloudrun/src/instance/details/details.controller.ts b/packages/cloudrun/src/instance/details/details.controller.ts new file mode 100644 index 00000000000..d8fa5a8f555 --- /dev/null +++ b/packages/cloudrun/src/instance/details/details.controller.ts @@ -0,0 +1,84 @@ +import type { IController, IQService } from 'angular'; +import { module } from 'angular'; +import { flattenDeep } from 'lodash'; + +import type { Application, ILoadBalancer } from '@spinnaker/core'; +import { InstanceReader, RecentHistoryService } from '@spinnaker/core'; +import type { ICloudrunInstance } from '../../common/domain'; + +interface InstanceFromStateParams { + instanceId: string; +} + +interface InstanceManager { + account: string; + region: string; + category: string; // e.g., serverGroup, loadBalancer. + name: string; // Parent resource name, not instance name. + instances: ICloudrunInstance[]; +} + +class CloudrunInstanceDetailsController implements IController { + public state = { loading: true }; + public instance: ICloudrunInstance; + public instanceIdNotFound: string; + public upToolTip = "A Cloud Run instance is 'Up' if a load balancer is directing traffic to its server group."; + public outOfServiceToolTip = ` + A Cloud Run instance is 'Out Of Service' if no load balancers are directing traffic to its server group.`; + + public static $inject = ['$q', 'app', 'instance']; + + constructor(private $q: IQService, private app: Application, instance: InstanceFromStateParams) { + this.app + .ready() + .then(() => this.retrieveInstance(instance)) + .then((instanceDetails) => { + this.instance = instanceDetails; + this.state.loading = false; + }) + .catch(() => { + this.instanceIdNotFound = instance.instanceId; + this.state.loading = false; + }); + } + + private retrieveInstance(instance: InstanceFromStateParams): PromiseLikeAllocations must sum to 100%.
++ Deleting ${this.loadBalancer.name} will destroy the following server groups: +
+ Deleting ${this.loadBalancer.name} will destroy ${serverGroupNames[0]}. +
+Account | +Name | +Region | +
---|---|---|
+ |
+ {{ loadBalancer.name }} | +{{ loadBalancer.region }} | +
+ Spinnaker cannot create a load balancer for Cloud Run. A Spinnaker load balancer maps to a Cloud Run service + which along with a Revision are created from Create Server Group page using a +
+yaml file
+ If a service does not exist when a Revision is deployed, it will be created. It will then be editable as a load + balancer within Spinnaker. +
+- Warning: Blue/Green strategy may cause downtime for Deployment kind! -
- )} > )} diff --git a/packages/kubernetes/src/pipelines/stages/traffic/ManifestTrafficStageConfig.tsx b/packages/kubernetes/src/pipelines/stages/traffic/ManifestTrafficStageConfig.tsx index bb98be4cd79..331a72b8a3a 100644 --- a/packages/kubernetes/src/pipelines/stages/traffic/ManifestTrafficStageConfig.tsx +++ b/packages/kubernetes/src/pipelines/stages/traffic/ManifestTrafficStageConfig.tsx @@ -36,7 +36,7 @@ export class ManifestTrafficStageConfig extends React.Component