Skip to content

Commit 33cf24a

Browse files
authored
Merge pull request #2 from ibm-cloud-architecture/bck-updates
Bck updates
2 parents fa16589 + eb5c573 commit 33cf24a

File tree

19 files changed

+504
-507
lines changed

19 files changed

+504
-507
lines changed

docs/openshift/configuration/config-map/index.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
ConfigMaps allow you to decouple configuration artifacts from image content to keep containerized applications portable.
44

55
You can data from a ConfigMap in 3 different ways.
6+
67
- As a single environment variable specific to a single key
78
- As a set of environment variables from all keys
89
- As a set of files, each key represented by a file on mounted volume
@@ -11,22 +12,22 @@ You can data from a ConfigMap in 3 different ways.
1112

1213
=== "OpenShift"
1314

14-
[Mapping Volumes :fontawesome-solid-globe:](https://docs.openshift.com/container-platform/4.13/nodes/containers/nodes-containers-projected-volumes.html){ .md-button target="_blank"}
15+
[Mapping Volumes :fontawesome-solid-map:](https://docs.openshift.com/container-platform/4.13/nodes/containers/nodes-containers-projected-volumes.html){ .md-button target="_blank"}
1516

1617
=== "Kubernetes"
1718

18-
[ConfigMaps :fontawesome-solid-globe:](https://kubernetes.io/docs/tasks/configure-pod-container/configure-pod-configmap/){ .md-button target="_blank"}
19+
[ConfigMaps :fontawesome-solid-map:](https://kubernetes.io/docs/tasks/configure-pod-container/configure-pod-configmap/){ .md-button target="_blank"}
1920

2021
## References
2122

2223
```yaml
2324
apiVersion: v1
2425
kind: ConfigMap
2526
metadata:
26-
name: my-cm
27+
name: my-cm
2728
data:
28-
color: blue
29-
location: naboo
29+
color: blue
30+
location: naboo
3031
```
3132
3233
```yaml
@@ -89,4 +90,4 @@ spec:
8990
- configMapRef:
9091
name: my-cm
9192
restartPolicy: Never
92-
```
93+
```

docs/openshift/configuration/index.md

Lines changed: 54 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ When you create a Pod, you can define a command and arguments for the containers
66

77
The command and arguments that you define in the configuration file override the default command and arguments provided by the container image
88

9-
Dockerfile vs Kubernetes
10-
Dockerfile Entrypoint -> k8s command
11-
Dockerfile CMD -> k8s args
9+
- Dockerfile vs Kubernetes
10+
- Dockerfile Entrypoint -> k8s command
11+
- Dockerfile CMD -> k8s args
1212

1313
### Ports
1414

@@ -24,11 +24,11 @@ A Pod can use environment variables to expose information about itself to Contai
2424

2525
=== "OpenShift & Kubernetes"
2626

27-
[Container Commands :fontawesome-solid-globe:](https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/){ .md-button target="_blank"}
27+
[Container Commands :fontawesome-solid-gear:](https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/){ .md-button target="_blank"}
2828

29-
[Environment Variables :fontawesome-solid-globe:](https://kubernetes.io/docs/tasks/inject-data-application/define-environment-variable-container/){ .md-button target="_blank"}
29+
[Environment Variables :fontawesome-solid-gear:](https://kubernetes.io/docs/tasks/inject-data-application/define-environment-variable-container/){ .md-button target="_blank"}
3030

31-
[Pod Exposing :fontawesome-solid-globe:](https://kubernetes.io/docs/concepts/services-networking/connect-applications-service/#exposing-pods-to-the-cluster){ .md-button target="_blank"}
31+
[Pod Exposing :fontawesome-solid-gear:](https://kubernetes.io/docs/concepts/services-networking/connect-applications-service/#exposing-pods-to-the-cluster){ .md-button target="_blank"}
3232

3333
### References
3434

@@ -39,9 +39,9 @@ metadata:
3939
name: my-cmd-pod
4040
spec:
4141
containers:
42-
- name: myapp-container
43-
image: busybox
44-
command: ['echo']
42+
- name: myapp-container
43+
image: busybox
44+
command: ["echo"]
4545
restartPolicy: Never
4646
```
4747
@@ -52,10 +52,10 @@ metadata:
5252
name: my-arg-pod
5353
spec:
5454
containers:
55-
- name: myapp-container
56-
image: busybox
57-
command: ['echo']
58-
args: ['Hello World']
55+
- name: myapp-container
56+
image: busybox
57+
command: ["echo"]
58+
args: ["Hello World"]
5959
restartPolicy: Never
6060
```
6161
@@ -66,10 +66,10 @@ metadata:
6666
name: my-port-pod
6767
spec:
6868
containers:
69-
- name: myapp-container
70-
image: bitnami/nginx
71-
ports:
72-
- containerPort: 8080
69+
- name: myapp-container
70+
image: bitnami/nginx
71+
ports:
72+
- containerPort: 8080
7373
```
7474
7575
```yaml
@@ -80,13 +80,13 @@ metadata:
8080
spec:
8181
restartPolicy: Never
8282
containers:
83-
- name: c
84-
image: busybox
85-
env:
86-
- name: DEMO_GREETING
87-
value: "Hello from the environment"
88-
command: ["echo"]
89-
args: ["$(DEMO_GREETING)"]
83+
- name: c
84+
image: busybox
85+
env:
86+
- name: DEMO_GREETING
87+
value: "Hello from the environment"
88+
command: ["echo"]
89+
args: ["$(DEMO_GREETING)"]
9090
```
9191
9292
```yaml
@@ -131,9 +131,9 @@ CPU and memory are each a resource type. A resource type has a base unit. CPU is
131131
132132
=== "OpenShift & Kubernetes"
133133
134-
[Compute Resources :fontawesome-solid-globe:](https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container){ .md-button target="_blank"}
134+
[Compute Resources :fontawesome-solid-screwdriver-wrench:](https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container){ .md-button target="_blank"}
135135
136-
[Memory Management :fontawesome-solid-globe:](https://kubernetes.io/docs/tasks/administer-cluster/manage-resources/memory-default-namespace/){ .md-button target="_blank"}
136+
[Memory Management :fontawesome-solid-screwdriver-wrench:](https://kubernetes.io/docs/tasks/administer-cluster/manage-resources/memory-default-namespace/){ .md-button target="_blank"}
137137
138138
### References
139139
@@ -144,53 +144,54 @@ metadata:
144144
name: my-pod
145145
spec:
146146
containers:
147-
- name: my-app
148-
image: bitnami/nginx
149-
ports:
150-
- containerPort: 8080
151-
resources:
152-
requests:
153-
memory: "64Mi"
154-
cpu: "250m"
155-
limits:
156-
memory: "128Mi"
157-
cpu: "500m"
147+
- name: my-app
148+
image: bitnami/nginx
149+
ports:
150+
- containerPort: 8080
151+
resources:
152+
requests:
153+
memory: "64Mi"
154+
cpu: "250m"
155+
limits:
156+
memory: "128Mi"
157+
cpu: "500m"
158158
```
159159
160+
_Namespaced defaults mem_
160161
161-
Namespaced defaults mem
162162
```yaml
163163
apiVersion: v1
164164
kind: LimitRange
165165
metadata:
166166
name: mem-limit-range
167167
spec:
168168
limits:
169-
- default:
170-
memory: 512Mi
171-
defaultRequest:
172-
memory: 256Mi
173-
type: Container
169+
- default:
170+
memory: 512Mi
171+
defaultRequest:
172+
memory: 256Mi
173+
type: Container
174174
```
175175
176-
Namespaced defaults mem
176+
_Namespaced defaults mem_
177+
177178
```yaml
178179
apiVersion: v1
179180
kind: LimitRange
180181
metadata:
181182
name: cpu-limit-range
182183
spec:
183184
limits:
184-
- default:
185-
cpu: 1
186-
defaultRequest:
187-
cpu: 0.5
188-
type: Container
185+
- default:
186+
cpu: 1
187+
defaultRequest:
188+
cpu: 0.5
189+
type: Container
189190
```
190191
191192
## Activities
192193
193-
| Task | Description | Link |
194-
| --------------------------------| ------------------ |:----------- |
195-
| *** Try It Yourself *** | | |
196-
| Pod Configuration | Configure a pod to meet compute resource requirements. | [Pod Configuration](../../labs/kubernetes/lab2/index.md) |
194+
| Task | Description | Link |
195+
| --------------------- | ------------------------------------------------------ | :------------------------------------------------------- |
196+
| **_Try It Yourself_** | | |
197+
| Pod Configuration | Configure a pod to meet compute resource requirements. | [Pod Configuration](../../labs/kubernetes/lab2/index.md) |

docs/openshift/configuration/secrets/index.md

Lines changed: 43 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ Kubernetes secret objects let you store and manage sensitive information, such a
44

55
A Secret is an object that contains a small amount of sensitive data such as a password, a token, or a key. Such information might otherwise be put in a Pod specification or in an image; putting it in a Secret object allows for more control over how it is used, and reduces the risk of accidental exposure.
66

7-
87
## Resources
98

109
=== "OpenShift"
@@ -30,15 +29,15 @@ A Secret is an object that contains a small amount of sensitive data such as a p
3029
</div>
3130

3231

33-
[Image Pull Secrets :fontawesome-solid-globe:](https://docs.openshift.com/container-platform/4.13/openshift_images/managing_images/using-image-pull-secrets.html){ .md-button target="_blank"}
32+
[Image Pull Secrets :fontawesome-solid-key:](https://docs.openshift.com/container-platform/4.13/openshift_images/managing_images/using-image-pull-secrets.html){ .md-button target="_blank"}
3433

35-
[Secret Commands :fontawesome-solid-globe:](https://docs.openshift.com/container-platform/4.13/cli_reference/openshift_cli/developer-cli-commands.html#oc-create-secret-generic){ .md-button target="_blank"}
34+
[Secret Commands :fontawesome-solid-key:](https://docs.openshift.com/container-platform/4.13/cli_reference/openshift_cli/developer-cli-commands.html#oc-create-secret-generic){ .md-button target="_blank"}
3635

3736
=== "Kubernetes"
3837

39-
[Secrets :fontawesome-solid-globe:](https://kubernetes.io/docs/concepts/configuration/secret/){ .md-button target="_blank"}
38+
[Secrets :fontawesome-solid-key:](https://kubernetes.io/docs/concepts/configuration/secret/){ .md-button target="_blank"}
4039

41-
[Secret Distribution :fontawesome-solid-globe:](https://kubernetes.io/docs/tasks/inject-data-application/distribute-credentials-secure/){ .md-button target="_blank"}
40+
[Secret Distribution :fontawesome-solid-key:](https://kubernetes.io/docs/tasks/inject-data-application/distribute-credentials-secure/){ .md-button target="_blank"}
4241

4342
## References
4443

@@ -74,62 +73,54 @@ metadata:
7473
name: my-pod
7574
spec:
7675
containers:
77-
- name: my-app
78-
image: bitnami/nginx
79-
ports:
80-
- containerPort: 8080
81-
env:
82-
- name: SECRET_USERNAME
83-
valueFrom:
84-
secretKeyRef:
76+
- name: my-app
77+
image: bitnami/nginx
78+
ports:
79+
- containerPort: 8080
80+
env:
81+
- name: SECRET_USERNAME
82+
valueFrom:
83+
secretKeyRef:
84+
name: mysecret
85+
key: username
86+
envFrom:
87+
- secretRef:
8588
name: mysecret
86-
key: username
87-
envFrom:
88-
- secretRef:
89-
name: mysecret
90-
volumeMounts:
91-
- name: config
92-
mountPath: "/etc/secrets"
89+
volumeMounts:
90+
- name: config
91+
mountPath: "/etc/secrets"
9392
volumes:
9493
- name: config
9594
secret:
9695
secretName: mysecret-config
9796
```
9897
9998
=== "OpenShift"
100-
**Create files needed for rest of example.**
101-
```
102-
echo -n 'admin' > ./username.txt
99+
**Create files needed for rest of example.**
100+
` echo -n 'admin' > ./username.txt
103101
echo -n '1f2d1e2e67df' > ./password.txt
104-
```
105-
**Creating Secret from files.**
106-
```
107-
oc create secret generic db-user-pass --from-file=./username.txt --from-file=./password.txt
108-
```
109-
**Getting Secret**
110-
```
111-
oc get secrets
112-
```
113-
**Gets the Secret's Description.**
114-
```
115-
oc describe secrets/db-user-pass
116-
```
102+
`
103+
**Creating Secret from files.**
104+
` oc create secret generic db-user-pass --from-file=./username.txt --from-file=./password.txt
105+
`
106+
**Getting Secret**
107+
` oc get secrets
108+
`
109+
**Gets the Secret's Description.**
110+
` oc describe secrets/db-user-pass
111+
`
117112
118113
=== "Kubernetes"
119-
**Create files needed for rest of example.**
120-
```
121-
echo -n 'admin' > ./username.txt
114+
**Create files needed for rest of example**
115+
` echo -n 'admin' > ./username.txt
122116
echo -n '1f2d1e2e67df' > ./password.txt
123-
```
124-
** Creates the Secret from the files**
125-
```
126-
kubectl create secret generic db-user-pass --from-file=./username.txt --from-file=./password.txt
127-
```
128-
**Gets the Secret**
129-
```
130-
kubectl get secrets
131-
```
132-
**Gets the Secret's Description.**
133-
```
134-
kubectl describe secrets/db-user-pass
135-
```
117+
`
118+
**Creates the Secret from the files**
119+
` kubectl create secret generic db-user-pass --from-file=./username.txt --from-file=./password.txt
120+
`
121+
**Gets the Secret**
122+
` kubectl get secrets
123+
`
124+
**Gets the Secret's Description**
125+
` kubectl describe secrets/db-user-pass
126+
`

0 commit comments

Comments
 (0)