Skip to content

Commit

Permalink
Set all service ports to 80.
Browse files Browse the repository at this point in the history
Allows for conveniently accessing them without having to remember port numbers on remote cluster.

This makes a lot of LB services stay on pending state on local k3s cluster, but this does not seem to have disadvantages, because the services can still be reached via nodePort.
  • Loading branch information
schnatterer committed Jan 12, 2021
1 parent 16d3e7e commit 3b7c315
Show file tree
Hide file tree
Showing 30 changed files with 84 additions and 51 deletions.
5 changes: 4 additions & 1 deletion applications/nginx/argocd/values.yaml
@@ -1 +1,4 @@
service.port: 9022
service:
port: 80
nodePorts:
http: 9022
4 changes: 2 additions & 2 deletions applications/nginx/fluxv1/Jenkinsfile
Expand Up @@ -5,8 +5,8 @@ String getCesBuildLibVersion() { '1.44.3' }
String getCesBuildLibRepo() { 'https://github.com/cloudogu/ces-build-lib/' }
String getScmManagerCredentials() { 'scmm-user' }
String getKubectlImage() { 'lachlanevenson/k8s-kubectl:v1.19.3' }
String getConfigRepositoryUrl() { "http://scmm-scm-manager:9091/scm/repo/fluxv1/gitops" }
String getConfigRepositoryPRUrl() { 'http://scmm-scm-manager:9091/scm/api/v2/pull-requests/fluxv1/gitops' }
String getConfigRepositoryUrl() { "http://scmm-scm-manager/scm/repo/fluxv1/gitops" }
String getConfigRepositoryPRUrl() { 'http://scmm-scm-manager/scm/api/v2/pull-requests/fluxv1/gitops' }
String getHelmChartRepository() { "https://charts.bitnami.com/bitnami" }
String getHelmChartName() { "nginx" }
String getHelmChartVersion() { "8.0.0" }
Expand Down
4 changes: 3 additions & 1 deletion applications/nginx/fluxv1/k8s/values-production.yaml
@@ -1,3 +1,5 @@
namespace: fluxv1-production
service:
port: 9006
port: 80
nodePorts:
http: 9006
4 changes: 3 additions & 1 deletion applications/nginx/fluxv1/k8s/values-staging.yaml
@@ -1,3 +1,5 @@
namespace: fluxv1-staging
service:
port: 9005
port: 80
nodePorts:
http: 9005
4 changes: 2 additions & 2 deletions applications/petclinic/argocd/plain-k8s/Jenkinsfile
Expand Up @@ -3,8 +3,8 @@
// "Constants"
String getApplication() {"spring-petclinic-plain" }
String getScmManagerCredentials() { 'scmm-user' }
String getConfigRepositoryUrl() { "http://scmm-scm-manager:9091/scm/repo/argocd/gitops" }
String getConfigRepositoryPRUrl() { 'http://scmm-scm-manager:9091/scm/api/v2/pull-requests/argocd/gitops' }
String getConfigRepositoryUrl() { "http://scmm-scm-manager/scm/repo/argocd/gitops" }
String getConfigRepositoryPRUrl() { 'http://scmm-scm-manager/scm/api/v2/pull-requests/argocd/gitops' }
// The docker daemon cant use the k8s service name, because it is not running inside the cluster
String getDockerRegistryBaseUrl() { "localhost:30000" }
String getCesBuildLibVersion() { '1.44.3' }
Expand Down
Expand Up @@ -9,7 +9,8 @@ spec:
type: LoadBalancer
ports:
- name: http
port: 9021
port: 80
nodePort: 9021
targetPort: http
selector:
app: spring-petclinic-plain
Expand Up @@ -9,7 +9,8 @@ spec:
type: LoadBalancer
ports:
- name: http
port: 9020
port: 80
nodePort: 9020
targetPort: http
selector:
app: spring-petclinic-plain
6 changes: 3 additions & 3 deletions applications/petclinic/fluxv1/helm/Jenkinsfile
Expand Up @@ -2,14 +2,14 @@

String getApplication() { "spring-petclinic-helm" }
String getScmManagerCredentials() { 'scmm-user' }
String getConfigRepositoryUrl() { 'scmm-scm-manager:9091/scm/repo/fluxv1/gitops' }
String getConfigRepositoryPRUrl() { 'scmm-scm-manager:9091/scm/api/v2/pull-requests/fluxv1/gitops' }
String getConfigRepositoryUrl() { 'scmm-scm-manager/scm/repo/fluxv1/gitops' }
String getConfigRepositoryPRUrl() { 'scmm-scm-manager/scm/api/v2/pull-requests/fluxv1/gitops' }
// The docker daemon cant use the k8s service name, because it is not running inside the cluster
String getDockerRegistryBaseUrl() { "localhost:30000" }
String getCesBuildLibVersion() { '1.44.3' }
String getCesBuildLibRepo() { 'https://github.com/cloudogu/ces-build-lib/' }
String getHelmImage() { 'ghcr.io/cloudogu/helm:3.4.1-1' }
String getHelmChartRepository() { 'scmm-scm-manager.default.svc.cluster.local:9091/scm/repo/common/spring-boot-helm-chart' }
String getHelmChartRepository() { 'scmm-scm-manager.default.svc.cluster.local/scm/repo/common/spring-boot-helm-chart' }
String getHelmChartName() { "springboot" }
String getHelmChartVersion() { "1.0.0" }
String getMainBranch() { 'main' }
Expand Down
@@ -1,2 +1,3 @@
service:
port: 9004
port: 80
nodePort: 9004
3 changes: 2 additions & 1 deletion applications/petclinic/fluxv1/helm/k8s/values-staging.yaml
@@ -1,2 +1,3 @@
service:
port: 9003
port: 80
nodePort: 9003
4 changes: 2 additions & 2 deletions applications/petclinic/fluxv1/plain-k8s/Jenkinsfile
Expand Up @@ -3,8 +3,8 @@
// "Constants"
String getApplication() {"spring-petclinic-plain" }
String getScmManagerCredentials() { 'scmm-user' }
String getConfigRepositoryUrl() { "http://scmm-scm-manager:9091/scm/repo/fluxv1/gitops" }
String getConfigRepositoryPRUrl() { 'http://scmm-scm-manager:9091/scm/api/v2/pull-requests/fluxv1/gitops' }
String getConfigRepositoryUrl() { "http://scmm-scm-manager/scm/repo/fluxv1/gitops" }
String getConfigRepositoryPRUrl() { 'http://scmm-scm-manager/scm/api/v2/pull-requests/fluxv1/gitops' }
// The docker daemon cant use the k8s service name, because it is not running inside the cluster
String getDockerRegistryBaseUrl() { "localhost:30000" }
String getCesBuildLibVersion() { '1.44.3' }
Expand Down
Expand Up @@ -9,7 +9,8 @@ spec:
type: LoadBalancer
ports:
- name: http
port: 9001
port: 80
nodePort: 9001
targetPort: http
selector:
app: spring-petclinic-plain
3 changes: 2 additions & 1 deletion applications/petclinic/fluxv1/plain-k8s/k8s/qa/service.yaml
Expand Up @@ -9,7 +9,8 @@ spec:
type: LoadBalancer
ports:
- name: http
port: 9002
port: 80
nodePort: 9002
targetPort: http
selector:
app: spring-petclinic-plain
Expand Up @@ -9,7 +9,8 @@ spec:
type: LoadBalancer
ports:
- name: http
port: 9000
port: 80
nodePort: 9000
targetPort: http
selector:
app: spring-petclinic-plain
4 changes: 2 additions & 2 deletions applications/petclinic/fluxv2/plain-k8s/Jenkinsfile
Expand Up @@ -3,8 +3,8 @@
// "Constants"
String getApplication() {"spring-petclinic-plain" }
String getScmManagerCredentials() { 'scmm-user' }
String getConfigRepositoryUrl() { "http://scmm-scm-manager:9091/scm/repo/fluxv2/gitops" }
String getConfigRepositoryPRUrl() { 'http://scmm-scm-manager:9091/scm/api/v2/pull-requests/fluxv2/gitops' }
String getConfigRepositoryUrl() { "http://scmm-scm-manager/scm/repo/fluxv2/gitops" }
String getConfigRepositoryPRUrl() { 'http://scmm-scm-manager/scm/api/v2/pull-requests/fluxv2/gitops' }
// The docker daemon cant use the k8s service name, because it is not running inside the cluster
String getDockerRegistryBaseUrl() { "localhost:30000" }
String getCesBuildLibVersion() { '1.44.3' }
Expand Down
Expand Up @@ -9,7 +9,8 @@ spec:
type: LoadBalancer
ports:
- name: http
port: 9011
port: 80
nodePort: 9011
targetPort: http
selector:
app: spring-petclinic-plain
Expand Up @@ -9,7 +9,8 @@ spec:
type: LoadBalancer
ports:
- name: http
port: 9010
port: 80
nodePort: 9010
targetPort: http
selector:
app: spring-petclinic-plain
2 changes: 1 addition & 1 deletion argocd/resources/application-gitops-production.yaml
Expand Up @@ -10,7 +10,7 @@ spec:
project: playground
source:
path: production
repoURL: http://scmm-scm-manager.default.svc.cluster.local:9091/scm/repo/argocd/gitops
repoURL: http://scmm-scm-manager.default.svc.cluster.local/scm/repo/argocd/gitops
targetRevision: main
directory:
recurse: true
Expand Down
2 changes: 1 addition & 1 deletion argocd/resources/application-gitops-staging.yaml
Expand Up @@ -10,7 +10,7 @@ spec:
project: playground
source:
path: staging
repoURL: http://scmm-scm-manager.default.svc.cluster.local:9091/scm/repo/argocd/gitops
repoURL: http://scmm-scm-manager.default.svc.cluster.local/scm/repo/argocd/gitops
targetRevision: main
directory:
recurse: true
Expand Down
2 changes: 1 addition & 1 deletion argocd/resources/application-nginx-helm.yaml
Expand Up @@ -10,7 +10,7 @@ spec:
project: playground
source:
path: .
repoURL: http://scmm-scm-manager.default.svc.cluster.local:9091/scm/repo/argocd/nginx-helm
repoURL: http://scmm-scm-manager.default.svc.cluster.local/scm/repo/argocd/nginx-helm
targetRevision: main
syncPolicy:
automated: {}
4 changes: 2 additions & 2 deletions argocd/resources/project-playground.yaml
Expand Up @@ -11,6 +11,6 @@ spec:
- namespace: argocd-staging
server: https://kubernetes.default.svc
sourceRepos:
- http://scmm-scm-manager.default.svc.cluster.local:9091/scm/repo/argocd/gitops
- http://scmm-scm-manager.default.svc.cluster.local:9091/scm/repo/argocd/nginx-helm
- http://scmm-scm-manager.default.svc.cluster.local/scm/repo/argocd/gitops
- http://scmm-scm-manager.default.svc.cluster.local/scm/repo/argocd/nginx-helm
- https://charts.bitnami.com/bitnami
7 changes: 3 additions & 4 deletions argocd/values.yaml
Expand Up @@ -3,21 +3,20 @@ server:
## Server service configuration
service:
type: LoadBalancer
servicePortHttp: 9092
servicePortHttps: 9093
# nodePort cannot be set via the helm chart, so they are set via apply.sh for local cluster

## ArgoCD config
## reference https://github.com/argoproj/argo-cd/blob/master/docs/operator-manual/argocd-cm.yaml
config:
repositories: |
- url: http://scmm-scm-manager.default.svc.cluster.local:9091/scm/repo/argocd/gitops
- url: http://scmm-scm-manager.default.svc.cluster.local/scm/repo/argocd/gitops
passwordSecret:
name: gitops-scmm
key: PASSWORD
usernameSecret:
name: gitops-scmm
key: USERNAME
- url: http://scmm-scm-manager.default.svc.cluster.local:9091/scm/repo/argocd/nginx-helm
- url: http://scmm-scm-manager.default.svc.cluster.local/scm/repo/argocd/nginx-helm
passwordSecret:
name: gitops-scmm
key: PASSWORD
Expand Down
2 changes: 1 addition & 1 deletion fluxv1/flux-operator/values.yaml
@@ -1,7 +1,7 @@
env:
secretName: gitops-scmm
git:
url: "http://$(username):$(password)@scmm-scm-manager.default.svc.cluster.local:9091/scm/repo/fluxv1/gitops"
url: "http://$(username):$(password)@scmm-scm-manager.default.svc.cluster.local/scm/repo/fluxv1/gitops"
branch: "main"
readonly: true
pollInterval: "1m"
Expand Down
Expand Up @@ -12,4 +12,4 @@ spec:
branch: main
secretRef:
name: gitops-scmm
url: http://scmm-scm-manager.default.svc.cluster.local:9091/scm/repo/fluxv2/gitops
url: http://scmm-scm-manager.default.svc.cluster.local/scm/repo/fluxv2/gitops
12 changes: 6 additions & 6 deletions jenkins/values.yaml
Expand Up @@ -9,7 +9,7 @@ master:
tag: 2.249.3-lts-jdk11

serviceType: LoadBalancer
servicePort: 9090
servicePort: 80
# Is ignored when type is LoadBalancer. For local cluster we change the service type to NodePort
nodePort: 9090

Expand Down Expand Up @@ -66,7 +66,7 @@ master:
branchSources {
git {
id('fluxv1-petclinic-plain')
remote('http://scmm-scm-manager:9091/scm/repo/fluxv1/petclinic-plain')
remote('http://scmm-scm-manager/scm/repo/fluxv1/petclinic-plain')
credentialsId('scmm-user')
}
}
Expand All @@ -76,7 +76,7 @@ master:
branchSources {
git {
id('fluxv1-petclinic-helm')
remote('http://scmm-scm-manager:9091/scm/repo/fluxv1/petclinic-helm')
remote('http://scmm-scm-manager/scm/repo/fluxv1/petclinic-helm')
credentialsId('scmm-user')
}
}
Expand All @@ -86,7 +86,7 @@ master:
branchSources {
git {
id('fluxv1-nginx')
remote('http://scmm-scm-manager:9091/scm/repo/fluxv1/nginx-helm')
remote('http://scmm-scm-manager/scm/repo/fluxv1/nginx-helm')
credentialsId('scmm-user')
}
}
Expand All @@ -96,7 +96,7 @@ master:
branchSources {
git {
id('fluxv2-petclinic-plain')
remote('http://scmm-scm-manager:9091/scm/repo/fluxv2/petclinic-plain')
remote('http://scmm-scm-manager/scm/repo/fluxv2/petclinic-plain')
credentialsId('scmm-user')
}
}
Expand All @@ -106,7 +106,7 @@ master:
branchSources {
git {
id('argocd-petclinic-plain')
remote('http://scmm-scm-manager:9091/scm/repo/argocd/petclinic-plain')
remote('http://scmm-scm-manager/scm/repo/argocd/petclinic-plain')
credentialsId('scmm-user')
}
}
Expand Down
3 changes: 3 additions & 0 deletions scm-manager/chart/templates/service.yaml
Expand Up @@ -38,6 +38,9 @@ spec:
targetPort: 8080
protocol: TCP
name: http
{{- if (not (empty .Values.service.nodePort)) }}
nodePort: {{ .Values.service.nodePort }}
{{- end }}
selector:
app: {{ include "scm-manager.name" . }}
release: {{ .Release.Name }}
2 changes: 2 additions & 0 deletions scm-manager/chart/values.yaml
Expand Up @@ -44,6 +44,8 @@ service:
type: LoadBalancer
# service.port -- k8s service port
port: 80
# service.nodePort -- k8s service node port
#nodePort:

ingress:
# ingress.enabled -- Enables ingress
Expand Down
2 changes: 1 addition & 1 deletion scm-manager/initscmm.sh
Expand Up @@ -70,7 +70,7 @@ function addRepo() {

function setConfig() {
./curl -i -L -X PUT -H "Content-Type: application/vnd.scmm-config+json;v=2" \
--data "{\"proxyPassword\":null,\"proxyPort\":8080,\"proxyServer\":\"proxy.mydomain.com\",\"proxyUser\":null,\"enableProxy\":false,\"realmDescription\":\"SONIA :: SCM Manager\",\"disableGroupingGrid\":false,\"dateFormat\":\"YYYY-MM-DD HH:mm:ss\",\"anonymousAccessEnabled\":false,\"anonymousMode\":\"PROTOCOL_ONLY\",\"baseUrl\":\"http://scmm-scm-manager:9091/scm\",\"forceBaseUrl\":false,\"loginAttemptLimit\":-1,\"proxyExcludes\":[],\"skipFailedAuthenticators\":false,\"pluginUrl\":\"https://plugin-center-api.scm-manager.org/api/v1/plugins/{version}?os={os}&arch={arch}\",\"loginAttemptLimitTimeout\":300,\"enabledXsrfProtection\":true,\"namespaceStrategy\":\"CustomNamespaceStrategy\",\"loginInfoUrl\":\"https://login-info.scm-manager.org/api/v1/login-info\",\"releaseFeedUrl\":\"https://scm-manager.org/download/rss.xml\",\"mailDomainName\":\"scm-manager.local\",\"_links\":{\"self\":{\"href\":\"http://localhost:9091/scm/api/v2/config\"},\"update\":{\"href\":\"http://localhost:9091/scm/api/v2/config\"}},\"adminGroups\":[],\"adminUsers\":[]}" \
--data "{\"proxyPassword\":null,\"proxyPort\":8080,\"proxyServer\":\"proxy.mydomain.com\",\"proxyUser\":null,\"enableProxy\":false,\"realmDescription\":\"SONIA :: SCM Manager\",\"disableGroupingGrid\":false,\"dateFormat\":\"YYYY-MM-DD HH:mm:ss\",\"anonymousAccessEnabled\":false,\"anonymousMode\":\"PROTOCOL_ONLY\",\"baseUrl\":\"http://scmm-scm-manager/scm\",\"forceBaseUrl\":false,\"loginAttemptLimit\":-1,\"proxyExcludes\":[],\"skipFailedAuthenticators\":false,\"pluginUrl\":\"https://plugin-center-api.scm-manager.org/api/v1/plugins/{version}?os={os}&arch={arch}\",\"loginAttemptLimitTimeout\":300,\"enabledXsrfProtection\":true,\"namespaceStrategy\":\"CustomNamespaceStrategy\",\"loginInfoUrl\":\"https://login-info.scm-manager.org/api/v1/login-info\",\"releaseFeedUrl\":\"https://scm-manager.org/download/rss.xml\",\"mailDomainName\":\"scm-manager.local\",\"adminGroups\":[],\"adminUsers\":[]}" \
"http://${SCM_USER}:${SCM_PWD}@${HOST}/scm/api/v2/config"
}

Expand Down
3 changes: 2 additions & 1 deletion scm-manager/values.yaml
Expand Up @@ -2,7 +2,8 @@ image:
tag: 2.9.1

service:
port: 9091
port: 80
nodePort: 9091

persistence:
size: 1Gi
Expand Down

0 comments on commit 3b7c315

Please sign in to comment.