Oauth2 Proxy authentication using Azure and Nginx ingress controller hosted in Kubernetes through ArgoCD

Mr DevOps 🐳 ☸ ☁️ 🌐
8 min readDec 1, 2022

In this article , we would explain how to set up Oauth2 proxy in your organization using Azure , ArgoCD to set up more security during your application access.

What is Oauth2 proxy ?

Oauth2 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.

In our article , we will explain how to set up a simple hello world app ( Not Kibana and elastic search )

Prerequisites.

  • ArgoCD
  • AKS with Nginx Ingress controller installed.
  • Application registred in Application registration in Azure.
  • Working app ( Hello World application ).
  • GitHub repository

1- Install Nginx ingress controller in your AKS kubernetes cluster.

Once installed make sure that ingress controller pod is up and running.

2- Deploy a demo application “ Hello World”

  apiVersion: v1
kind: Service
metadata:
name: canary-demo
namespace: kubecost
spec:
ports:
- name: http
port: 80
protocol: TCP
targetPort: http
selector:
app: canary-demo
sessionAffinity: None
type: ClusterIP
---
apiVersion: v1
kind: Pod
metadata:
labels:
app: canary-demo
name: canary-demo-57dcc97cc5-5xsfb
namespace: kubecost
spec:
containers:
- image: gcr.io/google-samples/hello-app:1.0
imagePullPolicy: Always
name: canary-demo
ports:
- containerPort: 8080
name: http
protocol: TCP

And once deployed , make sure the pod is running perfectly.

--

--