瀏覽代碼

moving to published chart

Stefan McShane 2 年之前
父節點
當前提交
3288bfadf4

+ 175 - 197
local/3/existing_values.yaml

@@ -1,207 +1,185 @@
-legacy-web:
-  fullnameOverride: legacy-web
-  albIngress:
-    annotations: null
-    certificate_arn: null
-    custom_paths: []
-    enabled: false
-    external_dns: false
-    group_name: null
-    group_order: null
-    healthcheck_healthy_threshold_count: null
-    healthcheck_interval_seconds: null
-    healthcheck_path: null
-    healthcheck_port: null
-    healthcheck_protocol: null
-    healthcheck_success_codes: null
-    healthcheck_timeout_seconds: null
-    healthcheck_unhealthy_threshold_count: null
-    hosts: []
-    scheme: internet-facing
-    security_groups: null
-    target_node_labels: null
-    target_type: ip
-    wafv2_acl_arn: null
-  auto_deploy: true
-  autoscaling:
-    enabled: false
-    maxReplicas: 10
-    minReplicas: 1
-    targetCPUUtilizationPercentage: 50
-    targetMemoryUtilizationPercentage: 50
-  bluegreen:
-    disablePrimaryDeployment: false
-    enabled: false
-    imageTags: []
-  cloudsql:
-    additionalConnection:
-      connectionName: ""
-      dbPort: 5432
-      enabled: false
+USER-SUPPLIED VALUES:
+albIngress:
+  custom_paths: []
+  enabled: false
+  external_dns: false
+  hosts: []
+  scheme: internet-facing
+  target_type: ip
+auto_deploy: false
+autoscaling:
+  enabled: false
+  maxReplicas: 10
+  minReplicas: 1
+  targetCPUUtilizationPercentage: 50
+  targetMemoryUtilizationPercentage: 50
+bluegreen:
+  disablePrimaryDeployment: false
+  enabled: false
+  imageTags: []
+cloudsql:
+  additionalConnection:
     connectionName: ""
     dbPort: 5432
     enabled: false
-    serviceAccountJSON: ""
-  clusterId: 2
-  container:
-    args: null
-    command: null
-    env: {}
-    lifecycle:
-      postStart: null
-      preStop: null
-    port: 80
-  currentCluster:
-    service:
-      is_aws: false
-      is_do: false
-      is_gcp: false
-  customNodePort:
-    enabled: false
-    port: 30000
-  datadog:
-    enabled: false
-  emptyDir:
+  connectionName: ""
+  dbPort: 5432
+  enabled: false
+  serviceAccountJSON: ""
+clusterId: 32
+container:
+  env:
+    normal: {}
+  lifecycle: {}
+  port: 80
+currentCluster:
+  service:
+    is_aws: false
+    is_do: false
+    is_gcp: false
+customNodePort:
+  enabled: false
+  port: 30000
+datadog:
+  enabled: false
+emptyDir:
+  enabled: false
+  mountPath: /mypath
+enableEDNS0: false
+health:
+  livenessCommand:
+    command: ls -l
     enabled: false
-    mountPath: /mypath
-  health:
-    livenessCommand:
-      command: ls -l
-      enabled: false
-      failureThreshold: 3
-      initialDelaySeconds: 5
-      periodSeconds: 5
-      successThreshold: 1
-      timeoutSeconds: 1
-    livenessProbe:
-      auth:
-        enabled: false
-        password: ""
-        username: ""
-      enabled: false
-      failureThreshold: 3
-      httpHeaders: []
-      initialDelaySeconds: 0
-      path: /livez
-      periodSeconds: 5
-      scheme: HTTP
-      successThreshold: 1
-      timeoutSeconds: 1
-    readinessProbe:
-      auth:
-        enabled: false
-        password: ""
-        username: ""
+    failureThreshold: 3
+    initialDelaySeconds: 5
+    periodSeconds: 5
+    successThreshold: 1
+    timeoutSeconds: 1
+  livenessProbe:
+    auth:
       enabled: false
-      failureThreshold: 3
-      httpHeaders: []
-      initialDelaySeconds: 0
-      path: /readyz
-      periodSeconds: 5
-      scheme: HTTP
-      successThreshold: 1
-      timeoutSeconds: 1
-    startupProbe:
-      auth:
-        enabled: false
-        password: ""
-        username: ""
-      enabled: false
-      failureThreshold: 3
-      httpHeaders: []
-      path: /startupz
-      periodSeconds: 5
-      scheme: HTTP
-      timeoutSeconds: 1
-  hostAliases: []
-  image:
-    pullPolicy: Always
-    repository: nginx
-    tag: latest
-  ingress:
-    annotations: {}
-    custom_domain: false
-    custom_paths: []
-    customTls:
-      customTlsSecret: null
-      enabled: false
-    enabled: false
-    hosts: []
-    porter_hosts: []
-    provider: ""
-    rewriteCustomPathsEnabled: true
-    tls: true
-    useDefaultIngressTLSSecret: false
-    wildcard: false
-  keda:
-    cooldownPeriod: 300
-    enabled: false
-    fallback:
-      failureReplicas: 6
-      failureThreshold: 3
-    hpa:
-      scaleDown:
-        policy:
-          periodSeconds: 300
-          type: Percent
-          value: 10
-        stabilizationWindowSeconds: 300
-      scaleUp:
-        policy:
-          periodSeconds: 300
-          type: Percent
-          value: 10
-        stabilizationWindowSeconds: 300
-    maxReplicaCount: 10
-    minReplicaCount: 1
-    pollingInterval: 30
-    trigger:
-      metricName: ""
-      metricQuery: ""
-      metricThreshold: ""
-      metricType: AverageValue
-    triggers: []
-  namespace: default
-  nodeSelector: {}
-  podLabels: {}
-  privateIngress:
-    annotations: {}
-    clusterIssuer: letsencrypt-prod-private
-    custom_paths: []
+      password: ""
+      username: ""
     enabled: false
-    hosts: []
-    privateIngressClass: null
-    tls: false
-  pvc:
+    failureThreshold: 3
+    httpHeaders: []
+    initialDelaySeconds: 0
+    path: /livez
+    periodSeconds: 5
+    scheme: HTTP
+    successThreshold: 1
+    timeoutSeconds: 1
+  readinessProbe:
+    auth:
+      enabled: false
+      password: ""
+      username: ""
     enabled: false
-    existingVolume: ""
-    mountPath: /mypath
-    storage: 20Gi
-  replicaCount: 1
-  resources:
-    requests:
-      cpu: 100m
-      memory: 256Mi
-  service:
-    port: 80
-  serviceAccount:
-    annotations: {}
-    create: true
-    name: ""
-  showStartCommand: true
-  stack:
+    failureThreshold: 3
+    httpHeaders: []
+    initialDelaySeconds: 0
+    path: /readyz
+    periodSeconds: 5
+    scheme: HTTP
+    successThreshold: 1
+    timeoutSeconds: 1
+  startupProbe:
+    auth:
+      enabled: false
+      password: ""
+      username: ""
     enabled: false
-    name: ""
-    revision: 0
-  statefulset:
+    failureThreshold: 3
+    httpHeaders: []
+    path: /startupz
+    periodSeconds: 5
+    scheme: HTTP
+    timeoutSeconds: 1
+hostAliases: []
+image:
+  pullPolicy: Always
+  repository: nginx
+  tag: latest
+ingress:
+  annotations: {}
+  custom_domain: false
+  custom_paths: []
+  customTls:
     enabled: false
-  terminationGracePeriodSeconds: 30
-  tolerations: []
-  topology:
+  enabled: false
+  hosts: []
+  porter_hosts:
+  - legacy-17e207c81b4cbb84.onporter.run
+  provider: eks
+  rewriteCustomPathsEnabled: true
+  tls: true
+  useDefaultIngressTLSSecret: false
+  wildcard: false
+keda:
+  cooldownPeriod: 300
+  enabled: false
+  fallback:
+    failureReplicas: 6
+    failureThreshold: 3
+  hpa:
+    scaleDown:
+      policy:
+        periodSeconds: 300
+        type: Percent
+        value: 10
+      stabilizationWindowSeconds: 300
+    scaleUp:
+      policy:
+        periodSeconds: 300
+        type: Percent
+        value: 10
+      stabilizationWindowSeconds: 300
+  maxReplicaCount: 10
+  minReplicaCount: 1
+  pollingInterval: 30
+  trigger:
+    metricName: ""
+    metricQuery: ""
+    metricThreshold: ""
+    metricType: AverageValue
+  triggers: []
+namespace: default
+nodeSelector: {}
+podLabels: {}
+privateIngress:
+  annotations: {}
+  clusterIssuer: letsencrypt-prod-private
+  custom_paths: []
+  enabled: false
+  hosts: []
+  tls: false
+pvc:
+  enabled: false
+  existingVolume: ""
+  mountPath: /mypath
+  storage: 20Gi
+replicaCount: 1
+resources:
+  requests:
+    cpu: 100m
+    memory: 256Mi
+service:
+  port: 80
+serviceAccount:
+  annotations: {}
+  create: true
+  name: ""
+showStartCommand: true
+stack:
+  enabled: false
+  name: ""
+  revision: 0
+statefulset:
+  enabled: false
+terminationGracePeriodSeconds: 30
+tolerations: []
+topology:
+  enabled: false
+  labelSelector:
     enabled: false
-    labelSelector:
-      enabled: false
-      matchLabels: {}
-    maxSkew: null
-    topologyKey: null
-    whenUnsatisfiable: null
+    matchLabels: {}

+ 1 - 1
local/3/newumbrella/Chart.lock

@@ -3,4 +3,4 @@ dependencies:
   repository: https://charts.getporter.dev
   version: 0.136.0
 digest: sha256:e2669625ae4afd9c65c245b04678fc93dc8d362aee9d963dcfeb086a551b1505
-generated: "2023-09-08T18:17:19.560999-04:00"
+generated: "2023-09-11T16:30:28.662831-04:00"

+ 2 - 2
local/3/newumbrella/Chart.yaml

@@ -1,5 +1,5 @@
 apiVersion: v2
-name: testchart
+name: newumbrella
 description: A Helm chart for Kubernetes
 
 # A chart can be either an 'application' or a 'library' chart.
@@ -14,7 +14,7 @@ type: application
 
 # This is the chart version. This version number should be incremented each time you make changes
 # to the chart and its templates, including the app version.
-version: 0.1.0
+version: 0.1.1
 
 # This is the version number of the application being deployed. This version number should be
 # incremented each time you make changes to the application.

二進制
local/3/newumbrella/testchart-0.1.1.tgz


+ 0 - 2
local/3/newumbrella/values.yaml

@@ -1,2 +0,0 @@
-foo:
-  MyName: foo

+ 185 - 0
local/3/umbrella_values.yaml

@@ -0,0 +1,185 @@
+legacy-web:
+  albIngress:
+    custom_paths: []
+    enabled: false
+    external_dns: false
+    hosts: []
+    scheme: internet-facing
+    target_type: ip
+  auto_deploy: false
+  autoscaling:
+    enabled: false
+    maxReplicas: 10
+    minReplicas: 1
+    targetCPUUtilizationPercentage: 50
+    targetMemoryUtilizationPercentage: 50
+  bluegreen:
+    disablePrimaryDeployment: false
+    enabled: false
+    imageTags: []
+  cloudsql:
+    additionalConnection:
+      connectionName: ""
+      dbPort: 5432
+      enabled: false
+    connectionName: ""
+    dbPort: 5432
+    enabled: false
+    serviceAccountJSON: ""
+  clusterId: 32
+  container:
+    env:
+      normal: {}
+    lifecycle: {}
+    port: 8080
+  currentCluster:
+    service:
+      is_aws: false
+      is_do: false
+      is_gcp: false
+  customNodePort:
+    enabled: false
+    port: 30000
+  datadog:
+    enabled: false
+  emptyDir:
+    enabled: false
+    mountPath: /mypath
+  enableEDNS0: false
+  health:
+    livenessCommand:
+      command: ls -l
+      enabled: false
+      failureThreshold: 3
+      initialDelaySeconds: 5
+      periodSeconds: 5
+      successThreshold: 1
+      timeoutSeconds: 1
+    livenessProbe:
+      auth:
+        enabled: false
+        password: ""
+        username: ""
+      enabled: false
+      failureThreshold: 3
+      httpHeaders: []
+      initialDelaySeconds: 0
+      path: /livez
+      periodSeconds: 5
+      scheme: HTTP
+      successThreshold: 1
+      timeoutSeconds: 1
+    readinessProbe:
+      auth:
+        enabled: false
+        password: ""
+        username: ""
+      enabled: false
+      failureThreshold: 3
+      httpHeaders: []
+      initialDelaySeconds: 0
+      path: /readyz
+      periodSeconds: 5
+      scheme: HTTP
+      successThreshold: 1
+      timeoutSeconds: 1
+    startupProbe:
+      auth:
+        enabled: false
+        password: ""
+        username: ""
+      enabled: false
+      failureThreshold: 3
+      httpHeaders: []
+      path: /startupz
+      periodSeconds: 5
+      scheme: HTTP
+      timeoutSeconds: 1
+  hostAliases: []
+  image:
+    pullPolicy: Always
+    repository: nginx
+    tag: latest
+  ingress:
+    annotations: {}
+    custom_domain: false
+    custom_paths: []
+    customTls:
+      enabled: false
+    enabled: false
+    hosts: []
+    porter_hosts:
+    - legacy-17e207c81b4cbb84.onporter.run
+    provider: eks
+    rewriteCustomPathsEnabled: true
+    tls: true
+    useDefaultIngressTLSSecret: false
+    wildcard: false
+  keda:
+    cooldownPeriod: 300
+    enabled: false
+    fallback:
+      failureReplicas: 6
+      failureThreshold: 3
+    hpa:
+      scaleDown:
+        policy:
+          periodSeconds: 300
+          type: Percent
+          value: 10
+        stabilizationWindowSeconds: 300
+      scaleUp:
+        policy:
+          periodSeconds: 300
+          type: Percent
+          value: 10
+        stabilizationWindowSeconds: 300
+    maxReplicaCount: 10
+    minReplicaCount: 1
+    pollingInterval: 30
+    trigger:
+      metricName: ""
+      metricQuery: ""
+      metricThreshold: ""
+      metricType: AverageValue
+    triggers: []
+  namespace: default
+  nodeSelector: {}
+  podLabels: {}
+  privateIngress:
+    annotations: {}
+    clusterIssuer: letsencrypt-prod-private
+    custom_paths: []
+    enabled: false
+    hosts: []
+    tls: false
+  pvc:
+    enabled: false
+    existingVolume: ""
+    mountPath: /mypath
+    storage: 20Gi
+  replicaCount: 1
+  resources:
+    requests:
+      cpu: 100m
+      memory: 256Mi
+  service:
+    port: 80
+  serviceAccount:
+    annotations: {}
+    create: true
+    name: ""
+  showStartCommand: true
+  stack:
+    enabled: false
+    name: ""
+    revision: 0
+  statefulset:
+    enabled: false
+  terminationGracePeriodSeconds: 30
+  tolerations: []
+  topology:
+    enabled: false
+    labelSelector:
+      enabled: false
+      matchLabels: {}

+ 40 - 19
local/attempts.md

@@ -188,48 +188,69 @@ helm upgrade foo testumbrella --set bar.MyName=bar --reuse-values
 ```
 
 Custom script with web charts - change this
+``
 
 ```bash
-helm dependency build newumbrella
+# start with helm install of old version (or porter UI on legacy view)
+# newumbrella is a locally cloned umbrella helm chart
 
-KIND=deployment
+
+CHART_REPO=localngrok/newumbrella
+NAMESPACE=default
 EXISTING_RELEASE_NAME=legacy
 RELEASE_TYPE=web
 NAME=$EXISTING_RELEASE_NAME-$RELEASE_TYPE
 TARGET_RELEASE_NAME=umbrella-chart
-NAMESPACE=default
+
+# CHART_REPO=newumbrella
+# there should be no deps in Chart.yaml
+# helm dependency build $CHART_REPO
+
+helm cm-push newumbrella localngrok
 
 # create umbrella chart which has hello-porter
-helm install $TARGET_RELEASE_NAME newumbrella
+porter helm -- install $TARGET_RELEASE_NAME $CHART_REPO
 
 # add exising chart as dep on Chart.yaml, with alias set as the old release name
-helm dependency update newumbrella
+# helm dependency update $CHART_REPO
+helm cm-push newumbrella localngrok
+helm repo update localngrok
 
 # get existing values and indent the values to have the existing release name as a key which matches Chart.yaml
-helm get values $EXISTING_RELEASE_NAME > existing_values.yaml
+porter helm -- get values $EXISTING_RELEASE_NAME > existing_values.yaml
 
+# from existing_values.yaml, create a new values.yaml for the umbrella chart with the correct nesting for helm deps (umbrella_values.yaml)
 
-##### OTHER KINDS
-# KIND=deployment
-# kubectl annotate $KIND $NAME meta.helm.sh/release-name=$TARGET_RELEASE_NAME -n $NAMESPACE --overwrite
-# kubectl annotate $KIND $NAME meta.helm.sh/release-namespace=$NAMESPACE -n $NAMESPACE --overwrite
-# kubectl label $KIND $NAME app.kubernetes.io/managed-by=Helm -n $NAMESPACE
+# deployment selectors cant be changed. We need to create a new deployment which goes into the existing service, then delete the existing deployment, then run an update on helm, then delete the manually created deployment
+helm template $TARGET_RELEASE_NAME -f umbrella_values.yaml > template.yaml
 
-#### deployment selectors cant be changed. We need to create a new deployment which goes into the existing service, then delete the existing deployment, then run an update on helm, then delete the manually created deployment
+# edit template.yaml to only have deployment (or any other issues)
+
+
+##### OTHER KINDS
+KIND=deployment
+porter kubectl -- annotate $KIND $NAME meta.helm.sh/release-name=$TARGET_RELEASE_NAME -n $NAMESPACE --overwrite
+porter kubectl --  annotate $KIND $NAME meta.helm.sh/release-namespace=$NAMESPACE -n $NAMESPACE --overwrite
+porter kubectl --  label $KIND $NAME app.kubernetes.io/managed-by=Helm -n $NAMESPACE
 
 KIND=svc
-kubectl annotate $KIND $NAME meta.helm.sh/release-name=$TARGET_RELEASE_NAME -n $NAMESPACE --overwrite
-kubectl annotate $KIND $NAME meta.helm.sh/release-namespace=$NAMESPACE -n $NAMESPACE --overwrite
-kubectl label $KIND $NAME app.kubernetes.io/managed-by=Helm -n $NAMESPACE
+porter kubectl --  annotate $KIND $NAME meta.helm.sh/release-name=$TARGET_RELEASE_NAME -n $NAMESPACE --overwrite
+porter kubectl --  annotate $KIND $NAME meta.helm.sh/release-namespace=$NAMESPACE -n $NAMESPACE --overwrite
+porter kubectl --  label $KIND $NAME app.kubernetes.io/managed-by=Helm -n $NAMESPACE
 
 KIND=sa
-kubectl annotate $KIND $NAME meta.helm.sh/release-name=$TARGET_RELEASE_NAME -n $NAMESPACE --overwrite
-kubectl annotate $KIND $NAME meta.helm.sh/release-namespace=$NAMESPACE -n $NAMESPACE --overwrite
-kubectl label $KIND $NAME app.kubernetes.io/managed-by=Helm -n $NAMESPACE
+porter kubectl --  annotate $KIND $NAME meta.helm.sh/release-name=$TARGET_RELEASE_NAME -n $NAMESPACE --overwrite
+porter kubectl --  annotate $KIND $NAME meta.helm.sh/release-namespace=$NAMESPACE -n $NAMESPACE --overwrite
+porter kubectl --  label $KIND $NAME app.kubernetes.io/managed-by=Helm -n $NAMESPACE
+
+KIND=ingress
+porter kubectl --  annotate $KIND $NAME meta.helm.sh/release-name=$TARGET_RELEASE_NAME -n $NAMESPACE --overwrite
+porter kubectl --  annotate $KIND $NAME meta.helm.sh/release-namespace=$NAMESPACE -n $NAMESPACE --overwrite
+porter kubectl --  label $KIND $NAME app.kubernetes.io/managed-by=Helm -n $NAMESPACE
 ##### OTHER KINDS END
 
 # must delete deployments to scale up new ones as selectors are immutable
 
-helm upgrade $TARGET_RELEASE_NAME newumbrella -f existing_values.yaml
+porter helm -- upgrade $TARGET_RELEASE_NAME $CHART_REPO -f umbrella_values.yaml
 
 ```