{"id":19839326,"url":"https://github.com/redislabs/gkemarketplace","last_synced_at":"2025-05-01T18:31:57.217Z","repository":{"id":36423473,"uuid":"188002595","full_name":"RedisLabs/gkemarketplace","owner":"RedisLabs","description":null,"archived":false,"fork":false,"pushed_at":"2025-03-26T13:27:09.000Z","size":741,"stargazers_count":9,"open_issues_count":3,"forks_count":7,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-06T16:54:21.401Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RedisLabs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-05-22T09:06:21.000Z","updated_at":"2024-12-04T14:33:42.000Z","dependencies_parsed_at":"2022-09-20T21:22:26.567Z","dependency_job_id":"0be47277-190d-4665-be39-5e2eac650a95","html_url":"https://github.com/RedisLabs/gkemarketplace","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RedisLabs%2Fgkemarketplace","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RedisLabs%2Fgkemarketplace/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RedisLabs%2Fgkemarketplace/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RedisLabs%2Fgkemarketplace/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RedisLabs","download_url":"https://codeload.github.com/RedisLabs/gkemarketplace/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251924835,"owners_count":21666043,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-12T12:21:49.429Z","updated_at":"2025-05-01T18:31:57.210Z","avatar_url":"https://github.com/RedisLabs.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Overview\n\nThis document describes the installation process for [Redis Enterprise](https://github.com/RedisLabs/redis-enterprise-k8s-docs) via Google Cloud Marketplace. There are two ways to install Redis Enterprise in GKE, one using GCP Console UI and using CLI.  \n\n## Quick install with Google Cloud Marketplace (from GKE Console)\n\nGet up and running with a few clicks! Install this Redis Enterprise app to a\nGoogle Kubernetes Engine cluster using Google Cloud Marketplace. You can do this from the Applications tab in the [GKE listing page](https://console.cloud.google.com/marketplace/product/redislabs-public/redis-enterprise) in the Cloud Console.\n\n## Manual install (CLI)\n\n### Set up command-line tools\n\nYou'll need the following tools in your development environment:\n\n- [gcloud](https://cloud.google.com/sdk/gcloud/)\n- [kubectl](https://kubernetes.io/docs/reference/kubectl/overview/)\n- [docker](https://docs.docker.com/install/)\n- [git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git)\n- [helm](https://helm.sh/docs/intro/install/)\n\nConfigure `gcloud` as a Docker credential helper:\n\n```shell\ngcloud auth login\ngcloud auth configure-docker\n```\n\n### Obtain license key from Google Cloud Marketplace\n!! Not to be confused with the Redis license, which you would receive from Redis. This license key simply enables the pay as you go billing integration into your GKE account!!\n\n#### Purchase Redis Enterprise on GKE via GCP MP in a GCP project\n\nSee the following screenshot for an example\n\n![Purchase Redis Enterprise](images/license-1.png)\n\n#### Generate a license file for the GCP project for the subscription entitlement for billing\n\nSee the following screenshot for an example. Click the “Generate license key” button to generate the license key.  It will automatically be downloaded onto your computer. \n\n![Get License file for Redis Enterprise](images/license-2.png)\n\nSave the license key file preferably as ```license-key.yaml```.\n\n!! Reminder, not to be confused with the Redis license, which you would receive from Redis. This license key simply enables the pay as you go billing integration into your GKE account!!\n\n### Permissions\n\nUsers who build and deploy the solution would need \"Kubernetes Engine Admin\" and \"Editor\" permissions.\n\n### Create (or use an existing) Google Kubernetes Engine cluster\n\nRedis Enterprise requires at least 5 CPUs and 16GB RAM for each worker node. If you already have an existing cluster that matches the CPU and memory requirements, then skip this step. If not, create a new GKE cluster that matches this specification. See below for an example\n\n```shell\nexport CLUSTER=redis-cluster\nexport ZONE=us-west1-a\ngcloud container clusters create $CLUSTER --zone $ZONE --machine-type n2-standard-8\n```\n\n```shell\ngcloud container clusters get-credentials \"$CLUSTER\" --zone \"$ZONE\"\n```\nCreate a namespace where redis cluster and database should be created\n\n```shell\nkubectl create namespace redis\n```\n\n```shell\nkubectl config set-context --current --namespace=redis\n```\n\n### Clone the repo \n\n```shell\ngit clone https://github.com/RedisLabs/gkemarketplace\n```\n\n\n### Prepare Environment variables\n\n---\n**NOTE**\n\nRedis version tags are in the format Major.Minor.Patch-Sub but GKE Marketplace requires only Major.Minor, so in order to convert Redis version label to Marketplace use zero padded minor, patch and sub. For example: Redis version 6.0.12-05 would become Marketplace version (DEPLOYER_TAG) 6.001205  \n\n---\n\n```shell\nexport APP_INSTANCE_NAME=redis-enterprise-operator\nexport NAMESPACE=redis\nexport TAG=7.8.2-6\nexport DEPLOYER_TAG=7.826\nexport REPO=gcr.io/cloud-marketplace/redislabs-public/redis-enterprise\n```\n\n### Prepare License Key\n\nThe license key is a Kubernetes secret, add a metadata.name for set to application instance name (see APP_INSTANCE_NAME env variable) with a suffix “-reportingsecret” (exactly). For example, if instance name is ```redis-enterprise-operator``` then reporting secret ```metadata.name``` must be ```redis-enterprise-operator-reportingsecret```.\n\n\nFor Development and Testing (get fake_reporting_secret.yaml from GCS first) and then modify the metadata.name\n\n```shell\ngsutil cp gs://cloud-marketplace-tools/reporting_secrets/fake_reporting_secret.yaml .\n```\n\nFor Development (fake_reporting_secret.yaml) or Production (license-key.yaml) add the following to yaml after the apiVersion line\n\n```yaml\nmetadata:\n  name: redis-enterprise-operator-reportingsecret\n```\n\n### Create Roles, RoleBindings and ServiceAccount\n\nCreate namespaced roles (for the redis namespace ) and service account. Note the service account name, which you need for creating cluster roles.\n```\nkubectl apply -f https://raw.githubusercontent.com/RedisLabs/redis-enterprise-k8s-docs/master/role.yaml\nkubectl apply -f https://raw.githubusercontent.com/RedisLabs/redis-enterprise-k8s-docs/master/role_binding.yaml\nkubectl apply -f https://raw.githubusercontent.com/RedisLabs/redis-enterprise-k8s-docs/master/service_account.yaml\n```\n\nSince `schema.yaml` configures RBAC for the jobs, but is not used even for this\nkind of deployment, an alternative is needed. `testapp-*.yaml` files are the\nnamespaced Role portion, and this is the ClusterRole portion. Together these\ncover the RBAC used by the service accounts of the various deployer jobs.\n(In the bundle - generated via helm below - you may notice that the\n`serviceAccountName` fields for the deployer accounts are blank.)\n\nCreate a cluster role for creating cluster scoped custom resources and checking their status. Use the spec below and save it in ```cluster-role.yaml```\n\n```shell\ncat \u003c\u003cEOF | kubectl apply -f -\napiVersion: rbac.authorization.k8s.io/v1\nkind: ClusterRole\nmetadata:\n  name: redis-operator-cluster-role\nrules:\n- apiGroups: [\"apiextensions.k8s.io\"]\n  resources: [\"customresourcedefinitions\"]\n  verbs: [\"get\", \"create\", \"list\", \"patch\"]\n- apiGroups: [\"app.k8s.io\"]\n  resources: [\"applications\"]\n  verbs: [\"get\", \"create\", \"list\", \"patch\"]\n- apiGroups: [\"admissionregistration.k8s.io\"]\n  resources: [\"validatingwebhookconfigurations\"]\n  verbs: [\"*\"]\n- apiGroups: [\"apps\"]\n  resources: [\"deployments\"]\n  verbs: [\"get\", \"create\", \"list\", \"patch\"]\n- apiGroups: [\"\"]\n  resources: [\"secrets\", \"services\"]\n  verbs: [\"get\", \"create\", \"list\", \"patch\"]\n- apiGroups: [\"app.redislabs.com\", \"apiextensions.k8s.io\"]\n  resources: [\"*\"]\n  verbs: [\"*\"]\nEOF\n```\n\nCreate cluster role binding e.g. ```cluster-role-binding.yaml``` \n\n```shell\ncat \u003c\u003cEOF | kubectl apply -f -\nkind: ClusterRoleBinding\napiVersion: rbac.authorization.k8s.io/v1\nmetadata:\n  name: redis-operator-cluster-role-binding\nsubjects:\n- kind: ServiceAccount\n  name: default\n  namespace: redis\n- kind: ServiceAccount\n  name: redis-enterprise-operator\n  namespace: redis\nroleRef:\n  kind: ClusterRole\n  name: redis-operator-cluster-role\n  apiGroup: rbac.authorization.k8s.io\nEOF\n```\n\n### Install the Application CRD\n\nGKE marketplace integration uses Application resource to make easier to manage RedisEnterprise resources as a single application.\n\n```shell\nkubectl apply -f https://raw.githubusercontent.com/GoogleCloudPlatform/marketplace-k8s-app-tools/master/crd/app-crd.yaml\n```\n\n### [Generate bundle from helm](#helm-template-cmd)\n\nRun the helm template to generate operator deployment. \n\n```shell\nhelm template \"$APP_INSTANCE_NAME\" chart/redis-operator  \\\n  --namespace \"$NAMESPACE\" \\\n  --set deployerHelm.image=\"$REPO/deployer:$DEPLOYER_TAG\" \\\n  --set operator.serviceAccountName=\"redis-enterprise-operator\" \\\n  --set operator.image.repository=\"$REPO\" \\\n  --set operator.image.tag=\"$TAG\" \\\n  --set usagemeter.image=\"$REPO/usagemeter\" \\\n  --set usagemeter.tag=\"$TAG\" \\\n  --set reportingSecret=\"$APP_INSTANCE_NAME-reportingsecret\" \\\n  --set ingressAvailable=”True” \\\n  --set operator.nodeMem=16 \\\n  --set operator.nodeCpu=5000 \\\n  --set operator.redisAdmin=admin@example.com \\\n  --set operator.replicas=3 \\\n  --set operator.storageClass=standard \u003e redis-bundle.yaml\n```\n\nApply the generated yaml.\n\n```shell\nkubectl apply -f redis-bundle.yaml\n```\n\n### View the app in the Google Cloud Platform Console\n\nGet the Google Cloud Console URL for your app, then open this URL in your browser:\n\n```shell\necho \"https://console.cloud.google.com/kubernetes/application/${ZONE}/${CLUSTER}/${NAMESPACE}/${APP_INSTANCE_NAME}\"\n```\n\n### Get the status of the cluster\n\nBy default, the application does not have an external IP address. Use `kubectl port-forward` to access the dashboard on the master\nnode at `localhost`.\n\n```\nkubectl port-forward redis-enterprise-cluster-0 8443\n\n```\n\n### Getting the Admin Password\n\nSee [instructions here](https://docs.redislabs.com/latest/rs/faqs/) under \"How to retrieve the username/password for a Redis Enterprise Cluster?\"\n\nIn summary, `kubectl get secret redis-enterprise -o yaml|grep password|cut -d':' -f 2|base64 --decode` should get you the password, and you should already know the username (default `admin@example.com`)\n\n###  Access the Redis-Enterprise service externally\n\n```\nkubectl get services -n $NAMESPACE\n```\n\n**NOTE:**\n\n1. It might take some time for the external IP to be provisioned.\n2. This works out-of-the-box in GKE but not in Anthos, where special measures are needed to configure the Load Balancer.\n\n### Upgrade ### \nIn order to upgrade the operator, recreate the bundle.yaml using the helm [command](#helm-template-cmd).\u003cbr\u003e\nMake sure these params are updated with the new version:\n1. `deployerHelm.image`\n2. `operator.image.tag`\n3. `usagemeter.tag`\n\nApply the generated yaml.\u003cbr\u003e\nYou should expect these operator deployment containers to be updated:\n1. redis-enterprise-operator\n2. admission\n3. usage-meter\n\nIn order to upgrade the REC, edit the spec field: \n```\nredisEnterpriseImageSpec:\n    versionTag: \u003cnew-tag\u003e\n```\n\nThe redis enterprise STS and the services-rigger will restart with the new version. \n\n\n# Uninstall the Application\n\n## Using the Google Cloud Platform Console\n\n1. In the GCP Console, open [Kubernetes Applications](https://console.cloud.google.com/kubernetes/application).\n\n1. From the list of applications, click **Redis-Enterprise**.\n\n1. On the Application Details page, click **Delete**.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fredislabs%2Fgkemarketplace","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fredislabs%2Fgkemarketplace","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fredislabs%2Fgkemarketplace/lists"}