-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #19 from SUSE/develop
Add Portworx BBQ Helm chart & SUSE Linux scripts (#18)
- Loading branch information
Showing
18 changed files
with
333 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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: [email protected] | ||
- name: ccrow42 | ||
email: [email protected] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
``` |
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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: "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
#!/bin/bash | ||
# Collection of functions to manage packages on SUSE Linux distributions | ||
|
||
####################################### | ||
# Install kubectl (Kubernetes CLI) on SUSE Linux | ||
# Arguments: | ||
# kubernetesVersion | ||
# Examples: | ||
# suselinux_install_kubectl 'v1.30' | ||
####################################### | ||
suselinux_install_kubectl() { | ||
local kubernetesVersion=$1 | ||
|
||
# adds keys for new packages to be installed | ||
cat <<EOF | sudo tee /etc/zypp/repos.d/kubernetes.repo | ||
[kubernetes] | ||
name=Kubernetes | ||
baseurl=https://pkgs.k8s.io/core:/stable:/$kubernetesVersion/rpm/ | ||
enabled=1 | ||
gpgcheck=1 | ||
gpgkey=https://pkgs.k8s.io/core:/stable:/$kubernetesVersion/rpm/repodata/repomd.xml.key | ||
EOF | ||
|
||
# refreshes packages and import new keys | ||
zypper --gpg-auto-import-keys refresh | ||
|
||
# installs Kubernetes CLI | ||
zypper install -y kubectl | ||
} | ||
|
||
####################################### | ||
# Install kubectl (Kubernetes CLI) on SUSE Linux | ||
# Examples: | ||
# suselinux_install_kubectl | ||
####################################### | ||
suselinux_install_helm() { | ||
zypper install -y helm | ||
} | ||
|
||
####################################### | ||
# Install git on SUSE Linux | ||
# Examples: | ||
# suselinux_install_kubectl | ||
####################################### | ||
suselinux_install_git() { | ||
zypper install -y git | ||
} | ||
|
||
####################################### | ||
# Install Podman on SUSE Linux | ||
# Examples: | ||
# suselinux_install_kubectl | ||
####################################### | ||
suselinux_install_podman() { | ||
zypper install -y podman | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/bin/bash | ||
# Collection of functions to register on SUSE Linux distributions | ||
|
||
####################################### | ||
# Register Cloud guest on SUSE Linux | ||
# Examples: | ||
# suselinux_register_cloudguest | ||
####################################### | ||
suselinux_register_cloudguest() { | ||
registercloudguest --force-new | ||
# temporary workaround (the file is generated registercloudguest and prevents further container image pulling) | ||
rm ~/.docker/config.json | ||
} |