mirror of
https://github.com/ysoftdevs/imagepullsecret-injector.git
synced 2026-01-16 16:47:04 +01:00
Compare commits
5 Commits
imagepulls
...
feature/no
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f7dc6589f5 | ||
|
|
233491dec9 | ||
|
|
56595e3e72 | ||
|
|
6c5bd77b69 | ||
|
|
c999960415 |
5
.github/workflows/release-chart.yaml
vendored
5
.github/workflows/release-chart.yaml
vendored
@@ -4,6 +4,7 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
|
- release/legacy-csr
|
||||||
paths:
|
paths:
|
||||||
- 'charts/**'
|
- 'charts/**'
|
||||||
|
|
||||||
@@ -13,8 +14,6 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v1
|
uses: actions/checkout@v1
|
||||||
with:
|
|
||||||
ref: main
|
|
||||||
|
|
||||||
- name: Configure Git
|
- name: Configure Git
|
||||||
run: |
|
run: |
|
||||||
@@ -47,6 +46,6 @@ jobs:
|
|||||||
|
|
||||||
- name: Run chart-releaser
|
- name: Run chart-releaser
|
||||||
if: steps.helm_version_checker.outcome == 'success'
|
if: steps.helm_version_checker.outcome == 'success'
|
||||||
uses: helm/chart-releaser-action@master
|
uses: helm/chart-releaser-action@v1.2.1
|
||||||
env:
|
env:
|
||||||
CR_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
|
CR_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
|
||||||
@@ -7,4 +7,7 @@ RUN make build
|
|||||||
FROM alpine:3.13.4 as base
|
FROM alpine:3.13.4 as base
|
||||||
COPY --from=builder /go/src/github.com/ysoftdevs/imagepullsecret-injector/build/_output/bin/imagepullsecret-injector /usr/local/bin/imagepullsecret-injector
|
COPY --from=builder /go/src/github.com/ysoftdevs/imagepullsecret-injector/build/_output/bin/imagepullsecret-injector /usr/local/bin/imagepullsecret-injector
|
||||||
|
|
||||||
ENTRYPOINT ["imagepullsecret-injector"]
|
RUN addgroup -S imagepullsecret-injector-group && adduser -S imagepullsecret-injector-user -G imagepullsecret-injector-group
|
||||||
|
USER imagepullsecret-injector-user
|
||||||
|
|
||||||
|
ENTRYPOINT ["imagepullsecret-injector"]
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
FROM alpine:3.13.4
|
FROM alpine:3.13.4
|
||||||
|
|
||||||
RUN apk add bash curl openssl \
|
RUN addgroup -S imagepullsecret-injector-group && adduser -S imagepullsecret-injector-user -G imagepullsecret-injector-group \
|
||||||
|
&& apk add bash curl openssl jq \
|
||||||
&& curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" \
|
&& curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" \
|
||||||
&& chmod 755 ./kubectl \
|
&& chmod 755 ./kubectl \
|
||||||
&& mv ./kubectl /usr/bin/kubectl
|
&& mv ./kubectl /usr/bin/kubectl
|
||||||
|
|
||||||
|
USER imagepullsecret-injector-user
|
||||||
|
|||||||
@@ -15,9 +15,9 @@ type: application
|
|||||||
# This is the chart version. This version number should be incremented each time you make changes
|
# This is the chart version. This version number should be incremented each time you make changes
|
||||||
# to the chart and its templates, including the app version.
|
# to the chart and its templates, including the app version.
|
||||||
# Versions are expected to follow Semantic Versioning (https://semver.org/)
|
# Versions are expected to follow Semantic Versioning (https://semver.org/)
|
||||||
version: 0.0.20
|
version: 0.0.21
|
||||||
|
|
||||||
# This is the version number of the application being deployed. This version number should be
|
# This is the version number of the application being deployed. This version number should be
|
||||||
# incremented each time you make changes to the application. Versions are not expected to
|
# incremented each time you make changes to the application. Versions are not expected to
|
||||||
# follow Semantic Versioning. They should reflect the version the application is using.
|
# follow Semantic Versioning. They should reflect the version the application is using.
|
||||||
appVersion: 0.0.11
|
appVersion: 0.0.12
|
||||||
|
|||||||
@@ -83,23 +83,27 @@ echo "Deleting old CertificateSigningRequests"
|
|||||||
kubectl delete csr ${csrName} 2>/dev/null || true
|
kubectl delete csr ${csrName} 2>/dev/null || true
|
||||||
|
|
||||||
echo "Creating new CertificateSigningRequests"
|
echo "Creating new CertificateSigningRequests"
|
||||||
# create server cert/key CSR and send to k8s API
|
# create server cert/key CSR and send to k8s API
|
||||||
cat <<EOF | kubectl create -f -
|
jq -n --arg request "$(< "${tmpdir}"/server.csr base64)" \
|
||||||
apiVersion: certificates.k8s.io/v1
|
--arg namespace "$namespace" \
|
||||||
kind: CertificateSigningRequest
|
--arg csrName "$csrName" '{
|
||||||
metadata:
|
apiVersion: "certificates.k8s.io/v1",
|
||||||
name: ${csrName}
|
kind: "CertificateSigningRequest",
|
||||||
namespace: ${namespace}
|
metadata: {
|
||||||
spec:
|
name: $csrName,
|
||||||
signerName: kubernetes.io/kubelet-serving
|
namespace: $namespace
|
||||||
groups:
|
},
|
||||||
- system:authenticated
|
spec: {
|
||||||
request: $(< "${tmpdir}"/server.csr base64 | tr -d '\n')
|
signerName: "kubernetes.io/kubelet-serving",
|
||||||
usages:
|
groups: ["system:authenticated"],
|
||||||
- digital signature
|
request: $request,
|
||||||
- key encipherment
|
usages: [
|
||||||
- server auth
|
"digital signature",
|
||||||
EOF
|
"key encipherment",
|
||||||
|
"server auth"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}' | kubectl create -f -
|
||||||
|
|
||||||
# verify CSR has been created
|
# verify CSR has been created
|
||||||
while true; do
|
while true; do
|
||||||
|
|||||||
Reference in New Issue
Block a user