diff --git a/deploy/README.md b/deploy/README.md deleted file mode 100644 index d5165d89..00000000 --- a/deploy/README.md +++ /dev/null @@ -1,8 +0,0 @@ -### NOTE for modifying `registration-service.yaml` - -After modifying this file remember to: - -1) run `make copy-reg-service-template` (which will copy this file locally into ../host-operator/deploy/registration-service/registration-service.yaml) -2) open a PR in [host-operator](https://github.com/codeready-toolchain/host-operator) with that change. This PR needs to be merged before merging the changes in registration-service. - -This is required since the actual template used for deploying the registration service is the one present at https://github.com/codeready-toolchain/host-operator/blob/master/deploy/registration-service/registration-service.yaml \ No newline at end of file diff --git a/deploy/registration-service.yaml b/deploy/registration-service.yaml deleted file mode 100644 index 7a9617d6..00000000 --- a/deploy/registration-service.yaml +++ /dev/null @@ -1,274 +0,0 @@ -apiVersion: template.openshift.io/v1 -kind: Template -metadata: - name: registration-service -objects: - - apiVersion: v1 - kind: ServiceAccount - metadata: - labels: - provider: codeready-toolchain - name: registration-service - namespace: ${NAMESPACE} - - kind: Role - apiVersion: rbac.authorization.k8s.io/v1 - metadata: - labels: - provider: codeready-toolchain - name: registration-service - namespace: ${NAMESPACE} - rules: - - apiGroups: - - toolchain.dev.openshift.com - resources: - - usersignups - verbs: - - create - - get - - update - - list - - watch - - apiGroups: - - toolchain.dev.openshift.com - resources: - - masteruserrecords - - socialevents - - spacebindings - - spaces - - toolchainconfigs - - toolchainstatuses - - proxyplugins - - nstemplatetiers - verbs: - - get - - list - - watch - - apiGroups: - - toolchain.dev.openshift.com - resources: - - bannedusers - - toolchainclusters - verbs: - - get - - list - - apiGroups: - - "" - resources: - - secrets - - configmaps - verbs: - - get - - list - - kind: RoleBinding - apiVersion: rbac.authorization.k8s.io/v1 - metadata: - labels: - provider: codeready-toolchain - name: registration-service - namespace: ${NAMESPACE} - subjects: - - kind: ServiceAccount - name: registration-service - roleRef: - kind: Role - name: registration-service - apiGroup: rbac.authorization.k8s.io - - kind: Deployment - apiVersion: apps/v1 - metadata: - labels: - provider: codeready-toolchain - name: registration-service - namespace: ${NAMESPACE} - spec: - replicas: ${{REPLICAS}} - selector: - matchLabels: - name: registration-service - template: - metadata: - labels: - name: registration-service - run: registration-service - spec: - serviceAccountName: registration-service - containers: - - name: registration-service - image: ${IMAGE} - ports: - - containerPort: 8080 # registration service - - containerPort: 8081 # proxy - - containerPort: 8082 # proxy metrics - name: metrics - - containerPort: 8083 # registration service metrics - name: regsvc-metrics - command: - - registration-service - imagePullPolicy: IfNotPresent - livenessProbe: - failureThreshold: 3 - httpGet: - path: /api/v1/health - port: 8080 - scheme: HTTP - initialDelaySeconds: 1 - periodSeconds: 10 - successThreshold: 1 - timeoutSeconds: 1 - readinessProbe: - failureThreshold: 1 - httpGet: - path: /api/v1/health - port: 8080 - scheme: HTTP - initialDelaySeconds: 1 - periodSeconds: 1 - successThreshold: 1 - timeoutSeconds: 1 - startupProbe: - failureThreshold: 180 - httpGet: - path: /api/v1/health - port: 8080 - scheme: HTTP - initialDelaySeconds: 1 - periodSeconds: 1 - successThreshold: 1 - timeoutSeconds: 1 - env: - - name: WATCH_NAMESPACE - value: ${NAMESPACE} - resources: - requests: - cpu: "50m" - memory: "100M" - - # route for the registration service - - kind: Route - apiVersion: v1 - metadata: - labels: - provider: codeready-toolchain - run: registration-service - name: registration-service - namespace: ${NAMESPACE} - spec: - host: '' - port: - targetPort: "8080" - to: - kind: Service - name: registration-service - weight: 100 - tls: - termination: edge - wildcardPolicy: None - - # service associated with the registration service route - - kind: Service - apiVersion: v1 - metadata: - name: registration-service - namespace: ${NAMESPACE} - labels: - provider: codeready-toolchain - run: registration-service - spec: - ports: - - name: "8080" - protocol: TCP - port: 80 - targetPort: 8080 - selector: - run: registration-service - type: ClusterIP - sessionAffinity: null - - # internal service for the registration service, used by Prometheus to scrape the metrics - - kind: Service - apiVersion: v1 - metadata: - name: registration-service-metrics - namespace: ${NAMESPACE} - labels: - provider: codeready-toolchain - run: registration-service - spec: - ports: - - name: regsvc-metrics - protocol: TCP - port: 80 - targetPort: regsvc-metrics - selector: - run: registration-service - type: ClusterIP - sessionAffinity: null - - # route for the proxy - - kind: Route - apiVersion: v1 - metadata: - labels: - provider: codeready-toolchain - run: registration-service - annotations: - haproxy.router.openshift.io/timeout: 24h - name: api - namespace: ${NAMESPACE} - spec: - port: - targetPort: "8081" - to: - kind: Service - name: api - weight: 100 - tls: - termination: edge - wildcardPolicy: None - - # service associated with the proxy route - - kind: Service - apiVersion: v1 - metadata: - name: api - namespace: ${NAMESPACE} - labels: - provider: codeready-toolchain - run: registration-service - spec: - ports: - - name: "8081" - protocol: TCP - port: 80 - targetPort: 8081 - selector: - run: registration-service - type: ClusterIP - sessionAffinity: null - - # internal service for the proxy, used by Prometheus to scrape the metrics - - kind: Service - apiVersion: v1 - metadata: - name: proxy-metrics-service - namespace: ${NAMESPACE} - labels: - provider: codeready-toolchain - run: proxy-metrics - spec: - ports: - - name: proxy-metrics - protocol: TCP - port: 80 - targetPort: metrics - selector: - run: registration-service - type: ClusterIP - sessionAffinity: null -parameters: - - name: NAMESPACE - value: 'toolchain-host-operator' - - name: IMAGE - value: quay.io/openshiftio/codeready-toolchain/registration-service:latest - - name: REPLICAS - value: '3' diff --git a/make/generate.mk b/make/generate.mk deleted file mode 100644 index d197ae54..00000000 --- a/make/generate.mk +++ /dev/null @@ -1,3 +0,0 @@ -.PHONY: copy-reg-service-template -copy-reg-service-template: - $(Q)cp ./deploy/registration-service.yaml ../host-operator/deploy/registration-service/registration-service.yaml \ No newline at end of file diff --git a/make/go.mk b/make/go.mk index b7265add..83bb4dda 100644 --- a/make/go.mk +++ b/make/go.mk @@ -23,7 +23,7 @@ build-dev: # builds the production binary with bundled assets ## builds production binary -build-prod: check-template-changes +build-prod: $(Q)CGO_ENABLED=0 GOARCH=${goarch} GOOS=linux \ go build ${V_FLAG} -ldflags="${LDFLAGS} -s -w" -trimpath \ -o $(OUT_DIR)/bin/registration-service \ @@ -33,16 +33,6 @@ build-prod: check-template-changes vendor: $(Q)go mod vendor -.PHONY: check-template-changes -check-template-changes: -ifneq ($(shell git status -s | grep deploy/registration-service.yaml),) - @echo "#########################################################################" - @echo "## WARNING: The file deploy/registration-service.yaml has been changed ##" - @echo "## Don't forget to reflect the change in host-operator repo ##" - @echo "## Run 'make copy-reg-service-template' and send PR ##" - @echo "#########################################################################" -endif - .PHONY: verify-dependencies ## Runs commands to verify after the updated dependecies of toolchain-common/API(go mod replace), if the repo needs any changes to be made verify-dependencies: tidy vet build test lint-go-code