/cfapi

CF API kyma module

Primary LanguageGoApache License 2.0Apache-2.0

CFAPI Kyma Module

Overview

CF API Kyma Module is providing a CF API to run on top of Kyma, using the open source Korifi project Once installed, one could use the cf cli to connect and deploy workloads.

Custom Resource (CR) Specification

Property Optional Default Description
RootNamespace Optional cf Root namespace for CF resources
AppImagePullSecret Optional By default a localregistry will be deployed and used for application images Dockerregistry secret pointing to a custom docker registry
UAA Optional "https://uaa.cf.eu10.hana.ondemand.com" UAA URL to be used for authentication
CFAdmins Optional By default Kyma cluster-admins will become CF admins List of users, which will become CF administrators.A user is expected in format sap.ids:<sap email> example sap.ids:samir.zeort@sap.com

Prerequisites

  • A Kyma cluster preconfigured with UAA as OIDC provider
  • Istio Kyma module installed

Installation

  1. Kyma environment

    You need a Kyma environment which is configured with UAA as an OIDC provider, with following parameters

{
  "administrators": [
    "sap.ids:myfirstname.mysecondname@sap.com"
  ],
  "autoScalerMax": 3,
  "autoScalerMin": 3,
  "oidc": {
    "clientID": "cf",
    "groupsClaim": "",
    "issuerURL": "https://uaa.cf.eu10.hana.ondemand.com/oauth/token",
    "signingAlgs": [
      "RS256"
    ],
    "usernameClaim": "user_name",
    "usernamePrefix": "sap.ids:"
  }
}
  1. Kyma Access

Use that script to generate a stable kubeconfig:
https://github.tools.sap/unified-runtime/trinity/blob/main/scripts/tools/generate-kyma-kubeconfig.sh

Note: that step requires an UAA client (uaac), which requires Ruby runtime

  1. Istio installed

    If Istio Kyma module is not installed, you can do it with:

make from this repository

make install-istio

Or directly with kubectl

	kubectl label namespace cfapi-system istio-injection=enabled --overwrite
	kubectl apply -f https://github.com/kyma-project/istio/releases/latest/download/istio-manager.yaml
	kubectl apply -f https://github.com/kyma-project/istio/releases/latest/download/istio-default-cr.yaml
  1. Deploy CF API

Deploy the resources from a particular release version to kyma

kubectl apply -f cfapi-crd.yaml
kubectl apply -f cfapi-manager.yaml
kubectl apply -f cfapi-default-cr.yaml

Wait for a Ready state of the CFAPI resource and read the CF URL

kubectl get -n cfapi-system cfapi
NAME             STATE   URL
default-cf-api   Ready   https://cfapi.cc6e362.kyma.ondemand.com
  1. Configure CF cli

    Set cf cli to point to CF API

cf api https://cfapi.cc6e362.kyma.ondemand.com 
  1. CF Login

cf login --sso

Usage

Use CF cli to deploy applications as on a normal CF. The buildpacks used are native community buildpacks.

Development

Contributing

See the Contributing Rules.

Code of Conduct

See the Code of Conduct document.

Licensing

See the license file.