|
| 1 | +--- |
| 2 | +title: Workshop Overview |
| 3 | +--- |
| 4 | + |
| 5 | +Note that once `vcluster` provider config added to CLI as one of the set of opinionated configs, this can be simplified. |
| 6 | + |
| 7 | +Download Javascript and CSS files for CookieConsent package from the CDN. |
| 8 | + |
| 9 | +```terminal:execute |
| 10 | +command: curl -L -o cookieconsent.css https://cdn.jsdelivr.net/gh/orestbida/[email protected]/dist/cookieconsent.css |
| 11 | +``` |
| 12 | + |
| 13 | +```terminal:execute |
| 14 | +command: curl -L -o cookieconsent.umd.js https://cdn.jsdelivr.net/gh/orestbida/[email protected]/dist/cookieconsent.umd.js |
| 15 | +``` |
| 16 | + |
| 17 | +Create `.css` and `.js` files for the training portal. |
| 18 | + |
| 19 | +```terminal:execute |
| 20 | +command: cat cookieconsent.css > training-portal.css |
| 21 | +``` |
| 22 | + |
| 23 | +```terminal:execute |
| 24 | +command: cat cookieconsent.umd.js > training-portal.js |
| 25 | +``` |
| 26 | + |
| 27 | +```terminal:execute |
| 28 | +command: | |
| 29 | + cat << EOF >> training-portal.js |
| 30 | + /** |
| 31 | + * All config. options available here: |
| 32 | + * https://cookieconsent.orestbida.com/reference/configuration-reference.html |
| 33 | + */ |
| 34 | + CookieConsent.run({ |
| 35 | +
|
| 36 | + categories: { |
| 37 | + necessary: { |
| 38 | + enabled: true, // this category is enabled by default |
| 39 | + readOnly: true // this category cannot be disabled |
| 40 | + }, |
| 41 | + analytics: {} |
| 42 | + }, |
| 43 | +
|
| 44 | + language: { |
| 45 | + default: 'en', |
| 46 | + translations: { |
| 47 | + en: { |
| 48 | + consentModal: { |
| 49 | + title: 'We use cookies', |
| 50 | + description: 'Cookie modal description', |
| 51 | + acceptAllBtn: 'Accept all', |
| 52 | + acceptNecessaryBtn: 'Reject all', |
| 53 | + showPreferencesBtn: 'Manage Individual preferences' |
| 54 | + }, |
| 55 | + preferencesModal: { |
| 56 | + title: 'Manage cookie preferences', |
| 57 | + acceptAllBtn: 'Accept all', |
| 58 | + acceptNecessaryBtn: 'Reject all', |
| 59 | + savePreferencesBtn: 'Accept current selection', |
| 60 | + closeIconLabel: 'Close modal', |
| 61 | + sections: [ |
| 62 | + { |
| 63 | + title: 'Somebody said ... cookies?', |
| 64 | + description: 'I want one!' |
| 65 | + }, |
| 66 | + { |
| 67 | + title: 'Strictly Necessary cookies', |
| 68 | + description: 'These cookies are essential for the proper functioning of the website and cannot be disabled.', |
| 69 | +
|
| 70 | + //this field will generate a toggle linked to the 'necessary' category |
| 71 | + linkedCategory: 'necessary' |
| 72 | + }, |
| 73 | + { |
| 74 | + title: 'Performance and Analytics', |
| 75 | + description: 'These cookies collect information about how you use our website. All of the data is anonymized and cannot be used to identify you.', |
| 76 | + linkedCategory: 'analytics' |
| 77 | + }, |
| 78 | + { |
| 79 | + title: 'More information', |
| 80 | + description: 'For any queries in relation to my policy on cookies and your choices, please <a href="#contact-page">contact us</a>' |
| 81 | + } |
| 82 | + ] |
| 83 | + } |
| 84 | + } |
| 85 | + } |
| 86 | + } |
| 87 | + }); |
| 88 | + EOF |
| 89 | +``` |
| 90 | + |
| 91 | +Create a Kubernetes secret using these as theme files. |
| 92 | + |
| 93 | +```terminal:execute |
| 94 | +command: kubectl create ns educates-themes |
| 95 | +``` |
| 96 | + |
| 97 | +```terminal:execute |
| 98 | +command: kubectl create secret generic cookieconsent-theme -n educates-themes --from-file=training-portal.css --from-file=training-portal.js |
| 99 | +``` |
| 100 | + |
| 101 | +```editor:append-lines-to-file |
| 102 | +file: ~/config.yaml |
| 103 | +text: | |
| 104 | + clusterInfrastructure: |
| 105 | + provider: custom |
| 106 | +
|
| 107 | + clusterPackages: |
| 108 | + contour: |
| 109 | + enabled: false |
| 110 | + kyverno: |
| 111 | + enabled: false |
| 112 | +
|
| 113 | + clusterIngress: |
| 114 | + domain: {{< param session_name >}}.{{< param ingress_domain >}} |
| 115 | +
|
| 116 | + clusterSecurity: |
| 117 | + policyEngine: none |
| 118 | +
|
| 119 | + workshopSecurity: |
| 120 | + rulesEngine: none |
| 121 | +
|
| 122 | + imageRegistry: |
| 123 | + host: registry.default.svc.cluster.local |
| 124 | +
|
| 125 | + imagePuller: |
| 126 | + enabled: false |
| 127 | +
|
| 128 | + websiteStyling: |
| 129 | + defaultTheme: cookieconsent-theme |
| 130 | + themeDataRefs: |
| 131 | + - name: cookieconsent-theme |
| 132 | + namespace: educates-themes |
| 133 | +``` |
| 134 | + |
| 135 | +```terminal:execute |
| 136 | +command: educates admin cluster install --config config.yaml |
| 137 | +``` |
| 138 | + |
| 139 | +```terminal:execute |
| 140 | +command: educates deploy-workshop -f https://github.com/vmware-tanzu-labs/lab-k8s-fundamentals/releases/latest/download/workshop.yaml |
| 141 | +``` |
| 142 | + |
| 143 | +```terminal:execute |
| 144 | +command: educates browse-workshops |
| 145 | +``` |
0 commit comments