generated from octoposprime/temp
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #51 from octoposprime/feature/sey/48/mongodb-insta…
…lled-and-configured MongoDB installation and configurations are completed
- Loading branch information
Showing
10 changed files
with
823 additions
and
0 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,47 @@ | ||
apiVersion: mongodbcommunity.mongodb.com/v1 | ||
kind: MongoDBCommunity | ||
metadata: | ||
name: mongodb | ||
spec: | ||
members: 1 | ||
type: ReplicaSet | ||
version: "6.0.5" | ||
security: | ||
authentication: | ||
modes: ["SCRAM"] | ||
users: | ||
- name: my-user | ||
db: admin | ||
passwordSecretRef: # a reference to the secret that will be used to generate the user's password | ||
name: my-user-password | ||
roles: | ||
- name: clusterAdmin | ||
db: admin | ||
- name: userAdminAnyDatabase | ||
db: admin | ||
scramCredentialsSecretName: my-scram | ||
additionalMongodConfig: | ||
storage.wiredTiger.engineConfig.journalCompressor: zlib | ||
|
||
# the user credentials will be generated from this secret | ||
# once the credentials are generated, this secret is no longer required | ||
--- | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: my-user-password | ||
type: Opaque | ||
stringData: | ||
password: "password-here" | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: mongodb-lb | ||
spec: | ||
type: LoadBalancer | ||
ports: | ||
- port: 27017 | ||
targetPort: 27017 | ||
selector: | ||
app: mongodb-svc |
Large diffs are not rendered by default.
Oops, something went wrong.
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,74 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
annotations: | ||
email: [email protected] | ||
labels: | ||
owner: mongodb | ||
name: mongodb-kubernetes-operator | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
name: mongodb-kubernetes-operator | ||
strategy: | ||
rollingUpdate: | ||
maxUnavailable: 1 | ||
type: RollingUpdate | ||
template: | ||
metadata: | ||
labels: | ||
name: mongodb-kubernetes-operator | ||
spec: | ||
affinity: | ||
podAntiAffinity: | ||
requiredDuringSchedulingIgnoredDuringExecution: | ||
- labelSelector: | ||
matchExpressions: | ||
- key: name | ||
operator: In | ||
values: | ||
- mongodb-kubernetes-operator | ||
topologyKey: kubernetes.io/hostname | ||
containers: | ||
- command: | ||
- /usr/local/bin/entrypoint | ||
env: | ||
- name: WATCH_NAMESPACE | ||
valueFrom: | ||
fieldRef: | ||
fieldPath: metadata.namespace | ||
- name: POD_NAME | ||
valueFrom: | ||
fieldRef: | ||
fieldPath: metadata.name | ||
- name: OPERATOR_NAME | ||
value: mongodb-kubernetes-operator | ||
- name: AGENT_IMAGE | ||
value: quay.io/mongodb/mongodb-agent:107.0.0.8465-1 | ||
- name: VERSION_UPGRADE_HOOK_IMAGE | ||
value: quay.io/mongodb/mongodb-kubernetes-operator-version-upgrade-post-start-hook:1.0.8 | ||
- name: READINESS_PROBE_IMAGE | ||
value: quay.io/mongodb/mongodb-kubernetes-readinessprobe:1.0.17 | ||
- name: MONGODB_IMAGE | ||
value: mongodb-community-server | ||
- name: MONGODB_REPO_URL | ||
value: quay.io/mongodb | ||
image: quay.io/mongodb/mongodb-kubernetes-operator:0.9.0 | ||
imagePullPolicy: Always | ||
name: mongodb-kubernetes-operator | ||
resources: | ||
limits: | ||
cpu: 1100m | ||
memory: 1Gi | ||
requests: | ||
cpu: 500m | ||
memory: 200Mi | ||
securityContext: | ||
readOnlyRootFilesystem: true | ||
runAsUser: 2000 | ||
allowPrivilegeEscalation: false | ||
securityContext: | ||
seccompProfile: | ||
type: RuntimeDefault | ||
serviceAccountName: mongodb-kubernetes-operator |
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 @@ | ||
resources: | ||
- role.yaml | ||
- role_binding.yaml | ||
- service_account.yaml | ||
- service_account_database.yaml | ||
- role_binding_database.yaml | ||
- role_database.yaml |
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: rbac.authorization.k8s.io/v1 | ||
kind: Role | ||
metadata: | ||
name: mongodb-kubernetes-operator | ||
rules: | ||
- apiGroups: | ||
- "" | ||
resources: | ||
- pods | ||
- services | ||
- configmaps | ||
- secrets | ||
verbs: | ||
- create | ||
- delete | ||
- get | ||
- list | ||
- patch | ||
- update | ||
- watch | ||
- apiGroups: | ||
- apps | ||
resources: | ||
- statefulsets | ||
verbs: | ||
- create | ||
- delete | ||
- get | ||
- list | ||
- patch | ||
- update | ||
- watch | ||
- apiGroups: | ||
- mongodbcommunity.mongodb.com | ||
resources: | ||
- mongodbcommunity | ||
- mongodbcommunity/status | ||
- mongodbcommunity/spec | ||
- mongodbcommunity/finalizers | ||
verbs: | ||
- get | ||
- patch | ||
- list | ||
- update | ||
- watch |
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,11 @@ | ||
kind: RoleBinding | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
metadata: | ||
name: mongodb-kubernetes-operator | ||
subjects: | ||
- kind: ServiceAccount | ||
name: mongodb-kubernetes-operator | ||
roleRef: | ||
kind: Role | ||
name: mongodb-kubernetes-operator | ||
apiGroup: rbac.authorization.k8s.io |
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,11 @@ | ||
kind: RoleBinding | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
metadata: | ||
name: mongodb-database | ||
subjects: | ||
- kind: ServiceAccount | ||
name: mongodb-database | ||
roleRef: | ||
kind: Role | ||
name: mongodb-database | ||
apiGroup: rbac.authorization.k8s.io |
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 @@ | ||
kind: Role | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
metadata: | ||
name: mongodb-database | ||
rules: | ||
- apiGroups: | ||
- "" | ||
resources: | ||
- secrets | ||
verbs: | ||
- get | ||
- apiGroups: | ||
- "" | ||
resources: | ||
- pods | ||
verbs: | ||
- patch | ||
- delete | ||
- get |
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,4 @@ | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: mongodb-kubernetes-operator |
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,4 @@ | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: mongodb-database |