mirror of
https://github.com/jpetazzo/container.training.git
synced 2026-05-06 00:46:56 +00:00
kubectl run is being deprecated as a multi-purpose tool. This PR replaces 'kubectl run' with 'kubectl create deployment' in most places (except in the very first example, to reduce the cognitive load; and when we really want a single-shot container). It also updates the places where we use a 'run' label, since 'kubectl create deployment' uses the 'app' label instead. NOTE: this hasn't gone through end-to-end testing yet.
68 lines
1.4 KiB
YAML
68 lines
1.4 KiB
YAML
apiVersion: extensions/v1beta1
|
|
kind: Deployment
|
|
metadata:
|
|
annotations:
|
|
deployment.kubernetes.io/revision: "2"
|
|
creationTimestamp: null
|
|
generation: 1
|
|
labels:
|
|
app: socat
|
|
name: socat
|
|
namespace: kube-system
|
|
selfLink: /apis/extensions/v1beta1/namespaces/kube-system/deployments/socat
|
|
spec:
|
|
replicas: 1
|
|
selector:
|
|
matchLabels:
|
|
app: socat
|
|
strategy:
|
|
rollingUpdate:
|
|
maxSurge: 1
|
|
maxUnavailable: 1
|
|
type: RollingUpdate
|
|
template:
|
|
metadata:
|
|
creationTimestamp: null
|
|
labels:
|
|
app: socat
|
|
spec:
|
|
containers:
|
|
- args:
|
|
- sh
|
|
- -c
|
|
- apk add --no-cache socat && socat TCP-LISTEN:80,fork,reuseaddr OPENSSL:kubernetes-dashboard:443,verify=0
|
|
image: alpine
|
|
imagePullPolicy: Always
|
|
name: socat
|
|
resources: {}
|
|
terminationMessagePath: /dev/termination-log
|
|
terminationMessagePolicy: File
|
|
dnsPolicy: ClusterFirst
|
|
restartPolicy: Always
|
|
schedulerName: default-scheduler
|
|
securityContext: {}
|
|
terminationGracePeriodSeconds: 30
|
|
status: {}
|
|
---
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
creationTimestamp: null
|
|
labels:
|
|
app: socat
|
|
name: socat
|
|
namespace: kube-system
|
|
selfLink: /api/v1/namespaces/kube-system/services/socat
|
|
spec:
|
|
externalTrafficPolicy: Cluster
|
|
ports:
|
|
- port: 80
|
|
protocol: TCP
|
|
targetPort: 80
|
|
selector:
|
|
app: socat
|
|
sessionAffinity: None
|
|
type: NodePort
|
|
status:
|
|
loadBalancer: {}
|