diff --git a/charts/README.md b/charts/README.md index e2ad1d7..a603bb2 100644 --- a/charts/README.md +++ b/charts/README.md @@ -24,5 +24,5 @@ helm template . -f values.yaml -f values_mine.yaml --namespace dem # installs a chart from local source helm upgrade --install . -f values.yaml \ # --debug > output.yaml \ - --create-namespace --namespace nfs-ganesha + --create-namespace --namespace demo ``` diff --git a/charts/nfs-ganesha/Chart.yaml b/charts/nfs-ganesha/Chart.yaml index 0d2836b..31f279e 100644 --- a/charts/nfs-ganesha/Chart.yaml +++ b/charts/nfs-ganesha/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: nfs-ganesha description: Helm chart for managing NFS-Ganesha type: application -version: "0.1.0" +version: "0.1.1" appVersion: "1.0.0" dependencies: [] home: https://github.com/SUSE/lab-setup/tree/main/charts/nfs-ganesha diff --git a/charts/portworx-bbq/Chart.lock b/charts/portworx-bbq/Chart.lock new file mode 100644 index 0000000..9f88a96 --- /dev/null +++ b/charts/portworx-bbq/Chart.lock @@ -0,0 +1,6 @@ +dependencies: +- name: mongodb + repository: https://charts.bitnami.com/bitnami + version: 15.6.25 +digest: sha256:833d69d2d3009fa6e91af738d0b0317ac50454ca7458c547d7281a3d150decd1 +generated: "2024-10-02T17:33:33.71790146+02:00" diff --git a/charts/portworx-bbq/Chart.yaml b/charts/portworx-bbq/Chart.yaml new file mode 100644 index 0000000..5383bed --- /dev/null +++ b/charts/portworx-bbq/Chart.yaml @@ -0,0 +1,18 @@ +apiVersion: v2 +name: portworx-bbq +description: Helm chart for Portworx BBQ demo application +type: application +version: 0.1.0 +appVersion: "1.0.0" +home: https://github.com/SUSE/lab-setup/tree/main/charts/portworx-bbq +dependencies: + - name: mongodb + version: 15.6.25 # app version: 7.0.14 + repository: https://charts.bitnami.com/bitnami + alias: mongodb + condition: mongodb.enabled +maintainers: + - name: devpro + email: bertrand.thomas@suse.com + - name: ccrow42 + email: ccrow@purestorage.com diff --git a/charts/portworx-bbq/README.md b/charts/portworx-bbq/README.md new file mode 100644 index 0000000..80c2c6b --- /dev/null +++ b/charts/portworx-bbq/README.md @@ -0,0 +1,51 @@ +# Portworx BBQ Helm Chart + +This chart will install the **Portworx BBQ (pxbbq)** demo application in a Kubernetes cluster ([source](https://github.com/theITHollow/shanksbbq)). + +You can learn more about it by looking at [Azure/kubernetes-hackfest](https://github.com/Azure/kubernetes-hackfest/blob/master/labs/storage/portworx/README.md) repository. + +## Quick start + +Install the app with default settings: + +```bash +# adds the repo +helm repo add suse-lab-setup https://opensource.suse.com/lab-setup +helm repo update + +# installs the chart +helm upgrade --install portworx-bbq suse-lab-setup/portworx-bbq --namespace pxbbq --create-namespace +``` + +Look at [values.yaml](values.yaml) for the configuration. + +Clean-up: + +```bash +helm delete portworx-bbq --namespace pxbbq +kubectl delete ns pxbbq +``` + +## Chart dependencies + +### MongoDB chart + +Add Helm repo: + +```bash +helm repo add bitnami https://charts.bitnami.com/bitnami +``` + +Search for the latest package: + +```bash +helm search repo -l mongodb --versions +``` + +Update `Chart.yaml`. + +Update `Chart.lock`: + +```bash +helm dependency update +``` diff --git a/charts/portworx-bbq/templates/NOTES.txt b/charts/portworx-bbq/templates/NOTES.txt new file mode 100644 index 0000000..e69de29 diff --git a/charts/portworx-bbq/templates/_helpers.tpl b/charts/portworx-bbq/templates/_helpers.tpl new file mode 100644 index 0000000..e69de29 diff --git a/charts/portworx-bbq/templates/deployment.yaml b/charts/portworx-bbq/templates/deployment.yaml new file mode 100644 index 0000000..b874cbc --- /dev/null +++ b/charts/portworx-bbq/templates/deployment.yaml @@ -0,0 +1,63 @@ +{{- $applications := list .Values.front -}} +{{ range $applications }} +{{- $name := .name -}} +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ $name }} + labels: + app: {{ $name }} + app.kubernetes.io/name: {{ $name }} +spec: + replicas: {{ .replicaCount }} + selector: + matchLabels: + app: {{ $name }} + app.kubernetes.io/name: {{ $name }} + template: + metadata: + labels: + app: {{ $name }} + app.kubernetes.io/name: {{ $name }} + {{- if .additionalPodLabels }} + {{- toYaml .additionalPodLabels | nindent 8 }} + {{- end }} + spec: + containers: + - name: webapp + image: "{{ .image }}:{{ .tag }}" + imagePullPolicy: Always + env: + - name: MONGO_HOST + value: "{{ .db.host }}" + - name: MONGO_PORT + value: "{{ .db.port }}" + - name: MONGO_USER + value: "{{ .db.username }}" + - name: MONGO_PASS + value: "{{ .db.userpwd }}" + - name: MONGO_TLS + value: "{{ .db.tls }}" + ports: + - name: http + containerPort: {{ .containerPort }} + protocol: TCP + resources: + {{- toYaml .resources | nindent 12 }} + livenessProbe: + httpGet: + path: {{ .healthEndpoint }} + port: {{ .containerPort }} + scheme: HTTP + initialDelaySeconds: 5 + periodSeconds: 15 + timeoutSeconds: 5 + readinessProbe: + httpGet: + path: {{ .healthEndpoint }} + port: {{ .containerPort }} + scheme: HTTP + initialDelaySeconds: 5 + timeoutSeconds: 1 +{{ end }} diff --git a/charts/portworx-bbq/templates/ingress.yaml b/charts/portworx-bbq/templates/ingress.yaml new file mode 100644 index 0000000..ec5d196 --- /dev/null +++ b/charts/portworx-bbq/templates/ingress.yaml @@ -0,0 +1,38 @@ +{{- $applications := list .Values.front -}} +{{ range $applications }} +{{- $name := .name -}} +{{- if $.Values.ingress.enabled -}} +--- +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: {{ $name }} + {{- with $.Values.ingress.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + {{- if $.Values.ingress.className }} + ingressClassName: {{ $.Values.ingress.className }} + {{- end }} + rules: + - {{- if .host }} + host: {{ .host }} + {{- end }} + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: {{ $name }} + port: + number: {{ .port }} + {{- if .tls }} + tls: + - hosts: + - {{ .host | quote }} + secretName: {{ .tls.secretName }} + {{- end }} +{{- end }} +{{ end }} diff --git a/charts/portworx-bbq/templates/service.yaml b/charts/portworx-bbq/templates/service.yaml new file mode 100644 index 0000000..2972f62 --- /dev/null +++ b/charts/portworx-bbq/templates/service.yaml @@ -0,0 +1,22 @@ +{{- $applications := list .Values.front -}} +{{ range $applications }} +{{- $name := .name -}} +--- +apiVersion: v1 +kind: Service +metadata: + name: {{ $name }} + labels: + app: {{ $name }} + app.kubernetes.io/name: {{ $name }} +spec: + type: ClusterIP + selector: + app: {{ $name }} + app.kubernetes.io/name: {{ $name }} + ports: + - name: http + port: {{ .port }} + protocol: TCP + targetPort: {{ .containerPort }} +{{ end }} diff --git a/charts/portworx-bbq/values.yaml b/charts/portworx-bbq/values.yaml new file mode 100644 index 0000000..97aec53 --- /dev/null +++ b/charts/portworx-bbq/values.yaml @@ -0,0 +1,40 @@ +front: + name: pxbbq-web + image: eshanks16/pxbbq # TODO: see how to create an image using SUSE BCI + tag: v2 # v4.4 fails asking for NEO4J_URI environment variable + replicaCount: 3 + containerPort: 8080 + healthEndpoint: /healthz + host: "" + port: 80 + tls: + secretName: "pxbbq-web-tls" + db: + host: "" + port: "27017" + username: "porxie" + userpwd: "" + tls: "" + extraEnv: [] + # - name: xxx + # value: "yyyy" + additionalPodLabels: {} + resources: {} + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 64Mi + +ingress: + enabled: false + className: "" + annotations: {} + # cert-manager.io/cluster-issuer: letsencrypt-prod + +mongodb: + enabled: false + # https://github.com/bitnami/charts/blob/main/bitnami/mongodb/values.yaml + auth: {} + # rootPassword: "" diff --git a/charts/rancher-cluster-templates/Chart.yaml b/charts/rancher-cluster-templates/Chart.yaml index 736f8fe..635fc6b 100644 --- a/charts/rancher-cluster-templates/Chart.yaml +++ b/charts/rancher-cluster-templates/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: rancher-cluster-templates description: Helm chart for managing Rancher cluster templates type: application -version: "0.1.0" +version: "0.1.1" appVersion: "0.1.0" annotations: catalog.cattle.io/type: cluster-template diff --git a/scripts/README.md b/scripts/README.md index 428b779..4334e49 100644 --- a/scripts/README.md +++ b/scripts/README.md @@ -4,6 +4,7 @@ Name | Source -----------------------------------------------|----------------------------------------------------------------------------- +`instruqt_wait_hoststartup` | [instruqt/host.sh](instruqt/host.sh) `k3s_copy_kubeconfig` | [k3s/cluster_lifecycle.sh](k3s/cluster_lifecycle.sh) `k3s_create_cluster` | [k3s/cluster_lifecycle.sh](k3s/cluster_lifecycle.sh) `k8s_create_letsencryptclusterissuer` | [kubernetes/certificate_management.sh](kubernetes/certificate_management.sh) @@ -30,6 +31,11 @@ Name | Source `rancher_update_password` | [rancher/user_actions.sh](rancher/user_actions.sh) `rancher_update_serverurl` | [rancher/manager_settings.sh](rancher/manager_settings.sh) `rancher_wait_capiready` | [rancher/manager_lifecycle.sh](rancher/manager_lifecycle.sh) +`suselinux_install_git` | [suselinux/packages.sh](suselinux/packages.sh) +`suselinux_install_helm` | [suselinux/packages.sh](suselinux/packages.sh) +`suselinux_install_kubectl` | [suselinux/packages.sh](suselinux/packages.sh) +`suselinux_install_podman` | [suselinux/packages.sh](suselinux/packages.sh) +`suselinux_register_cloudguest` | [suselinux/registration.sh](suselinux/registration.sh) ## Concrete examples diff --git a/scripts/download.sh b/scripts/download.sh index 2900747..45717e8 100644 --- a/scripts/download.sh +++ b/scripts/download.sh @@ -35,10 +35,6 @@ fatal() { verify_system() { info 'Verify system requirements' - if [ -x /usr/bin/git ] || type git > /dev/null 2>&1; then - return - fi - fatal 'Git is not installed in the machine' if ! command -v jq &> /dev/null; then fatal 'jq is not installed in the machine' fi diff --git a/scripts/instruqt/host.sh b/scripts/instruqt/host.sh new file mode 100644 index 0000000..fb0f38c --- /dev/null +++ b/scripts/instruqt/host.sh @@ -0,0 +1,15 @@ +#!/bin/bash +# Collection of functions to work with hosts in Instruqt + +####################################### +# Wait for host startup +# Examples: +# instruqt_wait_hoststartup +####################################### +instruqt_wait_hoststartup() { + # waits for Instruqt host bootstrap to finish + until [ -f /opt/instruqt/bootstrap/host-bootstrap-completed ] + do + sleep 1 + done +} diff --git a/scripts/rancher/cluster_actions.sh b/scripts/rancher/cluster_actions.sh index 6e8593d..21f073c 100644 --- a/scripts/rancher/cluster_actions.sh +++ b/scripts/rancher/cluster_actions.sh @@ -25,6 +25,8 @@ rancher_create_customcluster() { local name=$1 local version=$2 + rancher_wait_capiready + echo "Creating downstream cluster in Rancher..." cat <