Skip to content

Commit 8c1e20b

Browse files
authored
Merge pull request #972 from vshn/develop
⬆️ Update appcat version to v4.172.0
2 parents 05f5037 + 927af6b commit 8c1e20b

File tree

265 files changed

+3261
-781
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

265 files changed

+3261
-781
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
.kind
99
.idea
1010
.vscode
11+
.env
1112

1213
# sloth artifacts
1314
sloth-*-*-*

Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,8 @@ cluster=https://kubernetes.default.svc
103103
push-golden: commodore_args += -f tests/$(instance).yml
104104
push-golden: clean gen-golden ## Push the target instance to the local forgejo instance, so it can be applied by argocd
105105
cd tests/golden/$(instance)/appcat/appcat && \
106+
git config user.email "[email protected]" && \
107+
git config user.name "DevContainer User" && \
106108
git init --initial-branch=master && \
107109
git add . && \
108110
git commit -m "update" && \

README.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,38 @@ Linux oneliner: echo `ip -4 addr show dev docker0 | grep inet | awk -F' ' '{prin
8080

8181
Also make sure that `facts.appcat_dev` is set on the target you want to proxy. This is a safeguard so we don't accidentally enable it on prod clusters.
8282

83+
## Kubeconfig Environment Variables in Kuttl E2E Tests
84+
85+
Our Kuttl E2E tests use a job-within-a-job pattern where tests run in two separate clusters:
86+
- **control plane cluster** (where AppCat CRDs live)
87+
- **service cluster** (where actual workloads run).
88+
89+
This requires careful handling of kubeconfig files to enable cross-cluster operations.
90+
91+
### Environment Variables
92+
93+
We use four environment variables to manage kubeconfigs:
94+
95+
### 1. `CONTROL_PLANE_KUBECONFIG_CONTENT` **mandatory** (base64-encoded)
96+
- **Purpose**: Contains the entire control plane kubeconfig as a base64-encoded string
97+
- **Why needed**: Can be injected as an environment variable into containers and scripts
98+
- **Usage**: Scripts decode this to create `/tmp/control-plane-config`
99+
100+
### 2. `SERVICE_CLUSTER_KUBECONFIG_CONTENT` **mandatory** (base64-encoded)
101+
- **Purpose**: Contains the entire service cluster kubeconfig as a base64-encoded string, equals to `CONTROL_PLANE_KUBECONFIG_CONTENT` in converged mode
102+
- **Why needed**: Can be injected as an environment variable into containers and scripts
103+
- **Usage**: Scripts decode this to create `/tmp/service-cluster-config`
104+
105+
### 3. `IN_CLUSTER_CONTROL_PLANE_KUBECONFIG` **optional** (file path)
106+
- **Purpose**: Path to the kubeconfig file **as seen from within the control plane cluster**
107+
- **Why needed**: Used to create Kubernetes secrets that mount the kubeconfig into pods
108+
- **Example**: `/tmp/control-plane-config` or the original `~/.kube/config`
109+
110+
### 4. `IN_CLUSTER_SERVICE_CLUSTER_KUBECONFIG` **optional** (file path)
111+
- **Purpose**: Path to the kubeconfig file **as seen from within the service cluster**
112+
- **Why needed**: Used to create Kubernetes secrets that mount the kubeconfig into pods
113+
- **Example**: `/tmp/service-cluster-config` or the original `~/.kube/config`
114+
83115
## Documentation
84116

85117
The rendered documentation for this component is available on the [Commodore Components Hub](https://hub.syn.tools/appcat).

class/defaults.yml

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@ parameters:
1818
version: 5.4.0
1919
keycloak:
2020
source: https://codecentric.github.io/helm-charts
21-
version: 7.1.3
21+
version: 7.1.4
2222
nextcloud:
2323
source: https://nextcloud.github.io/helm/
24-
version: 8.0.1
24+
version: 8.4.1
2525
forgejo:
2626
source: oci://code.forgejo.org/forgejo-helm/forgejo
27-
version: 14.0.2
27+
version: 14.0.4
2828
cnpg:
2929
source: https://cloudnative-pg.io/charts/
3030
version: 0.26.0
@@ -44,7 +44,7 @@ parameters:
4444
provider-helm:
4545
registry: ghcr.io
4646
repository: crossplane-contrib/provider-helm
47-
tag: v1.0.0
47+
tag: v1.0.2
4848
provider-exoscale:
4949
registry: ghcr.io
5050
repository: vshn/provider-exoscale
@@ -72,31 +72,31 @@ parameters:
7272
appcat:
7373
registry: ghcr.io
7474
repository: vshn/appcat
75-
tag: v4.171.3
75+
tag: v4.172.0
7676
functionAppcat:
7777
registry: ${appcat:images:appcat:registry}
7878
repository: ${appcat:images:appcat:repository}
7979
tag: ${appcat:images:appcat:tag}-func
8080
functionpnt:
8181
registry: xpkg.upbound.io
8282
repository: crossplane-contrib/function-patch-and-transform
83-
tag: v0.1.4
83+
tag: v0.9.1
8484
reporting:
8585
registry: ghcr.io
8686
repository: appuio/appuio-reporting
87-
tag: v0.2.1
87+
tag: v0.2.2
8888
collector:
8989
registry: ghcr.io
9090
repository: vshn/billing-collector-cloudservices
9191
tag: v3.6.0
9292
kubectl:
9393
registry: docker.io
9494
image: bitnamilegacy/kubectl
95-
tag: '1.25.15'
95+
tag: "1.25.15"
9696
proxysql:
9797
registry: docker.io
9898
image: proxysql/proxysql
99-
version: '3.0.2'
99+
version: "3.0.2"
100100
collabora:
101101
registry: docker.io
102102
image: collabora/code
@@ -166,6 +166,7 @@ parameters:
166166
hotfix: ""
167167
enabled: true
168168
additionalFunctionBranches: []
169+
minimumRevisionAge: 168h # 7 days
169170

170171
crossplane:
171172
namespace: syn-crossplane
@@ -231,6 +232,7 @@ parameters:
231232
clusterID: ${cluster:name}
232233
cloudZone: ""
233234
instanceUOM: uom_uom_45_1e112771
235+
customResourceDeletionAfter: "180"
234236
enableMockOrgInfo: false
235237
salesOrder: ${facts:sales_order}
236238
vshn:
@@ -239,6 +241,7 @@ parameters:
239241
# Deploy metering prometheus rules
240242
meteringRules: true
241243
cloud:
244+
appuioControlKubeConfig: "?{vaultkv:__shared__/__shared__/appcat/appuio-control-kubeconfig}"
242245
secrets:
243246
exoscale:
244247
credentials:
@@ -1035,6 +1038,7 @@ parameters:
10351038
registry_password: "?{vaultkv:__shared__/__shared__/appcat/inventage_registry_password}"
10361039
ingress_annotations: |
10371040
cert-manager.io/cluster-issuer: letsencrypt-production
1041+
defaultPGComposition: vshnpostgres.vshn.appcat.vshn.io
10381042
openshiftTemplate:
10391043
serviceName: keycloakbyvshn
10401044
description: "Keycloak is an open source identity and access management solution."
@@ -1099,6 +1103,7 @@ parameters:
10991103
nextcloud_image: ${appcat:images:nextcloud:registry}/${appcat:images:nextcloud:image}
11001104
busybox_image: ${appcat:images:busybox:registry}/${appcat:images:busybox:image}
11011105
kubectl_image: ${appcat:images:kubectl:registry}/${appcat:images:kubectl:image}:${appcat:images:kubectl:tag}
1106+
defaultPGComposition: vshnpostgres.vshn.appcat.vshn.io
11021107
openshiftTemplate:
11031108
serviceName: nextcloudbyvshn
11041109
description: "Nextcloud is an open source suite of client-server software for creating and using file hosting services."

component/billing.jsonnet

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,16 @@ local odooSecret = kube.Secret('odoo-credentials') {
3535
},
3636
};
3737

38+
local appuioControlSecret = kube.Secret('appuio-control-sa') {
39+
metadata+: {
40+
namespace: paramsBilling.namespace,
41+
labels+: cronjob.Labels,
42+
},
43+
stringData: {
44+
kubeconfig: paramsBilling.cloud.appuioControlKubeConfig,
45+
},
46+
};
47+
3848
local commonEnv = std.prune([
3949
{
4050
name: 'AR_ODOO_OAUTH_TOKEN_URL',
@@ -225,7 +235,9 @@ local vshnServices = common.FilterServiceByBoolean('billing');
225235
local billingCronjobs = std.flattenArrays(std.flatMap(function(r) [ generateCloudAndManaged(r.name, false) ], vshnServices));
226236
local billingAddOnsCronjobs = std.flattenArrays(std.flatMap(function(addOn) [ generateCloudAndManaged(addOn, true) ], addOns));
227237

228-
if paramsBilling.vshn.enableCronjobs then
238+
{
239+
[if params.billingEnabled then 'billing/10_appuio_control_secret']: appuioControlSecret,
240+
} + if paramsBilling.vshn.enableCronjobs then
229241
{
230242
[if std.length(std.filter(function(name) paramsBilling.network_policies.target_namespaces[name] == true, std.objectFields(paramsBilling.network_policies.target_namespaces))) > 0 then 'billing/01_netpol']: netPol.Policies,
231243
'billing/10_odoo_secret': odooSecret,

component/common.libsonnet

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,10 +275,15 @@ local getDefaultInputs(name, serviceParams, plans, xrd, appuioManaged) = {
275275
[if std.objectHas(serviceParams, 'sideCars') then 'sideCars']: std.toString(serviceParams.sideCars),
276276
crossplaneNamespace: params.crossplane.namespace,
277277
ignoreNamespaceForBilling: params.billing.ignoreNamespace,
278+
billingUnitID: params.billing.instanceUOM,
279+
crDeletionAfter: params.billing.customResourceDeletionAfter,
280+
billingEnabled: std.toString(params.billingEnabled),
281+
clusterName: inv.parameters.cluster.name,
278282
[if std.objectHas(serviceParams, 'imageRegistry') then 'imageRegistry']: serviceParams.imageRegistry,
279283
[if std.objectHas(serviceParams, 'imageRepositoryPrefix') then 'imageRepositoryPrefix']: serviceParams.imageRepositoryPrefix,
280284
[if std.objectHas(serviceParams, 'maintenanceURL') then 'maintenanceURL']: serviceParams.maintenanceURL,
281285
releaseManagementEnabled: std.toString(params.deploymentManagementSystem.enabled),
286+
minimumRevisionAge: params.deploymentManagementSystem.minimumRevisionAge,
282287
} + (if std.objectHas(params.charts, name) then {
283288
chartRepository: params.charts[name].source,
284289
chartVersion: params.charts[name].version,

component/provider.jsonnet

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,11 @@ local providerRBAC = {
194194
resources: [ 'compositionrevisions' ],
195195
verbs: [ 'get', 'list' ],
196196
},
197+
{
198+
apiGroups: [ 'vshn.appcat.vshn.io' ],
199+
resources: [ 'billingservices' ],
200+
verbs: [ 'get', 'list', 'watch', 'create', 'watch', 'patch', 'update', 'delete' ],
201+
},
197202
],
198203
},
199204
helm: {

postprocess/add_argo_annotations.jsonnet

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ local annotationMap = {
2323
ClusterRoleBinding: {
2424
'argocd.argoproj.io/sync-wave': '-100',
2525
},
26+
Secret: {
27+
'argocd.argoproj.io/sync-wave': '-100',
28+
},
2629
ObjectBucket: {
2730
'argocd.argoproj.io/sync-options': 'Prune=false,SkipDryRunOnMissingResource=true',
2831
},

tests/control-plane.yml

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,33 +7,25 @@ parameters:
77
- type: https
88
source: https://raw.githubusercontent.com/appuio/component-openshift4-operators/v1.4.0/lib/openshift4-operators.libsonnet
99
output_path: vendor/lib/openshift4-operators.libsonnet
10-
1110
facts:
1211
cloud: cloudscale
1312
sales_order: "10431"
1413
appcat_dev: true
1514
service_level: "premium"
16-
17-
1815
global:
1916
appuio_metered_billing_zone_label_map:
2017
c-green-test-1234: 'Kind - Local Test 0'
21-
2218
crossplane:
2319
namespace: syn-crossplane
24-
2520
appcat:
26-
2721
clusterManagementSystem:
2822
controlPlaneCluster: true
2923
serviceCluster: false
3024
serviceClusterKubeconfigs:
3125
- name: kind
3226
config: "dummy" # `make vcluster-host-kubeconfig` in kindev
33-
34-
grpcEndpoint: 172.17.0.1:9443
27+
grpcEndpoint: 172.19.0.1:9443
3528
proxyFunction: false
36-
3729
quotasEnabled: false
3830
appuioManaged: false
3931
billing:
@@ -49,7 +41,6 @@ parameters:
4941
prometheus:
5042
url: http://prometheus-operated.prometheus-system:9090/prometheus
5143
cloudZone: ${global:appuio_metered_billing_zone_label_map:${cluster:name}}
52-
5344
slos:
5445
enabled: true
5546
alertsEnabled: false
@@ -80,18 +71,17 @@ parameters:
8071
apiSecretRef:
8172
name: minio-secret
8273
namespace: syn-crossplane
83-
8474
apiserver:
8575
enabled: true
8676
env:
8777
APPCAT_HANDLER_ENABLED: "true"
8878
VSHN_POSTGRES_BACKUP_HANDLER_ENABLED: "true"
8979
VSHN_REDIS_BACKUP_HANDLER_ENABLED: "true"
90-
9180
services:
9281
emailAlerting:
9382
enabled: false
9483
vshn:
84+
e2eTests: true
9585
enabled: true
9686
externalDatabaseConnectionsEnabled: true
9787
mariadb:
@@ -112,19 +102,17 @@ parameters:
112102
cert-manager.io/cluster-issuer: letsencrypt-staging
113103
nginx.ingress.kubernetes.io/enable-cors: "true"
114104
nginx.ingress.kubernetes.io/cors-allow-headers: "X-Forwarded-For"
115-
116105
forgejo:
117106
enabled: true
118107
# https://vault-prod.syn.vshn.net/ui/vault/secrets/clusters%2Fkv/kv/__shared__%2F__shared__%2Fappcat/details?version=2
119108
additionalInputs:
120109
registry_username: ""
121110
registry_password: ""
122-
123111
postgres:
124112
sgNamespace: stackgres
125113
additionalInputs:
126114
loadbalancerAnnotations: |
127-
foo: bar
115+
foo: bar
128116
plans:
129117
standard-8:
130118
enabled: false
@@ -182,11 +170,9 @@ parameters:
182170
disk: 20Gi
183171
writeConnectionSecretToRef:
184172
name: minio-cluster-credentials
185-
186173
generic:
187174
objectstorage:
188175
enabled: true
189-
190176
defaultComposition: minio
191177
compositions:
192178
exoscale:

tests/dev.yml

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ parameters:
1212
appcat:
1313
version: debug
1414

15+
cluster:
16+
name: c-green-test-1234
17+
1518
facts:
1619
cloud: cloudscale
1720
region: lpg
@@ -42,14 +45,14 @@ parameters:
4245
registry: dockerhub.vshn.net
4346
busybox:
4447
registry: dockerhub.vshn.net
45-
46-
grpcEndpoint: 172.19.0.1:9443
48+
grpcEndpoint: 172.18.0.1:9443
4749
proxyFunction: true
4850

4951
quotasEnabled: false
5052
appuioManaged: false
53+
#billingEnabled: true
5154
billing:
52-
salesOrder: ST10120
55+
salesOrder: ""
5356
vshn:
5457
enableCronjobs: false
5558
meteringRules: true
@@ -82,8 +85,18 @@ parameters:
8285
enabled: false
8386
kubernetes:
8487
enabled: true
88+
additionalProviderConfigs:
89+
- name: kind
90+
spec:
91+
credentials:
92+
source: InjectedIdentity
8593
helm:
8694
enabled: true
95+
additionalProviderConfigs:
96+
- name: kind
97+
spec:
98+
credentials:
99+
source: InjectedIdentity
87100
minio:
88101
enabled: true
89102
defaultProviderConfig:

0 commit comments

Comments
 (0)