Skip to content

spike: investigate requested resource flickering status state #693

@senglezou

Description

@senglezou

During the work of adding a guide of how to use multiple destinations, when I deployed the following in my kind clusters, we have observed that the requested resource was flickering between available and unavailable. This was due to an error in the terraform. And it should be just marked as Unavailable instead of flickering back and forth.

In order to replicate the behaviour:

  1. install ske (was using version 0.42)
  2. Create a gitstatestore and destination:
---
apiVersion: v1
kind: Secret
metadata:
  name: git-credentials
  namespace: default
type: Opaque
stringData:
  username: xxxxxxxxx
  password: xxxxxxx
---
apiVersion: platform.kratix.io/v1alpha1
kind: GitStateStore
metadata:
  name: workspace-repo
spec:
  authMethod: basicAuth
  branch: main
  secretRef:
    name: git-credentials
    namespace: default
  url: xxxxx
---
apiVersion: v1
kind: Secret
metadata:
  name: tf-credentials
  namespace: default
stringData:
  organization: xxxxx
  token: xxxxxxxx
  workspace: xxxxx
  address: xxxxxx
---
apiVersion: platform.kratix.io/v1alpha1
kind: Destination
metadata:
  name: tfe
  annotations:
    kratix.io/tf-credentials: '{"namespace": "default", "name": "tf-credentials"}'
  labels:
    environment: terraform
    team: team-a
spec:
  path: xxxxxx
  filepath:
    mode: none
  stateStoreRef:
    kind: GitStateStore
    name: workspace-repo
  1. Create and apply the promise and the request the resource
    kratix init tf-module-promise s3-bucket --module-source "terraform-aws-modules/s3-bucket/aws" --module-registry-version 5.10.0 --group syntasso.io --kind S3Bucket --version v1alpha1

Add the destinationSelectors to the promise.yaml after creation. And then request a resource.

apiVersion: example.syntasso.io/v1alpha1
kind: S3
metadata:
  name: examplename
spec:
  team: team-a

Having spec.team will cause the terraform to fail so we should be able to observe and further investigate why the resource keeps flickering between states when it should be just marked Unavailable only

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions