oauth2-proxy

by joaquinito2051

Helm chartv0.13.1App 3.1.0

A reverse proxy that provides authentication with Google, Github or other providers

About this chart

oauth2-proxy

oauth2-proxy is a reverse proxy and static file server that provides authentication using Providers (Google, GitHub, and others) to validate accounts by email, domain or group.

TL;DR;

$ helm install stable/oauth2-proxy

Introduction

This chart bootstraps an oauth2-proxy deployment on a Kubernetes cluster using the Helm package manager.

Installing the Chart

To install the chart with the release name my-release:

$ helm install stable/oauth2-proxy --name my-release

The command deploys oauth2-proxy on the Kubernetes cluster in the default configuration. The configuration section lists the parameters that can be configured during installation.

Installing on openshift

To install the chart on openshift, you will have to use a different image than the vanilla one: openshift/oauth-proxy . Sources available here : https://github.com/openshift/oauth-proxy

You will also have to set the isOpenshift value to true.

The installation procedure is then the same as kubernetes.

Uninstalling the Chart

To uninstall/delete the my-release deployment:

$ helm delete my-release

The command removes all the Kubernetes components associated with the chart and deletes the release.

Configuration

The following table lists the configurable parameters of the oauth2-proxy chart and their default values.

ParameterDescriptionDefault
isOpenshiftIs this going to be deployed on openshift ?false
affinitynode/pod affinitiesNone
authenticatedEmailsFile.enabledEnables authorize individual email addressesfalse
authenticatedEmailsFile.templateName of the configmap that is handled outside of that chart""
authenticatedEmailsFile.restricted_accessemail addresses list config""
config.clientIDoauth client ID""
config.clientSecretoauth client secret""
config.cookieSecretserver specific cookie for the secret; create a new one with `openssl rand -base64 32head -c 32
config.existingSecretexisting Kubernetes secret to use for OAuth2 credentials. See secret template for the required valuesnil
config.configFilecustom oauth2_proxy.cfg contents for settings not overridable via environment nor command line""
config.existingConfigexisting Kubernetes configmap to use for the configuration file. See config template for the required valuesnil
config.google.adminEmailuser impersonated by the google service account""
config.google.serviceAccountJsongoogle service account json contents""
config.google.existingConfigexisting Kubernetes configmap to use for the service account file. See google secret template for the required valuesnil
extraArgskey:value list of extra arguments to give the binary{}
image.pullPolicyImage pull policyIfNotPresent
image.repositoryImage repositoryquay.io/pusher/oauth2_proxy
image.tagImage tagv3.1.0
imagePullSecretsSpecify image pull secretsnil (does not add image pull secrets to deployed pods)
ingress.enabledenable ingressfalse
livenessProbe.enabledenable Kubernetes livenessProbe. Disable to use oauth2-proxy with Istio mTLS. See Istio FAQtrue
livenessProbe.initialDelaySecondsnumber of seconds0
livenessProbe.timeoutSecondsnumber of seconds1
nodeSelectornode labels for pod assignment{}
podAnnotationsannotations to add to each pod{}
podLabelsadditional labesl to add to each pod{}
priorityClassNamepriorityClassNamenil
readinessProbe.enabledenable Kubernetes readinessProbe. Disable to use oauth2-proxy with Istio mTLS. See Istio FAQtrue
readinessProbe.initialDelaySecondsnumber of seconds0
readinessProbe.timeoutSecondsnumber of seconds1
readinessProbe.periodSecondsnumber of seconds10
readinessProbe.successThresholdnumber of successes1
replicaCountdesired number of pods1
resourcespod resource requests & limits{}
service.portport for the service80
service.typetype of serviceClusterIP
service.clusterIPcluster ip addressnil
service.loadBalancerIPip of load balancernil
service.loadBalancerSourceRangesallowed source ranges in load balancernil
tolerationsList of node taints to tolerate[]

Specify each parameter using the --set key=value[,key=value] argument to helm install. For example,

$ helm install stable/oauth2-proxy --name my-release \
  --set=image.tag=v0.0.2,resources.limits.cpu=200m

Alternatively, a YAML file that specifies the values for the above parameters can be provided while installing the chart. For example,

$ helm install stable/oauth2-proxy --name my-release -f values.yaml

Tip: You can use the default values.yaml

Deploy oauth2-proxy with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has oauth2-proxy 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.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartoauth2-proxy is pinned at v0.13.1 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. 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