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

clean up registry #107

Closed
wonderflow opened this issue May 8, 2021 · 1 comment
Closed

clean up registry #107

wonderflow opened this issue May 8, 2021 · 1 comment

Comments

@wonderflow
Copy link
Collaborator

Make sure all these following Definitions can really work.

  1. add knative as workload and add componentDefinition for it.
  2. fix knative auto scale trait, make it real work
apiVersion: core.oam.dev/v1beta1
kind: TraitDefinition
metadata:
  annotations:
    definition.oam.dev/description: "Auto scale for knative serving"
  name: knative-autoscale
  namespace: vela-system
spec:
  appliesToWorkloads:
    - knative-serving # this should be some knative like workload
  schematic:
    cue:
      template: |-
        import "encoding/json"
        patch: {
          metadata: annotations: {
              "my.autoscale.ann": json.Marshal({
                  "minReplicas": parameter.min
                  "maxReplicas": parameter.max
              })
          }
        }
        parameter: {
          min: *1 | int
          max: *3 | int
        }
  1. fix expose trait and add into kubevela chart as inner trait
apiVersion: core.oam.dev/v1beta1
kind: TraitDefinition
metadata:
  name: expose
  namespace: vela-system
spec:
  schematic:
    cue:
      template: |-
        parameter: [string]: int

        outputs: {
          for k, v in parameter {
              "\(k)": {
                  apiVersion: "v1"
                  kind:       "Service"
                  spec: {
                      selector:
                          app: context.name
                      ports: [{
                          port:       v
                          targetPort: v
                      }]
                  }
              }
          }
        }
  1. Delete the code of PodDisruptionBudgetTrait and write a CUE based trait instead, put it into registry. https://kubernetes.io/docs/tasks/run-application/configure-pdb/
@chivalryq
Copy link
Member

add expose trait done see:kubevela/kubevela#1678

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants