mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-24 20:24:09 +00:00
Fix #19098 - misplace cassandra-controller in cassandra example
This commit is contained in:
parent
b5c12d10b8
commit
1ef6580ea3
@ -53,54 +53,48 @@ This is a somewhat long tutorial. If you want to jump straight to the "do it no
|
|||||||
In Kubernetes, the atomic unit of an application is a [_Pod_](../../docs/user-guide/pods.md). A Pod is one or more containers that _must_ be scheduled onto the same host. All containers in a pod share a network namespace, and may optionally share mounted volumes.
|
In Kubernetes, the atomic unit of an application is a [_Pod_](../../docs/user-guide/pods.md). A Pod is one or more containers that _must_ be scheduled onto the same host. All containers in a pod share a network namespace, and may optionally share mounted volumes.
|
||||||
In this simple case, we define a single container running Cassandra for our pod:
|
In this simple case, we define a single container running Cassandra for our pod:
|
||||||
|
|
||||||
<!-- BEGIN MUNGE: EXAMPLE cassandra-controller.yaml -->
|
<!-- BEGIN MUNGE: EXAMPLE cassandra.yaml -->
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: ReplicationController
|
kind: Pod
|
||||||
metadata:
|
metadata:
|
||||||
labels:
|
labels:
|
||||||
app: cassandra
|
app: cassandra
|
||||||
name: cassandra
|
name: cassandra
|
||||||
spec:
|
spec:
|
||||||
replicas: 1
|
containers:
|
||||||
template:
|
- args:
|
||||||
metadata:
|
- /run.sh
|
||||||
labels:
|
resources:
|
||||||
app: cassandra
|
limits:
|
||||||
spec:
|
cpu: "0.1"
|
||||||
containers:
|
image: gcr.io/google_containers/cassandra:v6
|
||||||
- command:
|
name: cassandra
|
||||||
- /run.sh
|
ports:
|
||||||
resources:
|
- name: cql
|
||||||
limits:
|
containerPort: 9042
|
||||||
cpu: 0.1
|
- name: thrift
|
||||||
env:
|
containerPort: 9160
|
||||||
- name: MAX_HEAP_SIZE
|
volumeMounts:
|
||||||
value: 512M
|
- name: data
|
||||||
- name: HEAP_NEWSIZE
|
mountPath: /cassandra_data
|
||||||
value: 100M
|
env:
|
||||||
- name: POD_NAMESPACE
|
- name: MAX_HEAP_SIZE
|
||||||
valueFrom:
|
value: 512M
|
||||||
fieldRef:
|
- name: HEAP_NEWSIZE
|
||||||
fieldPath: metadata.namespace
|
value: 100M
|
||||||
image: gcr.io/google_containers/cassandra:v7
|
- name: POD_NAMESPACE
|
||||||
name: cassandra
|
valueFrom:
|
||||||
ports:
|
fieldRef:
|
||||||
- containerPort: 9042
|
fieldPath: metadata.namespace
|
||||||
name: cql
|
volumes:
|
||||||
- containerPort: 9160
|
- name: data
|
||||||
name: thrift
|
emptyDir: {}
|
||||||
volumeMounts:
|
|
||||||
- mountPath: /cassandra_data
|
|
||||||
name: data
|
|
||||||
volumes:
|
|
||||||
- name: data
|
|
||||||
emptyDir: {}
|
|
||||||
```
|
```
|
||||||
|
|
||||||
[Download example](cassandra-controller.yaml?raw=true)
|
[Download example](cassandra.yaml?raw=true)
|
||||||
<!-- END MUNGE: EXAMPLE cassandra-controller.yaml -->
|
<!-- END MUNGE: EXAMPLE cassandra.yaml -->
|
||||||
|
|
||||||
There are a few things to note in this description. First is that we are running the [```gcr.io/google_containers/cassandra:v6```](image/Dockerfile) image from Google's [container registry](https://cloud.google.com/container-registry/docs/). This is a standard Cassandra installation on top of Debian. However it also adds a custom [```SeedProvider```](https://svn.apache.org/repos/asf/cassandra/trunk/src/java/org/apache/cassandra/locator/SeedProvider.java) to Cassandra. In Cassandra, a ```SeedProvider``` bootstraps the gossip protocol that Cassandra uses to find other nodes. The [```KubernetesSeedProvider```](#seed-provider-source) discovers the Kubernetes API Server using the built in Kubernetes discovery service, and then uses the Kubernetes API to find new nodes (more on this later)
|
There are a few things to note in this description. First is that we are running the [```gcr.io/google_containers/cassandra:v6```](image/Dockerfile) image from Google's [container registry](https://cloud.google.com/container-registry/docs/). This is a standard Cassandra installation on top of Debian. However it also adds a custom [```SeedProvider```](https://svn.apache.org/repos/asf/cassandra/trunk/src/java/org/apache/cassandra/locator/SeedProvider.java) to Cassandra. In Cassandra, a ```SeedProvider``` bootstraps the gossip protocol that Cassandra uses to find other nodes. The [```KubernetesSeedProvider```](#seed-provider-source) discovers the Kubernetes API Server using the built in Kubernetes discovery service, and then uses the Kubernetes API to find new nodes (more on this later)
|
||||||
|
|
||||||
@ -223,7 +217,7 @@ spec:
|
|||||||
valueFrom:
|
valueFrom:
|
||||||
fieldRef:
|
fieldRef:
|
||||||
fieldPath: metadata.namespace
|
fieldPath: metadata.namespace
|
||||||
image: gcr.io/google_containers/cassandra:v7
|
image: gcr.io/google_containers/cassandra:v6
|
||||||
name: cassandra
|
name: cassandra
|
||||||
ports:
|
ports:
|
||||||
- containerPort: 9042
|
- containerPort: 9042
|
||||||
@ -340,7 +334,7 @@ spec:
|
|||||||
valueFrom:
|
valueFrom:
|
||||||
fieldRef:
|
fieldRef:
|
||||||
fieldPath: metadata.namespace
|
fieldPath: metadata.namespace
|
||||||
image: "gcr.io/google_containers/cassandra:v7"
|
image: "gcr.io/google_containers/cassandra:v6"
|
||||||
name: cassandra
|
name: cassandra
|
||||||
ports:
|
ports:
|
||||||
- containerPort: 9042
|
- containerPort: 9042
|
||||||
|
@ -26,7 +26,7 @@ spec:
|
|||||||
valueFrom:
|
valueFrom:
|
||||||
fieldRef:
|
fieldRef:
|
||||||
fieldPath: metadata.namespace
|
fieldPath: metadata.namespace
|
||||||
image: gcr.io/google_containers/cassandra:v7
|
image: gcr.io/google_containers/cassandra:v6
|
||||||
name: cassandra
|
name: cassandra
|
||||||
ports:
|
ports:
|
||||||
- containerPort: 9042
|
- containerPort: 9042
|
||||||
|
@ -25,7 +25,7 @@ spec:
|
|||||||
valueFrom:
|
valueFrom:
|
||||||
fieldRef:
|
fieldRef:
|
||||||
fieldPath: metadata.namespace
|
fieldPath: metadata.namespace
|
||||||
image: "gcr.io/google_containers/cassandra:v7"
|
image: "gcr.io/google_containers/cassandra:v6"
|
||||||
name: cassandra
|
name: cassandra
|
||||||
ports:
|
ports:
|
||||||
- containerPort: 9042
|
- containerPort: 9042
|
||||||
|
@ -11,7 +11,7 @@ spec:
|
|||||||
resources:
|
resources:
|
||||||
limits:
|
limits:
|
||||||
cpu: "0.1"
|
cpu: "0.1"
|
||||||
image: gcr.io/google_containers/cassandra:v7
|
image: gcr.io/google_containers/cassandra:v6
|
||||||
name: cassandra
|
name: cassandra
|
||||||
ports:
|
ports:
|
||||||
- name: cql
|
- name: cql
|
||||||
|
Loading…
Reference in New Issue
Block a user