|
| 1 | +--- |
| 2 | +apiVersion: data.packaging.carvel.dev/v1alpha1 |
| 3 | +kind: Package |
| 4 | +metadata: |
| 5 | + name: thingamajig.acme.corp.0.0.1 |
| 6 | +spec: |
| 7 | + refName: thingamajig.acme.corp |
| 8 | + version: 0.0.1 |
| 9 | + template: |
| 10 | + spec: |
| 11 | + fetch: |
| 12 | + - path: helm-chart |
| 13 | + helmChart: |
| 14 | + name: nginx |
| 15 | + repository: |
| 16 | + url: oci://registry-1.docker.io/bitnamicharts |
| 17 | + version: 15.12.2 |
| 18 | + - path: patcher |
| 19 | + inline: |
| 20 | + paths: |
| 21 | + schema.yaml: | |
| 22 | + #@data/values-schema |
| 23 | + --- |
| 24 | + #! These validations would fail if we were not able to add data |
| 25 | + #! values to the ytt step |
| 26 | +
|
| 27 | + #@schema/validation min_len=1 |
| 28 | + existingServerBlockConfigmap: "" |
| 29 | + #@schema/validation min_len=1 |
| 30 | + customServerBlock: "" |
| 31 | + server-block-cm.yaml: | |
| 32 | + #@ load("@ytt:data", "data") |
| 33 | + --- |
| 34 | + apiVersion: v1 |
| 35 | + kind: ConfigMap |
| 36 | + metadata: |
| 37 | + name: #@ data.values.existingServerBlockConfigmap |
| 38 | + data: |
| 39 | + custom-server-block.conf: #@ data.values.customServerBlock |
| 40 | + template: |
| 41 | + - helmTemplate: |
| 42 | + path: helm-chart |
| 43 | + - ytt: |
| 44 | + paths: |
| 45 | + - "-" |
| 46 | + - patcher |
| 47 | + deploy: |
| 48 | + - kapp: {} |
| 49 | + |
| 50 | +--- |
| 51 | +apiVersion: packaging.carvel.dev/v1alpha1 |
| 52 | +kind: PackageInstall |
| 53 | +metadata: |
| 54 | + name: thingamajig |
| 55 | + annotations: |
| 56 | + ext.packaging.carvel.dev/helm-0-template-name: foobar |
| 57 | +spec: |
| 58 | + serviceAccountName: default-ns-sa |
| 59 | + packageRef: |
| 60 | + refName: thingamajig.acme.corp |
| 61 | + versionSelection: |
| 62 | + constraints: 0.0.1 |
| 63 | + values: |
| 64 | + - secretRef: |
| 65 | + name: thingamajig-shared-values |
| 66 | + templateSteps: [ 0 , 1 ] |
| 67 | + - secretRef: |
| 68 | + name: thingamajig-helm-values |
| 69 | + templateSteps: [ 0 ] |
| 70 | + - secretRef: |
| 71 | + name: thingamajig-ytt-values |
| 72 | + templateSteps: [ 1 ] |
| 73 | + |
| 74 | +--- |
| 75 | +apiVersion: v1 |
| 76 | +kind: Secret |
| 77 | +metadata: |
| 78 | + name: thingamajig-shared-values |
| 79 | +stringData: |
| 80 | + values.yaml: | |
| 81 | + existingServerBlockConfigmap: custom-server-block |
| 82 | +
|
| 83 | +--- |
| 84 | +apiVersion: v1 |
| 85 | +kind: Secret |
| 86 | +metadata: |
| 87 | + name: thingamajig-helm-values |
| 88 | +stringData: |
| 89 | + values.yaml: | |
| 90 | + service: |
| 91 | + type: ClusterIP |
| 92 | + replicaCount: 2 |
| 93 | +
|
| 94 | +--- |
| 95 | +apiVersion: v1 |
| 96 | +kind: Secret |
| 97 | +metadata: |
| 98 | + name: thingamajig-ytt-values |
| 99 | +stringData: |
| 100 | + values.yaml: | |
| 101 | + customServerBlock: | |
| 102 | + server { |
| 103 | + listen 0.0.0.0:8080; |
| 104 | + location / { |
| 105 | + return 200 "hello from kapp-controller, helm, ytt and friends!"; |
| 106 | + add_header Content-Type text/plain; |
| 107 | + } |
| 108 | + } |
0 commit comments