mirror of
https://github.com/eliasstepanik/caddy-ingess.git
synced 2026-01-10 20:18:28 +00:00
Add goreleaser and bump chart to v1.0.1 (#92)
This commit is contained in:
parent
16312f5480
commit
dc93125700
78
.github/workflows/main.yml
vendored
78
.github/workflows/main.yml
vendored
@ -1,60 +1,27 @@
|
|||||||
name: Lint and Test Charts
|
name: Checks
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [master]
|
branches: [master]
|
||||||
tags:
|
|
||||||
- 'v*'
|
|
||||||
pull_request:
|
pull_request:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
docker-build:
|
go-tests:
|
||||||
|
name: Run tests
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
name: Building Docker Image
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- uses: actions/checkout@v2
|
||||||
uses: actions/checkout@v2
|
|
||||||
|
|
||||||
- name: Docker meta
|
- name: Set up Go
|
||||||
id: docker_meta
|
uses: actions/setup-go@v2
|
||||||
uses: docker/metadata-action@v3
|
|
||||||
with:
|
with:
|
||||||
images: caddy/ingress
|
go-version: 1.16
|
||||||
tags: |
|
|
||||||
type=semver,pattern={{raw}}
|
|
||||||
type=ref,event=branch
|
|
||||||
type=ref,event=pr
|
|
||||||
type=sha
|
|
||||||
|
|
||||||
- name: Set up QEMU
|
- name: Test
|
||||||
uses: docker/setup-qemu-action@v1
|
run: go test -v ./...
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
chart-test-current:
|
||||||
uses: docker/setup-buildx-action@v1
|
|
||||||
|
|
||||||
- name: Login to DockerHub
|
|
||||||
# Forks don't have push access to docker
|
|
||||||
if: github.repository == 'caddyserver/ingress'
|
|
||||||
uses: docker/login-action@v1
|
|
||||||
with:
|
|
||||||
username: ${{ secrets.DOCKER_USERNAME }}
|
|
||||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
|
||||||
|
|
||||||
- name: Build and push
|
|
||||||
id: docker_build
|
|
||||||
uses: docker/build-push-action@v2
|
|
||||||
with:
|
|
||||||
push: ${{ github.repository == 'caddyserver/ingress' }}
|
|
||||||
tags: ${{ steps.docker_meta.outputs.tags }}
|
|
||||||
labels: ${{ steps.docker_meta.outputs.labels }}
|
|
||||||
platforms: linux/amd64,linux/arm64
|
|
||||||
cache-from: type=gha
|
|
||||||
cache-to: type=gha,mode=max
|
|
||||||
|
|
||||||
lint-test:
|
|
||||||
name: Test and lint charts
|
name: Test and lint charts
|
||||||
needs:
|
|
||||||
- docker-build
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
@ -67,6 +34,11 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
version: v3.8.1
|
version: v3.8.1
|
||||||
|
|
||||||
|
- name: Set up QEMU
|
||||||
|
uses: docker/setup-qemu-action@v1
|
||||||
|
with:
|
||||||
|
platforms: arm64
|
||||||
|
|
||||||
- uses: actions/setup-python@v2
|
- uses: actions/setup-python@v2
|
||||||
with:
|
with:
|
||||||
python-version: 3.7
|
python-version: 3.7
|
||||||
@ -77,6 +49,13 @@ jobs:
|
|||||||
- name: Run chart-testing (lint)
|
- name: Run chart-testing (lint)
|
||||||
run: ct lint --config ct.yaml
|
run: ct lint --config ct.yaml
|
||||||
|
|
||||||
|
- name: Run GoReleaser
|
||||||
|
uses: goreleaser/goreleaser-action@v2
|
||||||
|
with:
|
||||||
|
distribution: goreleaser
|
||||||
|
version: latest
|
||||||
|
args: release --snapshot --rm-dist
|
||||||
|
|
||||||
- name: Create kind cluster
|
- name: Create kind cluster
|
||||||
uses: helm/kind-action@v1.2.0
|
uses: helm/kind-action@v1.2.0
|
||||||
|
|
||||||
@ -99,17 +78,8 @@ jobs:
|
|||||||
- 172.17.255.1-172.17.255.200
|
- 172.17.255.1-172.17.255.200
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
- name: Get image tag
|
- name: Load image into Kind cluster
|
||||||
id: image-tag
|
run: kind load docker-image "caddy/ingress:test-image" --name chart-testing
|
||||||
run: echo "::set-output name=data::$(echo ${GITHUB_SHA} | cut -c1-7)"
|
|
||||||
|
|
||||||
- name: Set current image tag
|
|
||||||
working-directory: charts/caddy-ingress-controller
|
|
||||||
# Forks don't have push access to docker so don't use it in tests
|
|
||||||
if: github.repository == 'caddyserver/ingress'
|
|
||||||
run: envsubst < ci/test-values.yaml.tpl > ci/test-values.yaml
|
|
||||||
env:
|
|
||||||
TAG: ${{ steps.image-tag.outputs.data }}
|
|
||||||
|
|
||||||
- name: Run chart-testing (install)
|
- name: Run chart-testing (install)
|
||||||
run: ct install --config ct.yaml
|
run: ct install --config ct.yaml
|
||||||
|
|||||||
@ -5,7 +5,7 @@ on:
|
|||||||
branches: [master]
|
branches: [master]
|
||||||
paths:
|
paths:
|
||||||
- 'charts/**'
|
- 'charts/**'
|
||||||
- '.github/workflows/helmchart-release.yml'
|
- '.github/workflows/release-controller.yml'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
release:
|
release:
|
||||||
36
.github/workflows/release-controller.yml
vendored
Normal file
36
.github/workflows/release-controller.yml
vendored
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
name: Release Controller
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- 'v*'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
goreleaser:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
name: GoReleaser release
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Set up Go
|
||||||
|
uses: actions/setup-go@v2
|
||||||
|
with:
|
||||||
|
go-version: 1.16
|
||||||
|
|
||||||
|
- name: Login to DockerHub
|
||||||
|
uses: docker/login-action@v1
|
||||||
|
with:
|
||||||
|
username: ${{ secrets.DOCKER_USERNAME }}
|
||||||
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||||
|
|
||||||
|
- name: Run GoReleaser
|
||||||
|
uses: goreleaser/goreleaser-action@v2
|
||||||
|
with:
|
||||||
|
distribution: goreleaser
|
||||||
|
version: latest
|
||||||
|
args: release --rm-dist
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
24
.github/workflows/tests.yml
vendored
24
.github/workflows/tests.yml
vendored
@ -1,24 +0,0 @@
|
|||||||
name: Go
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: [ master ]
|
|
||||||
pull_request:
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build-and-test:
|
|
||||||
name: Build and Test
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
|
|
||||||
- name: Set up Go
|
|
||||||
uses: actions/setup-go@v2
|
|
||||||
with:
|
|
||||||
go-version: 1.16
|
|
||||||
|
|
||||||
- name: Build
|
|
||||||
run: go build -v ./...
|
|
||||||
|
|
||||||
- name: Test
|
|
||||||
run: go test -v ./...
|
|
||||||
3
.gitignore
vendored
3
.gitignore
vendored
@ -1,4 +1,5 @@
|
|||||||
.DS_Store
|
.DS_Store
|
||||||
bin
|
bin
|
||||||
vendor
|
vendor
|
||||||
.idea/
|
.idea/
|
||||||
|
dist/
|
||||||
|
|||||||
45
.goreleaser.yaml
Normal file
45
.goreleaser.yaml
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
before:
|
||||||
|
hooks:
|
||||||
|
- go mod tidy
|
||||||
|
builds:
|
||||||
|
- main: ./cmd/caddy
|
||||||
|
binary: ingress-controller
|
||||||
|
env:
|
||||||
|
- CGO_ENABLED=0
|
||||||
|
goos:
|
||||||
|
- linux
|
||||||
|
goarch:
|
||||||
|
- amd64
|
||||||
|
- arm64
|
||||||
|
|
||||||
|
dockers:
|
||||||
|
- image_templates:
|
||||||
|
- "caddy/ingress:test-image"
|
||||||
|
use: buildx
|
||||||
|
dockerfile: Dockerfile
|
||||||
|
skip_push: "true"
|
||||||
|
build_flag_templates:
|
||||||
|
- "--platform=linux/amd64"
|
||||||
|
|
||||||
|
- image_templates:
|
||||||
|
- "caddy/ingress:{{ .Tag }}-amd64"
|
||||||
|
use: buildx
|
||||||
|
dockerfile: Dockerfile
|
||||||
|
build_flag_templates:
|
||||||
|
- "--platform=linux/amd64"
|
||||||
|
|
||||||
|
- image_templates:
|
||||||
|
- "caddy/ingress:{{ .Tag }}-arm64v8"
|
||||||
|
use: buildx
|
||||||
|
dockerfile: Dockerfile
|
||||||
|
build_flag_templates:
|
||||||
|
- "--platform=linux/arm64/v8"
|
||||||
|
|
||||||
|
docker_manifests:
|
||||||
|
- name_template: "caddy/ingress:{{ .Tag }}"
|
||||||
|
image_templates:
|
||||||
|
- "caddy/ingress:{{ .Tag }}-amd64"
|
||||||
|
- "caddy/ingress:{{ .Tag }}-arm64v8"
|
||||||
|
|
||||||
|
release:
|
||||||
|
disable: true
|
||||||
18
Dockerfile
18
Dockerfile
@ -1,20 +1,10 @@
|
|||||||
FROM golang:1.16.7-alpine AS builder
|
|
||||||
WORKDIR /app
|
|
||||||
|
|
||||||
COPY go.mod go.sum ./
|
|
||||||
RUN go mod download
|
|
||||||
|
|
||||||
COPY ./cmd ./cmd
|
|
||||||
COPY ./pkg ./pkg
|
|
||||||
COPY ./internal ./internal
|
|
||||||
|
|
||||||
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o ./bin/ingress-controller ./cmd/caddy
|
|
||||||
|
|
||||||
FROM alpine:latest AS certs
|
FROM alpine:latest AS certs
|
||||||
RUN apk --update add ca-certificates
|
RUN apk --update add ca-certificates
|
||||||
|
|
||||||
FROM alpine:latest
|
FROM alpine:latest
|
||||||
COPY --from=builder /app/bin/ingress-controller .
|
|
||||||
COPY --from=certs /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
|
|
||||||
EXPOSE 80 443
|
EXPOSE 80 443
|
||||||
ENTRYPOINT ["/ingress-controller"]
|
ENTRYPOINT ["/ingress-controller"]
|
||||||
|
|
||||||
|
COPY --from=certs /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
|
||||||
|
COPY ingress-controller /
|
||||||
|
|||||||
@ -4,8 +4,8 @@ home: https://github.com/caddyserver/ingress
|
|||||||
description: A helm chart for the Caddy Kubernetes ingress controller
|
description: A helm chart for the Caddy Kubernetes ingress controller
|
||||||
icon: https://caddyserver.com/resources/images/caddy-circle-lock.svg
|
icon: https://caddyserver.com/resources/images/caddy-circle-lock.svg
|
||||||
type: application
|
type: application
|
||||||
version: 1.0.0
|
version: 1.0.1
|
||||||
appVersion: "0.1.0"
|
appVersion: "0.1.1"
|
||||||
keywords:
|
keywords:
|
||||||
- ingress-controller
|
- ingress-controller
|
||||||
- caddyserver
|
- caddyserver
|
||||||
|
|||||||
2
charts/caddy-ingress-controller/ci/test-values.yaml
Normal file
2
charts/caddy-ingress-controller/ci/test-values.yaml
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
image:
|
||||||
|
tag: test-image
|
||||||
@ -1,2 +0,0 @@
|
|||||||
image:
|
|
||||||
tag: sha-${TAG}
|
|
||||||
@ -126,6 +126,10 @@
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
"experimentalSmartSort": {
|
||||||
|
"$id": "#/properties/ingressController/properties/config/properties/experimentalSmartSort",
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
"metrics": {
|
"metrics": {
|
||||||
"$id": "#/properties/ingressController/properties/config/properties/metrics",
|
"$id": "#/properties/ingressController/properties/config/properties/metrics",
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
|
|||||||
@ -9,7 +9,7 @@ minikube: false
|
|||||||
image:
|
image:
|
||||||
repository: caddy/ingress
|
repository: caddy/ingress
|
||||||
pullPolicy: IfNotPresent
|
pullPolicy: IfNotPresent
|
||||||
tag: "v0.1.0"
|
tag: "v0.1.1"
|
||||||
|
|
||||||
imagePullSecrets: []
|
imagePullSecrets: []
|
||||||
nameOverride: ""
|
nameOverride: ""
|
||||||
@ -30,6 +30,7 @@ ingressController:
|
|||||||
email: ""
|
email: ""
|
||||||
metrics: true
|
metrics: true
|
||||||
proxyProtocol: false
|
proxyProtocol: false
|
||||||
|
experimentalSmartSort: false
|
||||||
onDemandTLS: false
|
onDemandTLS: false
|
||||||
# onDemandRateLimitInterval:
|
# onDemandRateLimitInterval:
|
||||||
# onDemandRateLimitBurst:
|
# onDemandRateLimitBurst:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user