-
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 #16 from SUSE/develop
- Loading branch information
Showing
23 changed files
with
386 additions
and
26 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,6 +48,7 @@ jobs: | |
- name: Add dependency Helm chart repositories | ||
run: | | ||
helm repo add bitnami https://charts.bitnami.com/bitnami | ||
helm repo add nfs-ganesha-server-and-external-provisioner https://kubernetes-sigs.github.io/nfs-ganesha-server-and-external-provisioner/ | ||
helm repo update | ||
- name: Host charts repository on GitHub Pages | ||
uses: helm/[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
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: nfs-server-provisioner | ||
repository: https://kubernetes-sigs.github.io/nfs-ganesha-server-and-external-provisioner/ | ||
version: 1.8.0 | ||
digest: sha256:17d02ec93947c92806da70bda22b675ce7001873b0a68cb908b9714256704503 | ||
generated: "2024-09-19T16:06:10.718178856+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,14 @@ | ||
apiVersion: v2 | ||
name: nfs-server-provisioner | ||
description: Helm chart for managing WordPress | ||
type: application | ||
version: 0.1.0 | ||
appVersion: "4.0.8" | ||
dependencies: | ||
- name: nfs-server-provisioner | ||
version: 1.8.0 | ||
repository: https://kubernetes-sigs.github.io/nfs-ganesha-server-and-external-provisioner/ | ||
home: https://github.com/SUSE/lab-setup/tree/main/charts/nfs-server-provisioner | ||
maintainers: | ||
- name: devpro | ||
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,46 @@ | ||
# NFS server provisioner | ||
|
||
This Helm chart will install [NFS Server Provisioner](https://github.com/kubernetes-sigs/nfs-ganesha-server-and-external-provisioner) in a Kubernetes cluster. | ||
|
||
## Quick start | ||
|
||
Install the application with the 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 nfs-server-provisioner suse-lab-setup/nfs-server-provisioner --namespace nfs-provisioner --create-namespace | ||
``` | ||
|
||
Look at [values.yaml](values.yaml) for the configuration. | ||
|
||
Clean-up: | ||
|
||
```bash | ||
helm delete nfs-server-provisioner | ||
kubectl delete ns nfs-provisioner | ||
``` | ||
|
||
## Upstream version update | ||
|
||
- Look for the available versions: | ||
|
||
```bash | ||
# adds bitnami helm chart repository | ||
helm repo add nfs-ganesha-server-and-external-provisioner https://kubernetes-sigs.github.io/nfs-ganesha-server-and-external-provisioner/ | ||
helm repo update | ||
|
||
# lists available charts | ||
helm search repo nfs-server-provisioner | ||
``` | ||
|
||
- Update [Chart.yaml](Chart.yaml) | ||
|
||
- Update Chart.lock file: | ||
|
||
```bash | ||
helm dependency update | ||
``` |
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,7 @@ | ||
# refers to https://github.com/kubernetes-sigs/nfs-ganesha-server-and-external-provisioner/blob/master/charts/nfs-server-provisioner/values.yaml | ||
nfs-server-provisioner: | ||
storageClass: | ||
defaultClass: true | ||
mountOptions: | ||
- vers=3 | ||
- nolock |
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
dependencies: | ||
- name: wordpress | ||
repository: https://charts.bitnami.com/bitnami | ||
version: 19.2.5 | ||
digest: sha256:9ecd8b6020982dfb58440e219ed45aadb2856be4c8719b94b364f85fc079e557 | ||
generated: "2024-09-04T14:30:06.1580989+02:00" | ||
version: 23.1.15 | ||
digest: sha256:75e86638c376cf1a29ffe65dd2d723e30201f21964d90b39d35a73f40c3f3e7e | ||
generated: "2024-09-19T16:23:42.643837319+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
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,103 @@ | ||
#!/bin/bash | ||
|
||
####################################### | ||
# Login to Keycloak and get an access token | ||
# Globals: | ||
# SSO_ACCESS_TOKEN | ||
# Arguments: | ||
# kc_url (Keycloak) | ||
# kc_realm (Keycloak) | ||
# kc_client_id (Keycloak) | ||
# kc_client_secret (Keycloak) | ||
# kc_username (Keycloak) | ||
# kc_password (Keycloak) | ||
# Examples: | ||
# keycloak_login https://sso.suse.com instruqt suse xxxxxx admin password | ||
####################################### | ||
keycloak_login() { | ||
local kc_url=$1 | ||
local kc_realm=$2 | ||
local kc_client_id=$3 | ||
local kc_client_secret=$4 | ||
local kc_username=$5 | ||
local kc_password=$6 | ||
|
||
local response | ||
response=$(curl -s -X POST "$kc_url/realms/$kc_realm/protocol/openid-connect/token" \ | ||
-H 'Content-Type: application/x-www-form-urlencoded' \ | ||
--data-urlencode "client_id=$kc_client_id" \ | ||
--data-urlencode "client_secret=$kc_client_secret" \ | ||
--data-urlencode "username=$kc_username" \ | ||
--data-urlencode "password=$kc_password" \ | ||
--data-urlencode 'grant_type=password') | ||
|
||
echo $response | jq -r .access_token | ||
} | ||
|
||
####################################### | ||
# Create a user in Keycloak | ||
# Arguments: | ||
# kc_url (Keycloak) | ||
# kc_realm (Keycloak) | ||
# kc_access_token (Keycloak) | ||
# username | ||
# password | ||
# Examples: | ||
# keycloak_create_user https://sso.suse.com instruqt $SSO_ACCESS_TOKEN user password group | ||
####################################### | ||
keycloak_create_user() { | ||
local kc_url=$1 | ||
local kc_realm=$2 | ||
local kc_access_token=$3 | ||
local username=$4 | ||
local password=$5 | ||
local group=$6 | ||
|
||
local user_request | ||
user_request=$(cat <<EOF | ||
{ | ||
"username": "$username", | ||
"enabled": true, | ||
"emailVerified": true, | ||
"requiredActions": [], | ||
"email": "$username@instruqt.suse.io", | ||
"groups": ["$group"], | ||
"credentials": [ | ||
{ | ||
"type": "password", | ||
"value": "$password" | ||
} | ||
] | ||
} | ||
EOF | ||
) | ||
|
||
curl -s -X POST "$kc_url/admin/realms/$kc_realm/users" \ | ||
-H "Authorization: Bearer $kc_access_token" \ | ||
-H 'Content-Type: application/json' \ | ||
--data-binary "$user_request" | ||
} | ||
|
||
####################################### | ||
# Delete a user in Keycloak | ||
# Arguments: | ||
# kc_url (Keycloak) | ||
# kc_realm (Keycloak) | ||
# kc_access_token (Keycloak) | ||
# username | ||
# Examples: | ||
# keycloak_delete_user https://sso.suse.com instruqt $SSO_ACCESS_TOKEN user | ||
####################################### | ||
keycloak_delete_user() { | ||
local kc_url=$1 | ||
local kc_realm=$2 | ||
local kc_access_token=$3 | ||
local username=$4 | ||
|
||
local user_id | ||
user_id=$(curl -s -X GET "$kc_url/admin/realms/$kc_realm/users?username=$username" \ | ||
-H "Authorization: Bearer $kc_access_token" | jq -r .[0].id) | ||
|
||
curl -s -X DELETE "$kc_url/admin/realms/$kc_realm/users/$user_id" \ | ||
-H "Authorization: Bearer $kc_access_token" | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,49 @@ | ||
#!/bin/bash | ||
|
||
####################################### | ||
# Create an Ingestion API key for SUSE Observability | ||
# Output: | ||
# The ingestion API key | ||
# Arguments: | ||
# url (SUSE Observability) | ||
# service_token (SUSE Observability) | ||
# cluster_name | ||
# Examples: | ||
# observability_create_ingestion_api_key https://obs.suse.com/ xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx demo | ||
####################################### | ||
observability_create_ingestion_api_key() { | ||
local url=$1 | ||
local service_token=$2 | ||
local cluster_name=$3 | ||
|
||
local resp | ||
resp=$(/usr/local/bin/sts ingestion-api-key create --name $cluster_name -o json --url $url --service-token $service_token) | ||
|
||
echo $resp | jq -r '."ingestion-api-key".apiKey' | ||
} | ||
|
||
####################################### | ||
# Delete an Ingestion API key for SUSE Observability | ||
# Arguments: | ||
# url (SUSE Observability) | ||
# service_token (SUSE Observability) | ||
# cluster_name | ||
# Examples: | ||
# observability_delete_ingestion_api_key https://obs.suse.com/ xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx demo | ||
####################################### | ||
observability_delete_ingestion_api_key() { | ||
local url=$1 | ||
local service_token=$2 | ||
local cluster_name=$3 | ||
|
||
local keys key_id | ||
|
||
keys=$(/usr/local/bin/sts ingestion-api-key list -o json --url $url --service-token $service_token) | ||
key_id=$(echo $keys | jq -r '."ingestion-api-keys"[] | select(.name == "'$cluster_name'") | .id') | ||
if [ -n "$key_id" ]; then | ||
/usr/local/bin/sts ingestion-api-key delete --id $key_id --url $url --service-token $service_token | ||
echo ">>> Ingestion API key for cluster '${cluster_name}' deleted" | ||
else | ||
echo ">>> Ingestion API key for cluster '${cluster_name}' not found" | ||
fi | ||
} |
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,12 @@ | ||
#!/bin/bash | ||
|
||
####################################### | ||
# Install the SUSE Observability CLI | ||
####################################### | ||
observability_install_cli() { | ||
if ! [ -x "$(command -v sts)" ]; then | ||
curl -o- https://dl.stackstate.com/stackstate-cli/install.sh | STS_CLI_LOCATION=/usr/local/bin bash | ||
else | ||
echo ">>> sts CLI already installed" | ||
fi | ||
} |
Oops, something went wrong.