-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Adding Harbor-client * add harbor-client helm chart and workflows * Modify helm chart for harbor client * Changes on Dockerfile and secret name * Deleting DS_Store files * Changing image.repository in values.yaml * review changes * changes on env file. --------- Co-authored-by: Mahsa <mahsa.soleimani@snapp.cab>
- Loading branch information
1 parent
9005990
commit 742f475
Showing
14 changed files
with
703 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: Release Helm Chart | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'harbor-release-v*' | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v2 | ||
- name: Package Helm Charts | ||
run: | | ||
helm package clients/harbor-client/deploy -d clients/helm-charts | ||
- name: Determine Chart to Publish | ||
id: determine_chart | ||
run: | | ||
CHART_TO_PUBLISH=$(find clients/helm-charts -type f -name '*.tgz' | head -n 1) | ||
echo "Chart to publish: $CHART_TO_PUBLISH" | ||
echo "::set-output name=chart_to_publish::$CHART_TO_PUBLISH" | ||
- name: Publish GitHub Release | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
files: ${{ steps.determine_chart.outputs.chart_to_publish }} | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: Build Container Image | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
docker: | ||
name: docker | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: docker/setup-qemu-action@v2 | ||
with: | ||
platforms: amd64 | ||
- uses: docker/setup-buildx-action@v2 | ||
- uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build and Push Docker Image | ||
run: | | ||
for dir in clients/*/; do | ||
docker buildx build \ | ||
--file $dir/Dockerfile \ | ||
--tag ghcr.io/${{ github.repository }}/$dir:latest \ | ||
$dir | ||
docker push ghcr.io/${{ github.repository }}/$dir:latest | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
FROM golang:alpine AS builder | ||
|
||
WORKDIR /go/src/app | ||
|
||
COPY . . | ||
|
||
RUN go build -o app | ||
|
||
FROM alpine:latest | ||
|
||
WORKDIR /app | ||
|
||
COPY --from=builder /go/src/app/app . | ||
|
||
ENV IMAGE_REFERENCE="The image reference URL starts with //." | ||
|
||
EXPOSE 8080 | ||
|
||
CMD ["./app"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
apiVersion: v2 | ||
name: snappcloud-harbor-client | ||
description: A Helm chart for Kubernetes | ||
|
||
type: application | ||
version: 0.1.0 | ||
appVersion: "0.0.1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: {{ include "snappcloud-harbor-client.fullname" . }} | ||
labels: | ||
{{- include "snappcloud-harbor-client.labels" . | nindent 4 }} | ||
spec: | ||
replicas: {{ .Values.replicaCount }} | ||
selector: | ||
matchLabels: | ||
{{- include "snappcloud-harbor-client.selectorLabels" . | nindent 6 }} | ||
template: | ||
metadata: | ||
labels: | ||
{{- include "snappcloud-harbor-client.selectorLabels" . | nindent 8 }} | ||
annotations: | ||
{{- .Values.podAnnotations | toYaml | nindent 8 }} | ||
spec: | ||
serviceAccountName: {{ include "snappcloud-harbor-client.serviceAccountName" . }} | ||
securityContext: | ||
{{- toYaml .Values.podSecurityContext | nindent 8 }} | ||
containers: | ||
- name: {{ .Chart.Name }} | ||
securityContext: | ||
{{- toYaml .Values.securityContext | nindent 12 }} | ||
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" | ||
imagePullPolicy: {{ .Values.image.pullPolicy }} | ||
ports: | ||
- name: http | ||
containerPort: 80 | ||
protocol: TCP | ||
env: | ||
- name: IMAGE_REFERENCE | ||
valueFrom: | ||
secretKeyRef: | ||
name: {{ .Values.configSecretName }} | ||
key: IMAGE_REFERENCE | ||
{{ .Values.nodeSelector | toYaml | nindent 8 }} | ||
tolerations: | ||
{{- with .Values.tolerations }} | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
affinity: | ||
{{- with .Values.affinity }} | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: {{ .Values.configSecretName }} | ||
labels: | ||
{{- include "snappcloud-harbor-client.labels" . | nindent 4 }} | ||
type: Opaque | ||
stringData: | ||
IMAGE_REFERENCE: "The image reference URL starts with //." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: {{ include "snappcloud-harbor-client.fullname" . }} | ||
labels: | ||
{{- include "snappcloud-harbor-client.labels" . | nindent 4 }} | ||
spec: | ||
type: {{ .Values.service.type }} | ||
ports: | ||
- port: {{ .Values.service.port }} | ||
targetPort: http | ||
protocol: TCP | ||
selector: | ||
{{- include "snappcloud-harbor-client.selectorLabels" . | nindent 4 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
replicaCount: 1 | ||
|
||
image: | ||
repository: ghcr.io/snapp-incubator/snappcloud-status-backend | ||
pullPolicy: Always | ||
tag: "0.0.1" | ||
|
||
imagePullSecrets: [] | ||
nameOverride: "" | ||
fullnameOverride: "" | ||
|
||
serviceAccount: | ||
create: false | ||
automount: true | ||
annotations: {} | ||
name: "" | ||
|
||
service: | ||
type: ClusterIP | ||
port: 8080 | ||
|
||
resources: | ||
limits: | ||
cpu: 100m | ||
memory: 128Mi | ||
requests: | ||
cpu: 100m | ||
memory: 128Mi | ||
|
||
autoscaling: | ||
enabled: false | ||
minReplicas: 1 | ||
maxReplicas: 100 | ||
targetCPUUtilizationPercentage: 80 | ||
# targetMemoryUtilizationPercentage: 80 | ||
|
||
configSecretName: spcld-harbor-health-client |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
module github.com/snapp-incubator/snappcloud-status-backend/clients/harbor-client | ||
|
||
go 1.21.0 | ||
|
||
require ( | ||
github.com/containers/image v3.0.2+incompatible | ||
github.com/prometheus/client_golang v1.17.0 | ||
) | ||
|
||
require ( | ||
github.com/BurntSushi/toml v1.3.2 // indirect | ||
github.com/Microsoft/go-winio v0.6.1 // indirect | ||
github.com/beorn7/perks v1.0.1 // indirect | ||
github.com/cespare/xxhash/v2 v2.2.0 // indirect | ||
github.com/containers/storage v1.51.0 // indirect | ||
github.com/distribution/reference v0.5.0 // indirect | ||
github.com/docker/distribution v2.8.3+incompatible // indirect | ||
github.com/docker/docker v24.0.7+incompatible // indirect | ||
github.com/docker/docker-credential-helpers v0.8.0 // indirect | ||
github.com/docker/go-connections v0.4.0 // indirect | ||
github.com/docker/go-metrics v0.0.1 // indirect | ||
github.com/docker/libtrust v0.0.0-20160708172513-aabc10ec26b7 // indirect | ||
github.com/ghodss/yaml v1.0.0 // indirect | ||
github.com/golang/protobuf v1.5.3 // indirect | ||
github.com/gorilla/mux v1.8.1 // indirect | ||
github.com/kr/text v0.2.0 // indirect | ||
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect | ||
github.com/opencontainers/go-digest v1.0.0 // indirect | ||
github.com/opencontainers/image-spec v1.0.2 // indirect | ||
github.com/pkg/errors v0.9.1 // indirect | ||
github.com/prometheus/client_model v0.4.1-0.20230718164431-9a2bf3000d16 // indirect | ||
github.com/prometheus/common v0.44.0 // indirect | ||
github.com/prometheus/procfs v0.11.1 // indirect | ||
github.com/sirupsen/logrus v1.9.3 // indirect | ||
github.com/stretchr/testify v1.8.4 // indirect | ||
golang.org/x/mod v0.11.0 // indirect | ||
golang.org/x/net v0.10.0 // indirect | ||
golang.org/x/sync v0.4.0 // indirect | ||
golang.org/x/sys v0.14.0 // indirect | ||
golang.org/x/tools v0.8.0 // indirect | ||
google.golang.org/protobuf v1.31.0 // indirect | ||
gopkg.in/yaml.v2 v2.4.0 // indirect | ||
) |
Oops, something went wrong.