Last active
July 13, 2019 09:35
-
-
Save sciabarracom/31bd990ce85064c1dd98b22d54343af5 to your computer and use it in GitHub Desktop.
Kubernetes Samples
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: apps/v1 | |
kind: Deployment | |
metadata: | |
name: registry | |
namespace: k8s | |
labels: | |
app: registry | |
spec: | |
replicas: 1 | |
selector: | |
matchLabels: | |
app: registry | |
template: | |
metadata: | |
labels: | |
app: registry | |
spec: | |
containers: | |
- name: socat | |
image: alpine/socat | |
ports: | |
- containerPort: 443 | |
command: | |
- socat | |
args: | |
- TCP-LISTEN:443,fork | |
- TCP:192.168.64.3:5000 |
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: batch/v1 | |
kind: Job | |
metadata: | |
namespace: default | |
name: knative-install | |
spec: | |
template: | |
spec: | |
serviceAccountName: knative-install-role | |
containers: | |
- name: setup | |
imagePullPolicy: Always | |
image: actionloop/knative-installer:latest | |
restartPolicy: Never | |
backoffLimit: 4 |
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: batch/v1 | |
kind: Job | |
metadata: | |
name: kanikojob | |
namespace: kanikotest | |
spec: | |
completions: 1 | |
template: | |
metadata: | |
name: kanikojob | |
namespace: kanikotest | |
spec: | |
restartPolicy: Never | |
initContainers: | |
- name: init-clone-repo | |
image: alpine/git | |
args: | |
- clone | |
- --single-branch | |
- -- | |
- https://github.com/repo/code.git | |
- /context | |
volumeMounts: | |
- name: context | |
mountPath: /context | |
containers: | |
- name: kaniko | |
image: gcr.io/kaniko-project/executor:latest | |
args: ["--dockerfile=/context/Dockerfile", | |
"--context=/context", | |
"--destination=registry/repo/container:latest"] | |
volumeMounts: | |
- name: context | |
mountPath: /context | |
- name: registry-creds | |
mountPath: /root/ | |
volumes: | |
- name: registry-creds | |
projected: | |
sources: | |
- secret: | |
name: docker-secret | |
items: | |
- key: .dockerconfigjson | |
path: .docker/config.json | |
- name: context | |
emptyDir: {} |
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: Pod | |
metadata: | |
name: nginx | |
labels: | |
app: nginx | |
spec: | |
containers: | |
- name: name | |
image: nginx | |
ports: | |
- containerPort: 80 | |
volumeMounts: | |
- name: config-vol | |
mountPath: /etc/nginx/conf.d | |
volumes: | |
- name: config-vol | |
configMap: | |
name: nginx-conf |
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 | |
spec: | |
selector: | |
app: nginx | |
ports: | |
- protocol: TCP | |
port: 80 | |
targetPort: 80 |
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: ServiceAccount | |
metadata: | |
name: knative-install-role | |
namespace: default | |
--- | |
apiVersion: rbac.authorization.k8s.io/v1 | |
kind: ClusterRoleBinding | |
metadata: | |
name: knative-install-role | |
namespace: default | |
subjects: | |
- kind: ServiceAccount | |
name: knative-install-role | |
namespace: default | |
roleRef: | |
kind: ClusterRole | |
name: cluster-admin | |
apiGroup: rbac.authorization.k8s.io |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment