Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce Helm storage backends installation manifests #63

Merged
merged 3 commits into from
Mar 22, 2022

Conversation

pkosiec
Copy link
Member

@pkosiec pkosiec commented Mar 20, 2022

Description

Changes proposed in this pull request:

  • Introduce Helm storage backends installation manifests

Notes

This PR bases on #62, however it assumes the path of the Type manifest is different.

Testing

Option A: UI

  1. Navigate to the UI, select Helm Storage installation and create Action from it. Run it and wait for output.
  2. Repeat the same steps, but with "Advanced configuratiom" - modify additionalInput and run the Action.

Option B: CLI

Prerequisites

  1. Checkout this branch.
  2. Run Capact
  3. Set manifest location to my fork
kubectl set env deploy/capact-hub-public -n capact-system -c hub-public-populator MANIFESTS_SOURCES="github.com/pkosiec/hub-manifests?ref=helm-storage-manifests"
  1. Wait until the manifests are populated

Create & run Action

  1. Create Parameters:

    cat > /tmp/helm-storage-input-params.yaml << ENDOFFILE
    input-parameters: {}
    ENDOFFILE
  2. Create Action:

    capact act create cap.interface.helm.storage.install --name helm-storage -n capact-system --parameters-from-file /tmp/helm-storage-input-params.yaml
  3. Wait for the Action to have the READY_TO_RUN status:

    capact act get helm-storage -n capact-system
  4. Run Action:

    capact act run helm-storage -n capact-system
  5. Watch the Action for completion:

    capact act watch helm-storage -n capact-system
  6. Get output TypeInstances:

    capact act get helm-storage -n capact-system -ojson | jq '.Actions[0].output.typeInstances'

    See the details of the installed Helm release backend:

    HELM_RELEASE_STORAGE_ID=$(capact act get helm-storage -n capact-system -ojson | jq '.Actions[0].output.typeInstances | map(select(.typeRef.path == "cap.type.helm.release.storage"))[0].id' -r)
    capact ti get $HELM_RELEASE_STORAGE_ID -oyaml

    See the details of the installed Helm template backend:

    HELM_TEMPLATE_STORAGE_ID=$(capact act get helm-storage -n capact-system -ojson | jq '.Actions[0].output.typeInstances | map(select(.typeRef.path == "cap.type.helm.template.storage"))[0].id' -r)
    capact ti get $HELM_TEMPLATE_STORAGE_ID -oyaml

You can also run this Action with Action policy to set up additional Parameters. For example, you can pass the following Action Policy:

interface:
  rules:
    - interface:
        path: cap.interface.helm.storage.install
      oneOf:
        - implementationConstraints:
            path: cap.implementation.helm.storage.install
          inject:
            additionalParameters:
              - name: additional-parameters
                value:
                  affinity: {}
                  autoscaling:
                    enabled: false
                    maxReplicas: 100
                    minReplicas: 1
                    targetCPUUtilizationPercentage: 80
                  global:
                    containerRegistry:
                      overrideTag: bb9b779
                      path: ghcr.io/capactio
                  helmReleaseBackend:
                    enabled: true
                    service:
                      port: 50051
                      type: ClusterIP
                  helmTemplateBackend:
                    enabled: true
                    service:
                      port: 50052
                      type: ClusterIP
                  image:
                    name: helm-storage-backend
                    pullPolicy: IfNotPresent
                  imagePullSecrets: []
                  nodeSelector: {}
                  podAnnotations: {}
                  podSecurityContext: {}
                  replicaCount: 1
                  resources:
                    limits:
                      cpu: 200m
                      memory: 64Mi <- Updated value
                    requests:
                      cpu: 30m
                      memory: 16Mi
                  securityContext: {}
                  tolerations: []
    - interface:
        path: cap.*
      oneOf:
        - implementationConstraints:
            requires:
              - path: cap.core.type.platform.kubernetes

But, the easiest way is to do it from UI 🙂

Related issue(s)

Resolves capactio/capact#670

@pkosiec pkosiec added enhancement New feature or request area/hub-manifests Relates to Hub manifests labels Mar 20, 2022
Copy link
Member

@mszostok mszostok left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kudos for described testing scenarios 🚀

manifests/implementation/helm/storage/install.yaml Outdated Show resolved Hide resolved
manifests/implementation/helm/storage/install.yaml Outdated Show resolved Hide resolved
manifests/implementation/helm/storage/install.yaml Outdated Show resolved Hide resolved
manifests/type/helm/template/storage.yaml Outdated Show resolved Hide resolved
@pkosiec pkosiec merged commit df7de74 into capactio:main Mar 22, 2022
@pkosiec pkosiec deleted the helm-storage-manifests branch March 22, 2022 12:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/hub-manifests Relates to Hub manifests enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Setup Helm storage code and manifests
2 participants