-
-
Notifications
You must be signed in to change notification settings - Fork 673
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Add Kubernetes resources for deployment, pod, job, replicaset,…
… service, and namespace
- Loading branch information
1 parent
43c23b0
commit 96456f0
Showing
16 changed files
with
329 additions
and
24 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 |
---|---|---|
|
@@ -18,4 +18,5 @@ spec: | |
selfHeal: true | ||
syncOptions: | ||
- CreateNamespace=true # This will create namespace if not present | ||
|
||
|
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
9 changes: 9 additions & 0 deletions
9
docs/kubernetes/k8s-resources-type/configmap/configmap-file.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,9 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: file-like-keys | ||
data: | ||
conf.yml: | | ||
name: YourAppName | ||
version: 1.0.0 | ||
author: YourName |
8 changes: 8 additions & 0 deletions
8
docs/kubernetes/k8s-resources-type/configmap/configmap-keys.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,8 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: property-like-keys | ||
data: | ||
NAME: YourAppName | ||
VERSION: 1.0.0 | ||
AUTHOR: YourName |
15 changes: 15 additions & 0 deletions
15
docs/kubernetes/k8s-resources-type/configmap/pod-configmap-file.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,15 @@ | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
name: configmap-example-file | ||
spec: | ||
containers: | ||
- name: nginx | ||
image: nginx:1.26.0 | ||
volumeMounts: | ||
- name: configmap-file-like-keys | ||
mountPath: /etc/config | ||
volumes: | ||
- name: configmap-file-like-keys | ||
configMap: | ||
name: file-like-keys |
11 changes: 11 additions & 0 deletions
11
docs/kubernetes/k8s-resources-type/configmap/pod-configmap-key.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,11 @@ | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
name: configmap-example-key | ||
spec: | ||
containers: | ||
- name: nginx | ||
image: nginx:1.26.0 | ||
envFrom: | ||
- configMapRef: | ||
name: property-like-keys |
16 changes: 16 additions & 0 deletions
16
docs/kubernetes/k8s-resources-type/daemonset/daemonset.yml
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,16 @@ | ||
apiVersion: apps/v1 | ||
kind: DaemonSet | ||
metadata: | ||
name: fluentd-daemonset | ||
spec: | ||
selector: | ||
matchLabels: | ||
app: fluentd-app | ||
template: | ||
metadata: | ||
labels: | ||
app: fluentd-app | ||
spec: | ||
containers: | ||
- name: fluentd | ||
image: fluentd:v1.16-1 |
17 changes: 17 additions & 0 deletions
17
docs/kubernetes/k8s-resources-type/ingress/deployment.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,17 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: nginx-ingress-deployment | ||
spec: | ||
replicas: 3 | ||
selector: | ||
matchLabels: | ||
app: nginx-app | ||
template: | ||
metadata: | ||
labels: | ||
app: nginx-app | ||
spec: | ||
containers: | ||
- name: nginx | ||
image: nginx:1.26.0 |
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,17 @@ | ||
apiVersion: networking.k8s.io/v1 | ||
kind: Ingress | ||
metadata: | ||
name: nginx-ingress-ingress | ||
spec: | ||
ingressClassName: nginx | ||
rules: | ||
- host: fba5362f-28ca-4c8f-bf56-482fdeaeb331.lb.civo.com | ||
http: | ||
paths: | ||
- path: / | ||
pathType: Prefix | ||
backend: | ||
service: | ||
name: nginx-ingress-service | ||
port: | ||
number: 80 |
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,12 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: nginx-ingress-service | ||
spec: | ||
type: ClusterIP | ||
selector: | ||
app: nginx-app | ||
ports: | ||
- protocol: TCP | ||
port: 80 # Port the service is listening on | ||
targetPort: 80 # Port the container is listening on (if unset, defaults to equal port value) |
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 @@ | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: base64-data | ||
type: Opaque # This is the default type | ||
data: | ||
foo: bar |
8 changes: 8 additions & 0 deletions
8
docs/kubernetes/k8s-resources-type/secret/secret-dockerconfigjson.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,8 @@ | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: dockerconfigjson | ||
type: kubernetes.io/dockerconfigjson | ||
data: | ||
.dockerconfigjson: | | ||
eyJhdXRocyI6eyJodHRwczovL2luZGV4LmRvY2tlci5pby92MSI6eyJ1c2VybmFtZSI6InVzZXJuYW1lIiwicGFzc3dvcmQiOiJwYXNzd29yZCIsImVtYWlsIjoiZm9vQGJhci5jb20iLCJhdXRoIjoiZFhObGNtNWhiV1U2Y0dGemMzZHZjbVE9In19fQ== |
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 @@ | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: string-data | ||
type: Opaque # This is the default type | ||
stringData: | ||
foo: bar |
13 changes: 13 additions & 0 deletions
13
docs/kubernetes/k8s-resources-type/statefulset/service-nginx-headless.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,13 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: nginxs # Plural because it sets up DNS for each replica in the StatefulSet (e.g. nginx-0.nginxs.default.svc.cluster.local) | ||
spec: | ||
type: ClusterIP | ||
clusterIP: None # This makes it a "headless" service | ||
selector: | ||
app: nginx | ||
ports: | ||
- protocol: TCP | ||
port: 80 | ||
targetPort: 80 |
13 changes: 13 additions & 0 deletions
13
docs/kubernetes/k8s-resources-type/statefulset/service-nginx.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,13 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: nginx # singular since it points to a single cluster IP | ||
spec: | ||
type: ClusterIP | ||
selector: | ||
app: nginx | ||
ports: | ||
- protocol: TCP | ||
port: 80 | ||
targetPort: 80 | ||
|
Oops, something went wrong.