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

feat: add ability to convert a helm chart #736

Merged
merged 3 commits into from
Jun 22, 2023
Merged

Conversation

kentquirk
Copy link
Contributor

Which problem is this PR solving?

  • This gives the convert tool the ability to read config and rules out of a helm chart, convert them, and write them back to a helm chart. All comments are stripped. If that's not cool for you, you'll have to do it manually.

Short description of the changes

  • Add helm command
  • Load the helm chart as a map with YAML
  • Extract config and run it through the config converter, then read that back into a map
  • Extract rules and convert them
  • Put both back into the map
  • Write out the YAML again

@kentquirk kentquirk requested a review from a team as a code owner June 22, 2023 14:41
tools/convert/main.go Show resolved Hide resolved
tools/convert/main.go Show resolved Hide resolved
@TylerHelmuth TylerHelmuth linked an issue Jun 22, 2023 that may be closed by this pull request
@kentquirk kentquirk requested a review from TylerHelmuth June 22, 2023 16:57
@kentquirk
Copy link
Contributor Author

kentquirk commented Jun 22, 2023

Results of running this on the values.yaml in the helm-charts repo:

LiveReload: true
RulesConfigMapName: ""
affinity: {}
autoscaling:
    behavior:
        scaleDown:
            selectPolicy: Disabled
    enabled: false
    maxReplicas: 10
    minReplicas: 3
    targetCPUUtilizationPercentage: 75
config:
    BufferSizes:
        PeerBufferSize: 1000
        UpstreamBufferSize: 1000
    Collection:
        CacheCapacity: 1000
    Debugging:
        AdditionalErrorFields:
            - trace.span_id
    GRPCServerParameters:
        ListenAddr: 0.0.0.0:4317
    General:
        ConfigurationVersion: 2
        MinRefineryVersion: v2.0
    PeerManagement:
        IdentifierInterfaceName: eth0
    PrometheusMetrics:
        Enabled: true
        ListenAddr: 0.0.0.0:9090
    RedisPeerManagement:
        Host: '{{include "refinery.redis.fullname" .}}:6379'
    RefineryTelemetry:
        AddRuleReasonToTrace: true
        AddSpanCountToRoot: false
    StressRelief:
        ActivationLevel: 75
        DeactivationLevel: 25
    Traces:
        BatchTimeout: 1s
deploymentAnnotations: {}
environment: []
extraVolumeMounts: []
extraVolumes: []
fullnameOverride: ""
grpcIngress:
    annotations: {}
    enabled: false
    hosts:
        - host: refinery.local
          path: /
    labels: {}
    tls: []
image:
    pullPolicy: IfNotPresent
    repository: honeycombio/refinery
    tag: ""
imagePullSecrets: []
ingress:
    annotations: {}
    enabled: false
    hosts:
        - host: refinery.local
          path: /
    labels: {}
    tls: []
nameOverride: ""
nodeSelector: {}
podAnnotations: {}
podLabels: {}
podSecurityContext: {}
redis:
    affinity: {}
    annotations: {}
    enabled: true
    image:
        pullPolicy: IfNotPresent
        repository: redis
        tag: 6.2.5
    nodeSelector: {}
    tolerations: []
replicaCount: 3
resources:
    limits:
        cpu: 2000m
        memory: 2Gi
    requests:
        cpu: 500m
        memory: 500Mi
rules:
    RulesVersion: 2
    Samplers:
        __default__:
            DeterministicSampler:
                SampleRate: 1
secretProvider:
    create: false
    name: refinery
    spec: {}
securityContext: {}
service:
    annotations: {}
    grpcPort: 4317
    labels: {}
    port: 80
    type: ClusterIP
serviceAccount:
    annotations: {}
    create: true
    labels: {}
    name: ""
tolerations: []

@kentquirk kentquirk merged commit cb1a436 into main Jun 22, 2023
@kentquirk kentquirk deleted the kent.helm_convert branch June 22, 2023 17:38
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

Successfully merging this pull request may close these issues.

Allow config converter to rewrite Refinery helm chart values.yaml
2 participants