endpoint-auth-service
A Helm chart for running the endpoint-auth-service on kubernetes.
About this chart
endpoint-auth-service
A Helm chart for running the endpoint-auth-service on kubernetes.
Maintainers
| Name | Url | |
|---|---|---|
| wistefan | [email protected] |
Additional Information
The chart contains the endpoint-auth-service and components to add the sidecar proxy to target services.
Components
The chart deploys the following components:
- the endpoint-configuartion-service - configuration under the key "configService"
- (optional) the configmap-updater - automatically updates the configmap to be used by the proxy
- (optional) the sidecar-injector - automatically injects the sidecar-proxy, configuration under the key "sidecarInjector"
- (optional) the ishare-auth-provider - configuration under the key "ishare"
Sidecar-injection
The chart provides the capability to automatically inject the sidecar-proxy into pods. It makes use of Mutating Admission Webhooks. The webhook gets executed on pod-creation and injects the sidecar, its init-containers and the volumes into the pod.
The injected elements are:
- the (container) envoy-proxy
- the (container) resource-updater to trigger config reloads for envoy
- the (initContainer) init-iptables to redirect traffic to the proxy
- the (initContaienr) resource-updater to fill the initial-config-folder
- the (volume) envoy-configmap that mounts the config-map generated by the endpoint-configuration-service
- the (volume) envoy-config-folder that is shared between envoy and the resource-updater
Since the injection-service does require certificate authentication, you have two options:
- (Recommended) Hand it over to cert-manager
If you have cert-manager installed, you can let it handle the certificate generation. The easiest way is to use a self-signed issuer:
apiVersion: cert-manager.io/v1
kind: ClusterIssuer
metadata:
name: self-signed
spec:
selfSigned: {}
And reference it in the values.yaml at sidecarInjector.certificate.issuer and set the sidecarInjector.certificate.type: cert-manager. cert-mananger will then generate
a sufficient certificate and inject it into the MutatingWebhookConfiguration.
- Generate a certificate and provide it as value
Use any tool available to generate a certificate(make sure to provide a SAN) and insert it at sidecarInjector.certificate.cert and sidecarInjector.certificate.key
and set the type to sidecarInjector.certificate.type: inline
To select the pods that should get injected, they need to be annotated. The annotation-namespace can be configured via sidecarInjector.annotationNamespace.
In addition to the namespace, request has to be added and the configuration-key envoy-sidecar needs to be set as its value.
An example would look like:
apiVersion: apps/v1
kind: Deployment
metadata:
name: echo-server
template:
metadata:
annotations:
sidecar.k8s.fiware.org/request: "envoy-sidecar"
spec:
containers:
- image: k8s.gcr.io/echoserver:1.4
In order to allow proper namespace restrictions, the webhook can be restricted to certain namespaces with the configuration under the key sidecarInjector.restrictNamespace.
With this example configuration:
sidecarInjector:
restrictNamespace:
enabled: true
label: sidecar-injection
value: enabled
only pods in namespaces labeled with sidecar-injection=enabled will get injected. The label can be applied via kubectl label namespace my-namespace sidecar-injection=enabled
Service Mesh compatibility
In its current version, the injected proxy will most probably(except some edge-cases) break any integration of the injected pod with a service-mesh like istio or linkerd, since they use similar iptables to redirect traffic to their own proxies. If the injected init-container sets up the iptables to forward every outgoing traffic the sidecar-proxy, this will be disturbed. It's planned to offer native support for at least istio in the future(contributions for any mesh are welcome), but for now only workarounds might be a possibility.
A potential workaround might be to setup the iptables, so that the traffic from the sidecar proxy does not directly get returned, but instead is also redirected to the mesh-proxy. Check the init-iptables container for that.
Source Code
Values
| Key | Type | Default | Description |
|---|---|---|---|
| authProvider.address | string | "ishare-auth" | address to the auth-service |
| authProvider.port | int | 8080 | port of the auth-service |
| configService.additionalAnnotations | object | {} | additional annotations for the deployment, if required |
| configService.additionalLabels | object | {} | additional labels for the deployment, if required |
| configService.additonalEnvVars | list | [] | a list of additional env vars to be set, check the endpoint-configuration-service documentation for all available options |
| configService.affinity | object | {} | affinity template ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity |
| configService.autoscaling.enabled | bool | false | |
| configService.autoscaling.maxReplicas | int | 10 | maximum number of running pods |
| configService.autoscaling.metrics | list | [] | metrics to react on |
| configService.autoscaling.minReplicas | int | 1 | minimum number of running pods |
| configService.configmapUpdater.enabled | bool | true | should the updater be deployed? |
| configService.configmapUpdater.image.pullPolicy | string | "IfNotPresent" | specification of the image pull policy |
| configService.configmapUpdater.image.repository | string | "quay.io/fiware/envoy-configmap-updater" | configmap updater image name ref: https://quay.io/repository/fiware/envoy-configmap-updater |
| configService.configmapUpdater.image.tag | string | "0.4.3" | tag of the image to be used |
| configService.db.password | string | "pass" | password for connecting the database |
| configService.db.url | string | "jdbc:h2:mem:devDb;LOCK_TIMEOUT=10000;DB_CLOSE_ON_EXIT=FALSE" | host of the database to be used - be aware, defaults to an in-memory db |
| configService.db.user | string | "ecs" | user for connecting the database |
| configService.fullnameOverride | string | "" | option to override the fullname config in the _helpers.tpl |
| configService.healthPort | int | 9090 | port to request health information at |
| configService.image.pullPolicy | string | "IfNotPresent" | specification of the image pull policy |
| configService.image.repository | string | "quay.io/fiware/endpoint-configuration-service" | endpoint-configuration-service image name ref: https://quay.io/repository/fiware/endpoint-configuration-service |
| configService.image.tag | string | "0.4.3" | tag of the image to be used |
| configService.ingress.annotations | object | {} | annotations to be added to the ingress |
| configService.ingress.enabled | bool | false | should there be an ingress to connect configService with the public internet |
| configService.ingress.hosts | list | [] | all hosts to be provided |
| configService.ingress.tls | list | [] | configure the ingress' tls |
| configService.livenessProbe.failureThreshold | int | 3 | |
| configService.livenessProbe.initialDelaySeconds | int | 30 | |
| configService.livenessProbe.periodSeconds | int | 10 | |
| configService.livenessProbe.successThreshold | int | 1 | |
| configService.livenessProbe.timeoutSeconds | int | 30 | |
| configService.meshExtension.authProviderName | string | `"outbound | 80 |
| configService.meshExtension.enabled | bool | false | |
| configService.meshExtension.workloadSelector.name | string | "app" | |
| configService.meshExtension.workloadSelector.value | string | "app" | |
| configService.meshExtensionUpdater.enabled | bool | false | |
| configService.meshExtensionUpdater.image.pullPolicy | string | "IfNotPresent" | specification of the image pull policy |
| configService.meshExtensionUpdater.image.repository | string | "quay.io/fiware/mesh-extension-updater" | image name ref: https://quay.io/repository/fiware/mesh-extension-updater |
| configService.meshExtensionUpdater.image.tag | string | "0.4.3" | tag of the image to be used |
| configService.nameOverride | string | "" | option to override the name config in the _helpers.tpl |
| configService.nodeSelector | object | {} | selector template ref: https://kubernetes.io/docs/user-guide/node-selection/ |
| configService.port | int | 8080 | port that the endpoint-configuration-service container uses |
| configService.priorityClassName | string | "" | priority class to be assigned to the pods ref: https://kubernetes.io/docs/concepts/scheduling-eviction/pod-priority-preemption/ |
| configService.prometheus.enabled | bool | true | should prometheus scrape be enabled |
| configService.prometheus.path | string | "/prometheus" | path for prometheus scrape |
| configService.prometheus.port | int | 9090 | port prometheus scrape is available at |
| configService.readinessProbe.failureThreshold | int | 3 | |
| configService.readinessProbe.initialDelaySeconds | int | 31 | |
| configService.readinessProbe.periodSeconds | int | 10 | |
| configService.readinessProbe.successThreshold | int | 1 | |
| configService.readinessProbe.timeoutSeconds | int | 30 | |
| configService.replicaCount | int | 1 | initial number of target replications, can be different if autoscaling is enabled |
| configService.resources | object | {} | |
| configService.revisionHistoryLimit | int | 3 | number of old replicas to be retained |
| configService.route.annotations | object | {} | annotations to be added to the route |
| configService.route.enabled | bool | false | |
| configService.route.tls | object | {} | tls configuration for the route |
| configService.service.annotations | object | {} | addtional annotations, if required |
| configService.service.port | int | 8080 | port to be used by the service |
| configService.service.type | string | "ClusterIP" | service type |
| configService.serviceAccount | object | {"create":false} | if a configService configService service account should be used, it can be configured here ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/ |
| configService.serviceAccount.create | bool | false | specifies if the account should be created |
| configService.tolerations | list | [] | tolerations template ref: ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/ |
| configService.topologySpreadConstraints | list | [] | topology spread constraints template ref: https://kubernetes.io/docs/concepts/scheduling-eviction/topology-spread-constraints/ |
| configService.updateStrategy.rollingUpdate | object | {"maxSurge":1,"maxUnavailable":0} | new pods will be added gradually |
| configService.updateStrategy.rollingUpdate.maxSurge | int | 1 | number of pods that can be created above the desired amount while updating |
| configService.updateStrategy.rollingUpdate.maxUnavailable | int | 0 | number of pods that can be unavailable while updating |
| configService.updateStrategy.type | string | "RollingUpdate" | type of the update |
| fullnameOverride | string | "" | option to override the fullname config in the _helpers.tpl |
| ishare.additionalAnnotations | object | {} | additional annotations for the deployment, if required |
| ishare.additionalLabels | object | {} | additional labels for the deployment, if required |
| ishare.affinity | object | {} | affinity template ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity |
| ishare.autoscaling.enabled | bool | false | |
| ishare.autoscaling.maxReplicas | int | 10 | maximum number of running pods |
| ishare.autoscaling.metrics | list | [] | metrics to react on |
| ishare.autoscaling.minReplicas | int | 1 | minimum number of running pods |
| ishare.enabled | bool | true | should the ishare-auth-provider be enabled? |
| ishare.fullnameOverride | string | "" | option to override the fullname config in the _helpers.tpl |
| ishare.image.pullPolicy | string | "IfNotPresent" | specification of the image pull policy |
| ishare.image.repository | string | "quay.io/fiware/ishare-auth-provider" | endpoint-configuration-service image name ref: https://quay.io/repository/fiware/ishare-auth-provider |
| ishare.image.tag | string | "0.4.3" | tag of the image to be used |
| ishare.ingress.annotations | object | {} | annotations to be added |
Deploy endpoint-auth-service with OpenTenant
Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has endpoint-auth-service on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.
- Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
- Place the chartendpoint-auth-service is pinned at v0.2.0 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
- ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below opentenant validate opentenant.yaml terraform init && terraform apply