Created
April 11, 2022 06:34
-
-
Save antweiss/2992accce07677fb8b4a277191fd74e5 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
apiVersion: v1 | |
kind: Service | |
metadata: | |
name: nginx | |
namespace: orange | |
labels: | |
app: nginx | |
spec: | |
ports: | |
- port: 80 | |
name: web | |
clusterIP: None | |
selector: | |
app: nginx | |
--- | |
apiVersion: apps/v1 | |
kind: StatefulSet | |
metadata: | |
name: nginx | |
namespace: orange | |
spec: | |
replicas: 2 | |
serviceName: nginx | |
selector: | |
matchLabels: | |
app: nginx | |
volumeClaimTemplates: | |
- metadata: | |
name: www | |
spec: | |
storageClassName: k3d | |
accessModes: | |
- ReadWriteMany | |
resources: | |
requests: | |
storage: 1Gi | |
template: | |
metadata: | |
labels: | |
app: nginx | |
spec: | |
affinity: | |
podAntiAffinity: | |
requiredDuringSchedulingIgnoredDuringExecution: | |
- labelSelector: | |
matchExpressions: | |
- key: app | |
operator: In | |
values: | |
- nginx | |
topologyKey: kubernetes.io/hostname | |
initContainers: | |
- name: git | |
image: alpine/git | |
command: [ "sh", "-c", "[ -f /www/index.html ] || git clone https://github.com/octocat/Spoon-Knife /www" ] | |
volumeMounts: | |
- name: www | |
mountPath: /www/ | |
containers: | |
- name: nginx | |
image: nginx | |
volumeMounts: | |
- name: www | |
mountPath: /usr/share/nginx/html/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment