Skip to content

Commit

Permalink
Merge pull request #1 from sl1pm4t/mintel-to-sl1pm4t
Browse files Browse the repository at this point in the history
Rename mintel to sl1pm4t and update Go version
  • Loading branch information
sl1pm4t authored Dec 6, 2023
2 parents 2cbcf28 + dfb3f8d commit 0cd22df
Show file tree
Hide file tree
Showing 31 changed files with 216 additions and 1,492 deletions.
13 changes: 10 additions & 3 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,15 @@ jobs:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- uses: actions/setup-go@v4
with:
go-version-file: 'go.mod'

- run: go build -v

- name: golangci-lint
uses: golangci/golangci-lint-action@v2
uses: golangci/golangci-lint-action@v3
with:
version: v1.29
version: v1.55.2
63 changes: 35 additions & 28 deletions .github/workflows/k8s.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,61 +10,68 @@ jobs:
name: helm-lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: helm-lint-dex
uses: stefanprodan/[email protected]
- uses: actions/checkout@v4

- uses: alexellis/setup-arkade@v1

- uses: alexellis/arkade-get@master
with:
helmv3: 3.0.0
run: |
helmv3 lint charts/dex
kubectl: latest
kustomize: latest
kubeconform: latest
kubeval: latest
helm: latest
jq: latest
yq: latest

- name: helm-lint-dex-k8s-auth
uses: stefanprodan/[email protected]
with:
helmv3: 3.0.0
command: |
helmv3 lint charts/dex-k8s-authenticator
run: |
helm lint charts/dex-k8s-authenticator
- name: helm-template
uses: stefanprodan/[email protected]
with:
helmv3: 3.0.0
command: |
helmv3 template charts/dex --output-dir /github/workspace/rendered-charts/dex
helmv3 template charts/dex-k8s-authenticator --output-dir /github/workspace/rendered-charts/dex-k8s-authenticator
run: |
helm template charts/dex-k8s-authenticator --output-dir ./tmp/workspace/rendered-charts/dex-k8s-authenticator
- name: kubeval
uses: stefanprodan/[email protected]
with:
helmv3: 3.0.0
command: |
kubeval -d /github/workspace/rendered-charts --strict --ignore-missing-schemas
run: |
kubeval -d ./tmp/workspace/rendered-charts --strict --ignore-missing-schemas
e2e:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4

- name: setup-kind
uses: engineerd/setup-kind@v0.5.0
uses: helm/kind-action@v1.5.0
with:
name: kind
cluster_name: kind

- name: build-ci-image
run: |
docker build -t mintel/dex-k8s-authenticator:${GITHUB_SHA} .
kind load docker-image mintel/dex-k8s-authenticator:${GITHUB_SHA}
docker build -t sl1pm4t/dex-k8s-authenticator:${GITHUB_SHA} .
kind load docker-image sl1pm4t/dex-k8s-authenticator:${GITHUB_SHA}
- name: update-helm-values
run: |
set -x
export NODE_IP=$(kubectl get nodes -o jsonpath="{.items[0].status.addresses[0].address}")
export CI_TAG=$GITHUB_SHA
envsubst < ./tests/e2e/helm/dex-overrides.yaml > /tmp/dex-overrides.yaml
envsubst < ./tests/e2e/helm/dex-k8s-auth-overrides.yaml > /tmp/dex-k8s-auth-overrides.yaml
- name: install-dex
run: |
helm install -f /tmp/dex-overrides.yaml dex ./charts/dex
helm repo add dexidp https://charts.dexidp.io
helm install -f /tmp/dex-overrides.yaml dex dexidp/dex
kubectl describe deployment dex
kubectl rollout status deploy dex -w
- name: install-dex-auth
run: |
helm install -f /tmp/dex-k8s-auth-overrides.yaml dex-k8s-authenticator ./charts/dex-k8s-authenticator
kubectl describe deployment dex-k8s-authenticator
kubectl rollout status deploy dex-k8s-authenticator -w
- name: test
run: |
kubectl get pods
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@
bin
./idea
*.iml
dex-k8s-authenticator
!charts/dex-k8s-authenticator
.idea
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.16.4-alpine3.13
FROM golang:1.20-alpine

RUN apk add --no-cache --update alpine-sdk bash

Expand All @@ -15,7 +15,7 @@ COPY . .

RUN make build

FROM alpine:3.13.5
FROM alpine:3.18

# Dex connectors, such as GitHub and Google logins require root certificates.
# Proper installations should manage those certificates, but it's a bad user
Expand Down
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Dex K8s Authenticator

[![golang-lint](https://github.com/mintel/dex-k8s-authenticator/workflows/golangci-lint/badge.svg)](https://github.com/mintel/dex-k8s-authenticator/actions/workflows/golangci-lint.yml)
[![k8s-lint](https://github.com/mintel/dex-k8s-authenticator/workflows/k8s-lint/badge.svg)](https://github.com/mintel/dex-k8s-authenticator/actions/workflows/k8s.yml)
[![golang-lint](https://github.com/sl1pm4t/dex-k8s-authenticator/workflows/golangci-lint/badge.svg)](https://github.com/sl1pm4t/dex-k8s-authenticator/actions/workflows/golangci-lint.yml)
[![k8s-lint](https://github.com/sl1pm4t/dex-k8s-authenticator/workflows/k8s-lint/badge.svg)](https://github.com/sl1pm4t/dex-k8s-authenticator/actions/workflows/k8s.yml)

A helper web-app which talks to one or more [Dex Identity services](https://github.com/dexidp/dex) to generate
`kubectl` commands for creating and modifying a `kubeconfig`.
Expand Down Expand Up @@ -42,3 +42,7 @@ Feel free to raise feature-requests and bugs. PR's are also very welcome.

This application is based on the original [example-app](https://github.com/coreos/dex/tree/master/cmd/example-app
) available in the CoreOS Dex repo.

## Original Credit

Credit to [mintel](https://github.com/mintel) for starting this project and open sourcing.
4 changes: 2 additions & 2 deletions charts/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Helm charts for installing 'dex' with 'dex-k8s-authenticator'

The charts in this folder install [`dex`](https://github.com/coreos/dex)
with [`dex-k8s-authenticator`](https://github.com/mintel/dex-k8s-authenticator)
with [`dex-k8s-authenticator`](https://github.com/sl1pm4t/dex-k8s-authenticator)

`dex-k8s-authenticator` is a helper application for `dex`. `dex` lets you use external
Identify Providers (like Google, Microsoft, GitHub, LDAP) to authenticate access to Kubernetes cluster
Expand All @@ -12,7 +12,7 @@ Each install of `dex` and/or `dex-k8s-authenticator` can support multiple Kubern
So you can install one of each for all your clusters, one in each cluster, or any combination.

```
git clone https://github.com/mintel/dex-k8s-authenticator.git
git clone https://github.com/sl1pm4t/dex-k8s-authenticator.git
helm inspect values charts/dex > dex.yaml
helm inspect values charts/dex-k8s-authenticator > dex-k8s-authenticator.yaml
```
Expand Down
12 changes: 6 additions & 6 deletions charts/dex-k8s-authenticator/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
apiVersion: v1
appVersion: "v1.4.0"
apiVersion: v2
appVersion: "v2.0.0"
description: "Authenticator for using Dex with Kubernetes"
name: dex-k8s-authenticator
version: 1.4.0
version: 2.0.0
sources:
- https://github.com/mintel/dex-k8s-authenticator
- https://github.com/sl1pm4t/dex-k8s-authenticator
maintainers:
- name: Nick Badger
email: [email protected]
- name: Matt Morrison
email: [email protected]
4 changes: 2 additions & 2 deletions charts/dex-k8s-authenticator/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Helm chart for dex-k8s-authenticator

This chart installs [`dex-k8s-authenticator`](https://github.com/mintel/dex-k8s-authenticator) in a Kubernetes cluster.
This chart installs [`dex-k8s-authenticator`](https://github.com/sl1pm4t/dex-k8s-authenticator) in a Kubernetes cluster.
`dex-k8s-authenticator` is a helper application for [`dex`](https://github.com/coreos/dex). `dex` lets you use external
Identify Providers (like Google, Microsoft, GitHUb, LDAP) to authenticate access to Kubernetes cluster
(e.g. for `kubectl`). This helper makes it easy to provide a web UI for one or more clusters.
Expand All @@ -18,7 +18,7 @@ global:
replicaCount: 1

image:
repository: mintel/dex-k8s-authenticator
repository: ghcr.io/sl1pm4t/dex-k8s-authenticator
tag: latest
pullPolicy: Always

Expand Down
16 changes: 16 additions & 0 deletions charts/dex-k8s-authenticator/templates/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,13 @@
{{- $fullName := include "dex-k8s-authenticator.fullname" . -}}
{{- $servicePort := .Values.service.port -}}
{{- $ingressPath := .Values.ingress.path -}}
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}}
apiVersion: networking.k8s.io/v1
{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}}
apiVersion: networking.k8s.io/v1beta1
{{- else -}}
apiVersion: extensions/v1beta1
{{- end }}
kind: Ingress
metadata:
name: {{ $fullName }}
Expand Down Expand Up @@ -33,8 +39,18 @@ spec:
http:
paths:
- path: {{ $ingressPath }}
{{- if semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion }}
pathType: ImplementationSpecific
{{- end }}
backend:
{{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }}
service:
name: {{ $fullName }}
port:
number: {{ $servicePort }}
{{- else }}
serviceName: {{ $fullName }}
servicePort: {{ $servicePort }}
{{- end }}
{{- end }}
{{- end }}
4 changes: 2 additions & 2 deletions charts/dex-k8s-authenticator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ global:
replicaCount: 1

image:
repository: mintel/dex-k8s-authenticator
tag: 1.4.0
repository: sl1pm4t/dex-k8s-authenticator
tag: 2.0.0
pullPolicy: Always

imagePullSecrets: {}
Expand Down
21 changes: 0 additions & 21 deletions charts/dex/.helmignore

This file was deleted.

12 changes: 0 additions & 12 deletions charts/dex/Chart.yaml

This file was deleted.

Loading

0 comments on commit 0cd22df

Please sign in to comment.