Skip to content

Commit

Permalink
Install Contour to virtual cluster using App instead of Package/Packa…
Browse files Browse the repository at this point in the history
…geInstall.
  • Loading branch information
GrahamDumpleton committed Jul 20, 2022
1 parent 092ec5c commit a26a4a5
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 36 deletions.
1 change: 1 addition & 0 deletions carvel-packages/training-platform/config/images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,5 @@ imageVersions:
- name: loftsh-vcluster
image: "loftsh/vcluster:0.7.1"
- name: contour-bundle
#! contour.community.tanzu.vmware.com.1.20.1
image: projects.registry.vmware.com/tce/contour@sha256:0128c3458d57cd637c198b3a6377bb1eca6e23301f27710ac29d9d0ee1c5bd09
52 changes: 16 additions & 36 deletions session-manager/handlers/application_vcluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -435,34 +435,6 @@ def vcluster_session_objects_list(workshop_spec, application_properties):
if ingress_enabled:
objects.extend(
[
{
"apiVersion": "data.packaging.carvel.dev/v1alpha1",
"kind": "Package",
"metadata": {
"name": "contour.community.tanzu.vmware.com.1.20.1",
"namespace": "$(session_namespace)-vc",
},
"spec": {
"refName": "contour.community.tanzu.vmware.com",
"version": "1.20.1",
"releaseNotes": "contour 1.20.1 https://github.com/projectcontour/contour/releases/tag/v1.20.1",
"releasedAt": "2022-02-24T00:00:00Z",
"licenses": ["Apache 2.0"],
"template": {
"spec": {
"fetch": [
{"imgpkgBundle": {"image": CONTOUR_BUNDLE_IMAGE}}
],
"template": [
{"ytt": {"paths": ["config/"]}},
{"kbld": {"paths": ["-", ".imgpkg/images.yml"]}},
],
"deploy": [{"kapp": {}}],
}
},
"capacityRequirementsDescription": "Varies significantly based on number of Services, Ingresses/HTTPProxies, etc. A starting point is 128MB RAM and 0.5 CPU for each Contour and Envoy pod, but this can and should be tuned based on observed usage.",
},
},
{
"apiVersion": "v1",
"kind": "Secret",
Expand All @@ -475,25 +447,33 @@ def vcluster_session_objects_list(workshop_spec, application_properties):
},
},
{
"apiVersion": "packaging.carvel.dev/v1alpha1",
"kind": "PackageInstall",
"apiVersion": "kappctrl.k14s.io/v1alpha1",
"kind": "App",
"metadata": {
"name": "contour",
"name": "contour.community.tanzu.vmware.com.1.20.1",
"namespace": "$(session_namespace)-vc",
},
"spec": {
"packageRef": {
"refName": "contour.community.tanzu.vmware.com",
"versionSelection": {"constraints": "1.20.1"},
},
"values": [{"secretRef": {"name": "contour-values"}}],
"cluster": {
"namespace": "default",
"kubeconfigSecretRef": {
"name": "$(vcluster_secret)",
"key": "config",
},
},
"fetch": [{"imgpkgBundle": {"image": CONTOUR_BUNDLE_IMAGE}}],
"template": [
{
"ytt": {
"paths": ["config/"],
"valuesFrom": [
{"secretRef": {"name": "contour-values"}}
],
}
},
{"kbld": {"paths": ["-", ".imgpkg/images.yml"]}},
],
"deploy": [{"kapp": {}}],
"noopDelete": True,
"syncPeriod": "24h",
},
Expand Down

0 comments on commit a26a4a5

Please sign in to comment.