Skip to content

Commit

Permalink
Added example of runtime configuration and the corresponding README f…
Browse files Browse the repository at this point in the history
…ile for Kubernetes example
  • Loading branch information
alefais committed May 13, 2022
1 parent 63c0d71 commit fbd35d1
Show file tree
Hide file tree
Showing 5 changed files with 237 additions and 0 deletions.
15 changes: 15 additions & 0 deletions complete-kubernetes-app/k8-config-runtime/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
## Check runtime configuration

### Use the following ```kubectl get``` commands to generate the ```yaml``` files with the actual deployment status

```
$ kubectl get deployment mongodb-deployment -o yaml > mongodb-deployment-result.yaml
$ kubectl get deployment mongo-express -o yaml > mongoexpress-deployment-result.yaml
$ kubectl get service mongodb-service -o yaml > mongodb-service-result.yaml
$ kubectl get service mongo-express-service -o yaml > mongoexpress-service-result.yaml
```

The output files generated with these commands can be found in the current directory.
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
apiVersion: apps/v1
kind: Deployment
metadata:
annotations:
deployment.kubernetes.io/revision: "1"
kubectl.kubernetes.io/last-applied-configuration: |
{"apiVersion":"apps/v1","kind":"Deployment","metadata":{"annotations":{},"labels":{"app":"mongodb"},"name":"mongodb-deployment","namespace":"default"},"spec":{"replicas":1,"selector":{"matchLabels":{"app":"mongodb"}},"template":{"metadata":{"labels":{"app":"mongodb"}},"spec":{"containers":[{"env":[{"name":"MONGO_INITDB_ROOT_USERNAME","valueFrom":{"secretKeyRef":{"key":"mongo-root-username","name":"mongodb-secret"}}},{"name":"MONGO_INITDB_ROOT_PASSWORD","valueFrom":{"secretKeyRef":{"key":"mongo-root-password","name":"mongodb-secret"}}}],"image":"mongo","name":"mongodb","ports":[{"containerPort":27017}]}]}}}}
creationTimestamp: "2022-05-12T11:13:29Z"
generation: 1
labels:
app: mongodb
name: mongodb-deployment
namespace: default
resourceVersion: "12173"
uid: c194bfbe-0d00-4035-a110-1a3f4d7d0db7
spec:
progressDeadlineSeconds: 600
replicas: 1
revisionHistoryLimit: 10
selector:
matchLabels:
app: mongodb
strategy:
rollingUpdate:
maxSurge: 25%
maxUnavailable: 25%
type: RollingUpdate
template:
metadata:
creationTimestamp: null
labels:
app: mongodb
spec:
containers:
- env:
- name: MONGO_INITDB_ROOT_USERNAME
valueFrom:
secretKeyRef:
key: mongo-root-username
name: mongodb-secret
- name: MONGO_INITDB_ROOT_PASSWORD
valueFrom:
secretKeyRef:
key: mongo-root-password
name: mongodb-secret
image: mongo
imagePullPolicy: Always
name: mongodb
ports:
- containerPort: 27017
protocol: TCP
resources: {}
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
dnsPolicy: ClusterFirst
restartPolicy: Always
schedulerName: default-scheduler
securityContext: {}
terminationGracePeriodSeconds: 30
status:
availableReplicas: 1
conditions:
- lastTransitionTime: "2022-05-12T11:13:33Z"
lastUpdateTime: "2022-05-12T11:13:33Z"
message: Deployment has minimum availability.
reason: MinimumReplicasAvailable
status: "True"
type: Available
- lastTransitionTime: "2022-05-12T11:13:29Z"
lastUpdateTime: "2022-05-12T11:13:33Z"
message: ReplicaSet "mongodb-deployment-7bb6c6c4c7" has successfully progressed.
reason: NewReplicaSetAvailable
status: "True"
type: Progressing
observedGeneration: 1
readyReplicas: 1
replicas: 1
updatedReplicas: 1
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
apiVersion: v1
kind: Service
metadata:
annotations:
kubectl.kubernetes.io/last-applied-configuration: |
{"apiVersion":"v1","kind":"Service","metadata":{"annotations":{},"name":"mongodb-service","namespace":"default"},"spec":{"ports":[{"port":27017,"protocol":"TCP","targetPort":27017}],"selector":{"app":"mongodb"}}}
creationTimestamp: "2022-05-12T11:18:08Z"
name: mongodb-service
namespace: default
resourceVersion: "12369"
uid: a551adfc-2639-4068-8a20-ef3f11c48f01
spec:
clusterIP: 10.110.121.98
clusterIPs:
- 10.110.121.98
internalTrafficPolicy: Cluster
ipFamilies:
- IPv4
ipFamilyPolicy: SingleStack
ports:
- port: 27017
protocol: TCP
targetPort: 27017
selector:
app: mongodb
sessionAffinity: None
type: ClusterIP
status:
loadBalancer: {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
apiVersion: apps/v1
kind: Deployment
metadata:
annotations:
deployment.kubernetes.io/revision: "1"
kubectl.kubernetes.io/last-applied-configuration: |
{"apiVersion":"apps/v1","kind":"Deployment","metadata":{"annotations":{},"labels":{"app":"mongo-express"},"name":"mongo-express","namespace":"default"},"spec":{"replicas":1,"selector":{"matchLabels":{"app":"mongo-express"}},"template":{"metadata":{"labels":{"app":"mongo-express"}},"spec":{"containers":[{"env":[{"name":"ME_CONFIG_MONGODB_ADMINUSERNAME","valueFrom":{"secretKeyRef":{"key":"mongo-root-username","name":"mongodb-secret"}}},{"name":"ME_CONFIG_MONGODB_ADMINPASSWORD","valueFrom":{"secretKeyRef":{"key":"mongo-root-password","name":"mongodb-secret"}}},{"name":"ME_CONFIG_MONGODB_SERVER","valueFrom":{"configMapKeyRef":{"key":"database_url","name":"mongodb-configmap"}}}],"image":"mongo-express","name":"mongo-express","ports":[{"containerPort":8081}]}]}}}}
creationTimestamp: "2022-05-12T11:30:46Z"
generation: 1
labels:
app: mongo-express
name: mongo-express
namespace: default
resourceVersion: "12926"
uid: 2d46e40a-3d28-4e25-8d9e-1a782aaca36f
spec:
progressDeadlineSeconds: 600
replicas: 1
revisionHistoryLimit: 10
selector:
matchLabels:
app: mongo-express
strategy:
rollingUpdate:
maxSurge: 25%
maxUnavailable: 25%
type: RollingUpdate
template:
metadata:
creationTimestamp: null
labels:
app: mongo-express
spec:
containers:
- env:
- name: ME_CONFIG_MONGODB_ADMINUSERNAME
valueFrom:
secretKeyRef:
key: mongo-root-username
name: mongodb-secret
- name: ME_CONFIG_MONGODB_ADMINPASSWORD
valueFrom:
secretKeyRef:
key: mongo-root-password
name: mongodb-secret
- name: ME_CONFIG_MONGODB_SERVER
valueFrom:
configMapKeyRef:
key: database_url
name: mongodb-configmap
image: mongo-express
imagePullPolicy: Always
name: mongo-express
ports:
- containerPort: 8081
protocol: TCP
resources: {}
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
dnsPolicy: ClusterFirst
restartPolicy: Always
schedulerName: default-scheduler
securityContext: {}
terminationGracePeriodSeconds: 30
status:
availableReplicas: 1
conditions:
- lastTransitionTime: "2022-05-12T11:30:49Z"
lastUpdateTime: "2022-05-12T11:30:49Z"
message: Deployment has minimum availability.
reason: MinimumReplicasAvailable
status: "True"
type: Available
- lastTransitionTime: "2022-05-12T11:30:46Z"
lastUpdateTime: "2022-05-12T11:30:49Z"
message: ReplicaSet "mongo-express-68c4748bd6" has successfully progressed.
reason: NewReplicaSetAvailable
status: "True"
type: Progressing
observedGeneration: 1
readyReplicas: 1
replicas: 1
updatedReplicas: 1
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
apiVersion: v1
kind: Service
metadata:
annotations:
kubectl.kubernetes.io/last-applied-configuration: |
{"apiVersion":"v1","kind":"Service","metadata":{"annotations":{},"name":"mongo-express-service","namespace":"default"},"spec":{"ports":[{"nodePort":30000,"port":8081,"protocol":"TCP","targetPort":8081}],"selector":{"app":"mongo-express"},"type":"LoadBalancer"}}
creationTimestamp: "2022-05-12T11:33:21Z"
name: mongo-express-service
namespace: default
resourceVersion: "13035"
uid: 2325831f-903f-4bfb-9692-6935cb06bc8d
spec:
allocateLoadBalancerNodePorts: true
clusterIP: 10.111.144.104
clusterIPs:
- 10.111.144.104
externalTrafficPolicy: Cluster
internalTrafficPolicy: Cluster
ipFamilies:
- IPv4
ipFamilyPolicy: SingleStack
ports:
- nodePort: 30000
port: 8081
protocol: TCP
targetPort: 8081
selector:
app: mongo-express
sessionAffinity: None
type: LoadBalancer
status:
loadBalancer: {}

0 comments on commit fbd35d1

Please sign in to comment.