Giter VIP home page Giter VIP logo

crossplane-contrib / provider-spotify Goto Github PK

View Code? Open in Web Editor NEW
24.0 6.0 0.0 123 KB

A @crossplane provider for managing Spotify playlists in Kubernetes

Home Page: https://marketplace.upbound.io/providers/crossplane-contrib/provider-spotify

License: Apache License 2.0

Makefile 28.99% Go 55.63% Dockerfile 4.46% HCL 0.34% Shell 7.44% Python 3.14%
crossplane crossplane-provider iac spotify kubernetes

provider-spotify's Introduction

Provider Spotify

CI GitHub release Go Report Card

provider-spotify is a Crossplane provider that is built using Upjet code generation tools and exposes XRM-conformant managed resources for the Spotify API. It currently only supports managing Spotify playlists.

This crossplane provider is generated from conradludgate/terraform-provider-spotify.

Table of contents

Getting Started

Requirements

You need to create a Spotify developer app and run Spotify's authorization proxy server spotify-auth-proxy. It is recommended to install the spotify-auth-proxy in the same Kubernetes cluster as the provider-spotify via this Helm chart. Check its README and the comments in the values.yaml to set it up.

Additional documentation:

Configuration

Assuming that spotify-auth-proxy is running, and that the Auhentication against Spotify has been successful, you need to create a Kubernetes Secret that contains the API Key and the URL of the spotify-auth-proxy Kubernetes Service.

  • If you have not set a custom API Key in the Helm chart (default):

    export SPOTIFY_API_KEY=$(kubectl -n spotify-auth-proxy logs spotify-auth-proxy-0 | grep APIKey | cut -d':' -f2 | xargs)
  • If you have set a custom API Key in the Helm chart:

    export SPOTIFY_API_KEY=$(kubectl -n spotify-auth-proxy exec spotify-auth-proxy-0 -- env | grep API_KEY | cut -d'=' -f2)

Next, create the Kubernetes Secret with the API Key and the URL of the spotify-auth-proxy Kubernetes Service:

sed -e "s/YOUR_API_KEY/$SPOTIFY_API_KEY/" examples/providerconfig/secret.yaml.tmpl > examples/providerconfig/secret.yaml

Installation

Install the provider by using the following command after changing the image tag to the latest release using either of the following methods:

  • Using up:

    up ctp provider install crossplane-contrib/provider-spotify:v0.2.2
  • Using crossplane:

    crossplane xpkg install provider crossplane-contrib/provider-spotify:v0.2.2
  • Using declarative installation:

    kubectl apply -f examples/install.yaml

You can see the API reference here.

Finally, you can install the Secret and the ProviderConfig:

kubectl apply -f examples/providerconfig/

You should get outputs similar to the following:

➜ kubeclt get providers
NAME               INSTALLED   HEALTHY   PACKAGE                                      AGE
provider-spotify   True        True      crossplane-contrib/provider-spotify:v0.2.0   12m
➜ kubectl get spotify
NAME                                           AGE
providerconfig.spotify.crossplane.io/default   4m9s
➜ kubectl get secrets provider-spotify-example-creds
NAME                             TYPE     DATA   AGE
provider-spotify-example-creds   Opaque   1      7m7s

Usage

See this example playlist. Example outputs:

➜ kubectl apply -f examples/playlist/playlist.yaml
playlist.playlist.spotify.crossplane.io/crossplane-can-play-music created
➜ kubectl get spotify
NAME                                                                READY   SYNCED   EXTERNAL-NAME            AGE
playlist.playlist.spotify.crossplane.io/crossplane-can-play-music   True    True     3HXwBJSvBPHnWHQZ3z0o3b   4m44s

NAME                                           AGE
providerconfig.spotify.crossplane.io/default   13m

NAME                                                                             AGE     CONFIG-NAME   RESOURCE-KIND   RESOURCE-NAME
providerconfigusage.spotify.crossplane.io/46502e43-db94-4ba1-85bc-6f7df2352459   4m44s   default       Playlist        crossplane-can-play-music

📣 🔊 Side note, this is a real playlist, which is tracked in this Git repository, PRs are always welcome!

Developing

Run code-generation pipeline:

go run cmd/generator/main.go "$PWD"

Run against a Kubernetes cluster:

make run

Build, push, and install:

make all

Build binary:

make build

Report a Bug

For filing bugs, suggesting improvements, or requesting new features, please open an issue.

provider-spotify's People

Contributors

tampakrap avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.