Skip to content

Commit 93c4b72

Browse files
authored
CLOUDP-82260. Application (#181)
1 parent 5a012ed commit 93c4b72

29 files changed

+690
-329
lines changed

.github/workflows/test.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,8 @@ jobs:
118118
if: ${{ steps.properties.outputs.k8s_platform == 'kind' && !env.ACT }}
119119
uses: helm/[email protected]
120120
with:
121+
version: v0.10.0
122+
config: test/e2e/config/kind.yaml
121123
node_image: kindest/node:${{ steps.properties.outputs.k8s_version }}
122124
cluster_name: ${{ matrix.test }}
123125

@@ -149,7 +151,7 @@ jobs:
149151
go version
150152
go get github.com/onsi/ginkgo/ginkgo && \
151153
go get github.com/onsi/gomega/...
152-
ginkgo --focus "${TEST_NAME}" -nodes=3 -x test/e2e/
154+
ginkgo --focus "${TEST_NAME}" -nodes=3 test/e2e/
153155
154156
- name: Upload operator logs
155157
if: ${{ failure() }}

.golangci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,5 +90,6 @@ issues:
9090
linters:
9191
- errcheck
9292
- stylecheck
93+
- noctx
9394
max-issues-per-linter: 0
9495
max-same-issues: 0

scripts/create_kind_cluster.sh

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,34 @@ containerdConfigPatches:
2525
- |-
2626
[plugins."io.containerd.grpc.v1.cri".registry.mirrors."localhost:${reg_port}"]
2727
endpoint = ["http://${reg_name}:${reg_port}"]
28+
nodes:
29+
- role: control-plane
30+
# port forward 80 on the host to 80 on this node
31+
extraPortMappings:
32+
- containerPort: 30000
33+
hostPort: 30000
34+
listenAddress: "0.0.0.0"
35+
protocol: TCP
36+
- containerPort: 30001
37+
hostPort: 30001
38+
listenAddress: "0.0.0.0"
39+
protocol: TCP
40+
- containerPort: 30002
41+
hostPort: 30002
42+
listenAddress: "0.0.0.0"
43+
protocol: TCP
44+
- containerPort: 30003
45+
hostPort: 30003
46+
listenAddress: "0.0.0.0"
47+
protocol: TCP
48+
- containerPort: 30004
49+
hostPort: 30004
50+
listenAddress: "0.0.0.0"
51+
protocol: TCP
52+
- containerPort: 30005
53+
hostPort: 30005
54+
listenAddress: "0.0.0.0"
55+
protocol: TCP
2856
EOF
2957

3058
# connect the registry to the cluster network

test/app/Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# Please push to mongodbinternal/test-app:v1
2+
13
# Build the manager binary
24
FROM golang:1.15 as builder
35

test/app/helm/.helmignore

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Patterns to ignore when building packages.
2+
# This supports shell glob matching, relative path matching, and
3+
# negation (prefixed with !). Only one pattern per line.
4+
.DS_Store
5+
# Common VCS dirs
6+
.git/
7+
.gitignore
8+
.bzr/
9+
.bzrignore
10+
.hg/
11+
.hgignore
12+
.svn/
13+
# Common backup files
14+
*.swp
15+
*.bak
16+
*.tmp
17+
*.orig
18+
*~
19+
# Various IDEs
20+
.project
21+
.idea/
22+
*.tmproj
23+
.vscode/

test/app/helm/Chart.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
apiVersion: v2
2+
name: test-app
3+
description: Test application for atlas operator
4+
5+
# A chart can be either an 'application' or a 'library' chart.
6+
#
7+
# Application charts are a collection of templates that can be packaged into versioned archives
8+
# to be deployed.
9+
#
10+
# Library charts provide useful utilities or functions for the chart developer. They're included as
11+
# a dependency of application charts to inject those utilities and functions into the rendering
12+
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
13+
type: application
14+
15+
# This is the chart version. This version number should be incremented each time you make changes
16+
# to the chart and its templates, including the app version.
17+
# Versions are expected to follow Semantic Versioning (https://semver.org/)
18+
version: 0.1.0
19+
20+
# This is the version number of the application being deployed. This version number should be
21+
# incremented each time you make changes to the application. Versions are not expected to
22+
# follow Semantic Versioning. They should reflect the version the application is using.
23+
appVersion: 0.1.0
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
#spring music test app
2+
apiVersion: apps/v1
3+
kind: Deployment
4+
metadata:
5+
name: {{ .Release.Name }}
6+
namespace: {{ .Release.Namespace }}
7+
spec:
8+
replicas: 1
9+
selector:
10+
matchLabels:
11+
app: {{ .Release.Name }}
12+
template:
13+
metadata:
14+
labels:
15+
app: {{ .Release.Name }}
16+
spec:
17+
containers:
18+
- name: test-app
19+
image: {{ .Values.image }}
20+
env:
21+
- name: "CONNECTIONSTRING"
22+
valueFrom:
23+
secretKeyRef:
24+
name: {{ .Values.connectionSecret }}
25+
key: connectionString.standardSrv
26+
- name: "PORT"
27+
value: {{ quote .Values.nodePort }}
28+
---
29+
apiVersion: v1
30+
kind: Service
31+
metadata:
32+
name: {{ .Release.Name }}
33+
labels:
34+
app: {{ .Release.Name }}
35+
spec:
36+
type: NodePort
37+
selector:
38+
app: {{ .Release.Name }}
39+
ports:
40+
- protocol: TCP
41+
port: {{ .Values.nodePort }}
42+
targetPort: {{ .Values.nodePort }}
43+
nodePort: {{ .Values.nodePort }}

test/app/helm/values.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# application parameters
2+
name: test-app-user1
3+
connectionSecret: new-brand
4+
image: mongodbinternal/test-app:v1
5+
nodePort: "30000"

test/app/k8s/deployment.json

Lines changed: 0 additions & 7 deletions
This file was deleted.

test/app/k8s/deployment.yaml

Lines changed: 0 additions & 30 deletions
This file was deleted.

0 commit comments

Comments
 (0)